cabbage: update to 2.9.0.

This commit is contained in:
oreo639 2024-04-10 18:37:13 -07:00 committed by oreo639
parent d50d23ad71
commit c86a710036
4 changed files with 128 additions and 134 deletions

View File

@ -1,13 +0,0 @@
Index: cabbage-2.5.0/JUCE/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp
===================================================================
--- cabbage-2.5.0.orig/JUCE/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp
+++ cabbage-2.5.0/JUCE/modules/juce_gui_basics/native/juce_linux_X11_Windowing.cpp
@@ -24,6 +24,8 @@
==============================================================================
*/
+#include <array>
+
namespace juce
{

View File

@ -0,0 +1,44 @@
--- a/JUCE/modules/juce_core/native/juce_linux_SystemStats.cpp
+++ b/JUCE/modules/juce_core/native/juce_linux_SystemStats.cpp
@@ -198,7 +198,7 @@ String SystemStats::getComputerName()
String SystemStats::getUserLanguage()
{
- #if JUCE_BSD
+ #if JUCE_BSD || !defined(__GLIBC__)
if (auto langEnv = getenv ("LANG"))
return String::fromUTF8 (langEnv).upToLastOccurrenceOf (".UTF-8", false, true);
@@ -210,7 +210,7 @@ String SystemStats::getUserLanguage()
String SystemStats::getUserRegion()
{
- #if JUCE_BSD
+ #if JUCE_BSD || !defined(__GLIBC__)
return {};
#else
return getLocaleValue (_NL_IDENTIFICATION_TERRITORY);
--- a/JUCE/modules/juce_core/system/juce_SystemStats.cpp
+++ b/JUCE/modules/juce_core/system/juce_SystemStats.cpp
@@ -138,7 +138,7 @@ String SystemStats::getStackBacktrace()
{
String result;
- #if JUCE_ANDROID || JUCE_MINGW || JUCE_WASM
+ #if JUCE_ANDROID || JUCE_MINGW || JUCE_WASM || !defined(__GLIBC__)
jassertfalse; // sorry, not implemented yet!
#elif JUCE_WINDOWS
--- a/JUCE/modules/juce_core/juce_core.cpp
+++ b/JUCE/modules/juce_core/juce_core.cpp
@@ -102,7 +102,7 @@
#include <net/if.h>
#include <sys/ioctl.h>
- #if ! (JUCE_ANDROID || JUCE_WASM)
+ #if ! (JUCE_ANDROID || JUCE_WASM) && defined(__GLIBC__)
#include <execinfo.h>
#endif
#endif

View File

@ -1,13 +0,0 @@
Index: cabbage-2.5.0/cabbage/Source/Utilities/CabbageExportPlugin.cpp
===================================================================
--- cabbage-2.5.0.orig/cabbage/Source/Utilities/CabbageExportPlugin.cpp
+++ cabbage-2.5.0/cabbage/Source/Utilities/CabbageExportPlugin.cpp
@@ -84,7 +84,7 @@ void PluginExporter::exportPlugin (Strin
}
else if (type == "Standalone")
{
- pluginFilename = currentApplicationDirectory + "/CabbagePlugin." + fileExtension;
+ pluginFilename = currentApplicationDirectory + "/../lib/vst/CabbagePlugin." + fileExtension;
}
File VSTData (pluginFilename);

View File

@ -1,151 +1,127 @@
# Template file for 'cabbage'
pkgname=cabbage
version=2.5.0
revision=2
# specified in buildLinux.sh
_jucever=5.4.7
version=2.9.0
revision=1
# specified in build.py
_jucever=6.1.2
_vstsdkver=3611_22_10_2018_build_34
build_wrksrc="cabbage"
hostmakedepends="pkg-config xorg-server-xvfb"
build_style=cmake
configure_args="-DJUCE_TARGET_ARCHITECTURE=${XBPS_TARGET_MACHINE}"
hostmakedepends="pkg-config"
makedepends="libfreeglut-devel libcurl-devel jack-devel libXcomposite-devel
libXrandr-devel libXcursor-devel libX11-devel libXinerama-devel MesaLib-devel
gtk+3-devel webkit2gtk-devel csound alsa-lib-devel libsndfile-devel xvfb-run"
gtk+3-devel libwebkit2gtk41-devel csound alsa-lib-devel libsndfile-devel"
depends="csound"
short_desc="Framework for audio software development"
maintainer="Olga U <me@laserbat.pw>"
license="GPL-3.0-or-later"
homepage="https://cabbageaudio.com/"
distfiles="https://github.com/WeAreROLI/JUCE/archive/${_jucever}.tar.gz
distfiles="https://github.com/WeAreROLI/JUCE/archive/${_jucever}.tar.gz>juce-${_jucever}.tar.gz
https://github.com/rorywalsh/cabbage/archive/v${version}.tar.gz
https://cabbageaudio.com/beta/heads.zip
https://download.steinberg.net/sdk_downloads/vstsdk${_vstsdkver}.zip"
checksum="0f446cf09177e559d2f2e9a77a78faed611cc869e219a7dc859a6e9b72eca64d
68d2868ee72092ff1f809d472f561f5317512be91f1274390386afea248e78a2
checksum="7b519711f65bf14054cd5b579d936920066cfa15b60895c04bd9fa0cb087be28
66e81355399acebcea4e5723ec0d865f8458a8dbd0ddcde5f7fc714a04e51268
6167199d752fa301e93f1383f9ad700ef646611db53c97d7433fffdb19765e29
de64ff1b5b40a7fdc2de873e80d911ffa9fd6b82435a555dda1e8edc267d1fa3"
nocross="Projucer in template uses compiled binary"
skip_extraction="juce-${_jucever}.tar.gz vstsdk${_vstsdkver}.zip heads.zip"
patch_args="-Np1 --binary"
nocross="Fails to cross-compile juceaide"
CXXFLAGS="-DJUCER_ENABLE_GPL_MODE=1"
# vsx accel stuff from libpng is not shipped
case "$XBPS_TARGET_MACHINE" in
ppc*) CXXFLAGS="-DPNG_POWERPC_VSX_OPT=0" ;;
ppc*) CXXFLAGS+=" -DPNG_POWERPC_VSX_OPT=0" ;;
esac
if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then
LDFLAGS=" -latomic"
fi
# without TARGET_ARCH, the build system will assume -march=native,
# which is wrong as we're building a generic package and -march does
# not even always work
case "$XBPS_TARGET_MACHINE" in
i686*) _tarch="-mtune=i686";;
x86_64*) _tarch="-march=x86-64";;
aarch64*) _tarch="-march=armv8-a";;
armv5te*) _tarch="-march=armv5te";;
armv6*) _tarch="-march=armv6";;
armv7*) _tarch="-march=armv7-a";;
ppc64le*) _tarch="-mcpu=powerpc64le";;
ppc64*) _tarch="-mcpu=970";;
ppc*) _tarch="-mcpu=powerpc";;
mips*) _tarch="-mtune=mips32r2";;
*) broken="Unsupported architecture";;
esac
case "$XBPS_TARGET_MACHINE" in
*-musl) makedepends+=" libexecinfo-devel"
broken="error: '_NL_IDENTIFICATION_LANGUAGE' was not declared in this scope" ;;
esac
Projucer() {
# This is needed as a workaround for a bug in Projucer
# https://github.com/WeAreROLI/JUCE/issues/422
# The HOME variable is spoofed because it looks for headers in
# ~/SDKs/ (path hardcoded)
# TODO: use xvfb-run script for testing
xvfb-run \
"${wrksrc}/JUCE/extras/Projucer/Builds/LinuxMakefile/build/Projucer" "$@"
}
post_extract() {
mkdir SDKs
mv VST_SDK SDKs
mv vst2.x SDKs/VST_SDK/VST3_SDK/pluginterfaces
mv cabbage-${version} cabbage
mv JUCE-${_jucever} JUCE
cd "${wrksrc}/cabbage"
vsrcextract -C JUCE juce-${_jucever}.tar.gz
vsrcextract -C SDKs/VST_SDK vstsdk${_vstsdkver}.zip
vsrcextract -C SDKs/VST_SDK/VST3_SDK/pluginterfaces/vst2.x heads.zip
}
# There are lots of hardcoded paths that need to be rewritten
vsed -e 's@sourcecode/@@' -i CabbageLite.jucer
for f in *jucer; do
vsed -e "s@/usr/local/include/csound@/usr/include/csound@g" \
-e "s@/usr/local/lib@/usr/lib@g" \
-i "$f"
done
vsed -e "s|/usr/local/include/csound|/usr/include/csound|g" \
-i Builds/LinuxMakefile/buildCabbage
vsed -e '/opcodeFile\ +=/s#/#/../share/doc/cabbage/#' \
post_patch() {
vsed -e '/opcodeFile\ +=/s#/opcodes.txt#/usr/share/doc/cabbage/opcodes.txt#' \
-i Source/CodeEditor/CabbageCodeEditor.cpp
vsed -e '/CabbagePlugin\(Synth\|Effect\)/s#"/#"/usr/lib/vst/#' \
-i Source/Utilities/CabbageExportPlugin.cpp
if [ "${XBPS_TARGET_MACHINE}" = "x86_64" ]; then
vsed -e 's/x86_64-linux/${XBPS_TARGET_MACHINE}-linux/' \
-i Source/Utilities/CabbageExportPlugin.cpp
fi
# Fix compilation on i686
vsed -e 's/__sigemptyset/sigemptyset/' \
-i ../JUCE/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c
-i JUCE/modules/juce_audio_formats/codecs/flac/libFLAC/cpu.c
vsed -e "s/JUCER_ENABLE_GPL_MODE 0/JUCER_ENABLE_GPL_MODE 1/" \
-i ../JUCE/extras/Projucer/JuceLibraryCode/AppConfig.h
vsed -e 's/webkit2gtk-4.0/webkit2gtk-4.1/' \
-i JUCE/extras/Build/CMake/JUCEUtils.cmake
vsed -e 's/webkit2gtk-4.0/webkit2gtk-4.1/' \
-i JUCE/extras/Projucer/Source/ProjectSaving/jucer_ProjectExporter.cpp
}
do_build() {
local oldhome=$HOME
pre_configure() {
# Searches for VST SDK in $HOME
oldhome=$HOME
HOME=$wrksrc
cd "${wrksrc}/JUCE/extras/Projucer/Builds/LinuxMakefile/"
make ${makejobs} TARGET_ARCH="${_tarch}"
}
cd "${wrksrc}/cabbage/Builds/LinuxMakefile"
post_configure() {
mkdir -p buildPluginEffect buildPluginSynth buildPluginMidiEffect buildCLIconverter
(
cd buildPluginEffect
configure_args+=" -DPROJECT_NAME=CabbagePluginEffect"
do_configure
)
(
cd buildPluginSynth
configure_args+=" -DPROJECT_NAME=CabbagePluginSynth"
do_configure
)
(
cd buildPluginMidiEffect
configure_args+=" -DPROJECT_NAME=CabbagePluginMidiEffect"
do_configure
)
(
cd buildCLIconverter
configure_args+=" -DPROJECT_NAME=CLIConverter"
do_configure
)
Projucer --resave ../../CabbageIDE.jucer
mv Makefile MakeCabbageIDE
make -f MakeCabbageIDE ${makejobs} CONFIG=Release TARGET_ARCH="${_tarch}"
Projucer --resave ../../CabbagePlugin.jucer
mv Makefile MakePluginEffect
make -f MakePluginEffect ${makejobs} CONFIG=Release TARGET_ARCH="${_tarch}"
mv ./build/CabbagePlugin.so ./build/CabbagePluginEffect.so
Projucer --resave ../../CabbagePluginSynth.jucer
mv Makefile MakePluginSynth
make -f MakePluginSynth ${makejobs} CONFIG=Release TARGET_ARCH="${_tarch}"
mv ./build/CabbagePlugin.so ./build/CabbagePluginSynth.so
Projucer --resave ../../CabbageLite.jucer
cp -r ../../../JUCE/modules/juce_audio_plugin_client/ ../../JuceLibraryCode/modules/
mv Makefile MakeCabbageLite
make -f MakeCabbageLite ${makejobs} CONFIG=Release TARGET_ARCH="${_tarch}"
HOME=$oldhome
}
post_build() {
( cd buildPluginEffect && NINJA_STATUS="[2/5][%f/%t] " do_build )
( cd buildPluginSynth && NINJA_STATUS="[3/5][%f/%t] " do_build )
( cd buildPluginMidiEffect && NINJA_STATUS="[4/5][%f/%t] " do_build )
( cd buildCLIconverter && NINJA_STATUS="[5/5][%f/%t] " do_build )
}
do_install() {
cd "${wrksrc}/cabbage/Builds/LinuxMakefile"
find Examples -name '.DS_Store' -delete
find Examples -name '*_Log.txt' -delete
find ../../Examples -name '.DS_Store' -delete
find ../../Examples -name '*_Log.txt' -delete
vbin build/Cabbage
vbin build/CabbageLite
vbin build/Cabbage_artefacts/None/Cabbage
vbin buildCLIconverter/build/CLIConverter_artefacts/None/CLIConverter
vmkdir usr/lib/vst
vinstall build/CabbagePluginEffect.so 755 usr/lib/vst
vinstall build/CabbagePluginSynth.so 755 usr/lib/vst
for plugin in PluginEffect PluginSynth PluginMidiEffect; do
(
cd "build${plugin}/build/Cabbage${plugin}_artefacts/None"
vinstall "VST/libCabbage${plugin}.so" 755 usr/lib/vst
vinstall "VST3/Cabbage${plugin}.vst3/Contents/${XBPS_TARGET_MACHINE}-linux/Cabbage${plugin}.so" 755 "usr/lib/vst/Cabbage${plugin}.vst3/Contents/${XBPS_TARGET_MACHINE}-linux/"
)
done
vdoc ../opcodes.txt
vinstall ../../Images/cabbage.png 644 usr/share/icons/hicolor/512x512/apps/
vinstall Cabbage.desktop 644 usr/share/applications/
vinstall CabbageLite.desktop 644 usr/share/applications/
vinstall Images/cabbage.png 644 usr/share/icons/hicolor/512x512/apps/
vinstall Installers/Linux/Cabbage.desktop 644 usr/share/applications/
vmkdir usr/share/doc/cabbage/examples
vcopy '../../Examples/*' usr/share/doc/cabbage/examples/
vcopy 'Examples/*' usr/share/doc/cabbage/examples/
}