Skip to content

Commit

Permalink
Add support for JUCE 8
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX committed Nov 22, 2024
1 parent 336238e commit 34fed9e
Show file tree
Hide file tree
Showing 8 changed files with 128 additions and 0 deletions.
1 change: 1 addition & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ elif [ "${BUILDTARGET}" = "juce" ]; then
${BR2_MAKE} juce-6.0
${BR2_MAKE} juce-6.1
${BR2_MAKE} juce-7.0
${BR2_MAKE} juce-8.0
${BR2_MAKE} mod-plugin-builder
elif [ "${BUILDTARGET}" = "dev" ]; then
${BR2_MAKE} host-python3
Expand Down
1 change: 1 addition & 0 deletions local.env
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ export HOST_DIR
export JUCE_6_0_TOOLCHAIN_FILE="${STAGING_DIR}/usr/lib/cmake/JUCE-6.0.8/toolchainfile.cmake"
export JUCE_6_1_TOOLCHAIN_FILE="${STAGING_DIR}/usr/lib/cmake/JUCE-6.1.6/toolchainfile.cmake"
export JUCE_7_0_TOOLCHAIN_FILE="${STAGING_DIR}/usr/lib/cmake/JUCE-7.0.9/toolchainfile.cmake"
export JUCE_8_0_TOOLCHAIN_FILE="${STAGING_DIR}/usr/lib/cmake/JUCE-8.0.4/toolchainfile.cmake"

alias ar=${AR}
alias cc=${CC}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/libstdc++-v3/include/std/utility b/libstdc++-v3/include/std/utility
index c687c1d..d651b92 100644
--- a/libstdc++-v3/include/std/utility
+++ b/libstdc++-v3/include/std/utility
@@ -293,7 +293,7 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION

#ifdef __has_builtin
# if __has_builtin(__make_integer_seq)
-# define _GLIBCXX_USE_MAKE_INTEGER_SEQ 1
+# define _GLIBCXX_USE_MAKE_INTEGER_SEQ 0
# endif
#endif

13 changes: 13 additions & 0 deletions plugins-dep/package/juce-8.0/01_always-generate-lv2-helper.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 019aa86..b057f81 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,7 +177,7 @@ install(FILES "${JUCE_BINARY_DIR}/JUCEConfigVersion.cmake"
"${JUCE_CMAKE_UTILS_DIR}/juce_LinuxSubprocessHelper.cpp"
DESTINATION "${JUCE_INSTALL_DESTINATION}")

-if(("${CMAKE_SOURCE_DIR}" STREQUAL "${JUCE_SOURCE_DIR}") AND (NOT JUCE_BUILD_HELPER_TOOLS))
+if("${CMAKE_SOURCE_DIR}" STREQUAL "${JUCE_SOURCE_DIR}")
_juce_add_lv2_manifest_helper_target()

if(TARGET juce_lv2_helper)
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/modules/juce_core/native/juce_SharedCode_posix.h b/modules/juce_core/native/juce_SharedCode_posix.h
index c53ef0f..1590662 100644
--- a/modules/juce_core/native/juce_SharedCode_posix.h
+++ b/modules/juce_core/native/juce_SharedCode_posix.h
@@ -40,7 +40,7 @@ CriticalSection::CriticalSection() noexcept
pthread_mutexattr_t atts;
pthread_mutexattr_init (&atts);
pthread_mutexattr_settype (&atts, PTHREAD_MUTEX_RECURSIVE);
- #if ! JUCE_ANDROID
+ #if ! JUCE_ANDROID && ! JUCE_ARM
pthread_mutexattr_setprotocol (&atts, PTHREAD_PRIO_INHERIT);
#endif
pthread_mutex_init (&lock, &atts);
4 changes: 4 additions & 0 deletions plugins-dep/package/juce-8.0/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
config BR2_PACKAGE_JUCE_8_0
bool "juce-8.0"
select BR2_PACKAGE_FREETYPE
select BR2_PACKAGE_XLIB_LIBX11
59 changes: 59 additions & 0 deletions plugins-dep/package/juce-8.0/juce-8.0.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
######################################
#
# juce-8.0
#
######################################

JUCE_8_0_VERSION = 51d11a2be6d5c97ccf12b4e5e827006e19f0555a
JUCE_8_0_VERSION_PROJECT = JUCE-8.0.4
JUCE_8_0_SITE = $(call github,juce-framework,juce,$(JUCE_8_0_VERSION))
JUCE_8_0_DEPENDENCIES = host-juce-8.0 freetype xlib_libX11
JUCE_8_0_INSTALL_STAGING = YES
JUCE_8_0_TOOLCHAIN_FILE = $(STAGING_DIR)/usr/lib/cmake/$(JUCE_8_0_VERSION_PROJECT)/toolchainfile.cmake
HOST_JUCE_8_0_DEPENDENCIES = host-cmake host-freetype host-xlib_libX11

# this custom configure follows the same rules as buildroot, with these exceptions:
# - CMAKE_FIND_ROOT_PATH_MODE_PROGRAM="ONLY" (buildroot uses "NEVER")
# - CMAKE_MAKE_PROGRAM="/usr/bin/make" (not needed in buildroot, only for juce)
# - PKG_CONFIG related env vars (buildroot unsets them for the build)
define HOST_JUCE_8_0_CONFIGURE_CMDS
(mkdir -p $(@D) && cd $(@D) && rm -f CMakeCache.txt && \
env PKG_CONFIG_SYSROOT_DIR="$(HOST_DIR)" PKG_CONFIG_PATH="$(HOST_DIR)/usr/lib/pkgconfig" \
$(HOST_DIR)/usr/bin/cmake $(@D) \
-DCMAKE_INSTALL_PREFIX=$(HOST_DIR)/usr \
-DCMAKE_INSTALL_SO_NO_EXE=0 \
-DCMAKE_FIND_ROOT_PATH="$(HOST_DIR)" \
-DCMAKE_FIND_ROOT_PATH_MODE_PROGRAM="ONLY" \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE="ONLY" \
-DCMAKE_FIND_ROOT_PATH_MODE_INCLUDE="ONLY" \
-DCMAKE_MAKE_PROGRAM="/usr/bin/make" \
-DCMAKE_C_COMPILER="$(HOSTCC)" \
-DCMAKE_CXX_COMPILER="$(HOSTCXX)" \
-DCMAKE_CXX_FLAGS="$(HOST_CXXFLAGS) -DJUCE_USE_CURL=0 -DJUCE_USE_XCURSOR=0 -DJUCE_USE_XINERAMA=0 -DJUCE_USE_XRANDR=0 -DJUCE_USE_XSHM=0" \
-DJUCE_BUILD_HELPER_TOOLS=ON \
-DJUCE_INSTALL_DESTINATION=lib/cmake/$(JUCE_8_0_VERSION_PROJECT) \
)
endef

define HOST_JUCE_8_0_POST_INSTALL_JUCEAIDE
$(INSTALL) -d $(HOST_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)
$(INSTALL) -m 755 $(@D)/extras/Build/juceaide/juceaide_artefacts/juceaide $(HOST_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)
$(INSTALL) -m 644 $($(PKG)_PKGDIR)/toolchainfile.cmake $(HOST_DIR)/usr/lib/cmake/$(JUCE_8_0_VERSION_PROJECT)/
endef

HOST_JUCE_8_0_POST_INSTALL_HOOKS += HOST_JUCE_8_0_POST_INSTALL_JUCEAIDE

define JUCE_8_0_INSTALL_STAGING_CMDS
$(INSTALL) -d $(STAGING_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)
$(INSTALL) -d $(STAGING_DIR)/usr/include
$(INSTALL) -d $(STAGING_DIR)/usr/lib/cmake
cp $(HOST_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/juceaide $(STAGING_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/
cp $(HOST_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/juce_lv2_helper $(STAGING_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/
cp $(HOST_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/juce_vst3_helper $(STAGING_DIR)/usr/bin/$(JUCE_8_0_VERSION_PROJECT)/
cp -r $(HOST_DIR)/usr/include/$(JUCE_8_0_VERSION_PROJECT) $(STAGING_DIR)/usr/include/
cp -r $(HOST_DIR)/usr/lib/cmake/$(JUCE_8_0_VERSION_PROJECT) $(STAGING_DIR)/usr/lib/cmake/
ln -sf JUCEConfig.cmake $(STAGING_DIR)/usr/lib/cmake/$(JUCE_8_0_VERSION_PROJECT)/$(JUCE_8_0_VERSION_PROJECT)Config.cmake
endef

$(eval $(generic-package))
$(eval $(host-cmake-package))
24 changes: 24 additions & 0 deletions plugins-dep/package/juce-8.0/toolchainfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Aide juceaide in MOD builds

set(HOST_DIR "$ENV{HOST_DIR}")
get_filename_component(TARGET_DIR "${HOST_DIR}/../target" REALPATH)

include("${HOST_DIR}/usr/share/buildroot/toolchainfile.cmake")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCE_USE_CURL=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCE_USE_XCURSOR=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCE_USE_XINERAMA=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCE_USE_XRANDR=0")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DJUCE_USE_XSHM=0")

if(CMAKE_SYSTEM_PROCESSOR STREQUAL "aarch64")
set(CROSSCOMPILING TRUE)
set(CROSSCOMPILING_EMULATOR qemu-aarch64-static -L "${TARGET_DIR}")
separate_arguments(CMAKE_CROSSCOMPILING_EMULATOR)
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(CROSSCOMPILING TRUE)
set(CROSSCOMPILING_EMULATOR qemu-arm-static -L "${TARGET_DIR}")
separate_arguments(CMAKE_CROSSCOMPILING_EMULATOR)
endif()

set(JUCE_MOD_BUILD TRUE)

0 comments on commit 34fed9e

Please sign in to comment.