From 83fa6ef4e784fccb88fb79c6384847e957dff977 Mon Sep 17 00:00:00 2001 From: Cameron Cawley Date: Fri, 30 Jul 2021 00:06:49 +0100 Subject: [PATCH] COMMON: Replace fluidsynth-lite with FluidLite --- check-versions/config.py | 4 +- .../patches/fix-install-dirs.patch | 47 ---- toolchains/caanoo/Dockerfile.m4 | 2 +- .../{fluidsynth-lite => fluidlite}/build.sh | 8 +- toolchains/devkit3ds/Dockerfile.m4 | 2 +- toolchains/devkitswitch/Dockerfile.m4 | 4 +- .../patches/00-switch-support.patch | 227 ------------------ toolchains/m4/android/packages_list.m4 | 5 +- toolchains/open2x/Dockerfile.m4 | 2 +- toolchains/opendingux/Dockerfile.m4 | 2 +- toolchains/openpandora/Dockerfile.m4 | 2 +- toolchains/riscos/Dockerfile.m4 | 2 +- toolchains/windows-9x/Dockerfile.m4 | 2 +- 13 files changed, 15 insertions(+), 294 deletions(-) delete mode 100644 toolchains/android-common/packages/fluidsynth-lite/patches/fix-install-dirs.patch rename toolchains/common/packages/{fluidsynth-lite => fluidlite}/build.sh (57%) delete mode 100644 toolchains/devkitswitch/packages/fluidsynth-lite/patches/00-switch-support.patch diff --git a/check-versions/config.py b/check-versions/config.py index 59be1bf..feb20f4 100644 --- a/check-versions/config.py +++ b/check-versions/config.py @@ -181,9 +181,9 @@ VERSIONS = { ('./toolchains/caanoo/packages/toolchain/build.sh', 'CT_NG'): crosstool_ng_check, ('./toolchains/common/packages/discord-rpc/build.sh', 'DISCORD_RPC'): discord_rpc_check, - ('./toolchains/common/packages/fluidsynth-lite/build.sh', 'FLUIDSYNTH'): { + ('./toolchains/common/packages/fluidlite/build.sh', 'FLUIDLITE'): { 'check': 'git commit', - 'repository': 'https://github.com/Doom64/fluidsynth-lite.git', + 'repository': 'https://github.com/divideconcept/FluidLite.git', 'branch': 'master', }, ('./toolchains/common/packages/fluidsynth/build.sh', 'FLUIDSYNTH'): { diff --git a/toolchains/android-common/packages/fluidsynth-lite/patches/fix-install-dirs.patch b/toolchains/android-common/packages/fluidsynth-lite/patches/fix-install-dirs.patch deleted file mode 100644 index 8f7d88a..0000000 --- a/toolchains/android-common/packages/fluidsynth-lite/patches/fix-install-dirs.patch +++ /dev/null @@ -1,47 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 9dca996..6cc709e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -72,6 +72,7 @@ mark_as_advanced ( LIB_SUFFIX ) - - # Default install directory names - include ( DefaultDirs ) -+include ( GNUInstallDirs ) - - # Basic C library checks - include ( CheckSTDC ) -diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt -index 76a8f87..7973219 100644 ---- a/include/CMakeLists.txt -+++ b/include/CMakeLists.txt -@@ -22,5 +22,5 @@ - add_subdirectory ( fluidsynth ) - - IF (NOT MACOSX_FRAMEWORK ) -- install ( FILES fluidsynth.h DESTINATION ${INCLUDE_INSTALL_DIR} ) -+ install ( FILES fluidsynth.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) - ENDIF (NOT MACOSX_FRAMEWORK ) -diff --git a/include/fluidsynth/CMakeLists.txt b/include/fluidsynth/CMakeLists.txt -index b146d13..d4c00b4 100644 ---- a/include/fluidsynth/CMakeLists.txt -+++ b/include/fluidsynth/CMakeLists.txt -@@ -46,6 +46,6 @@ if ( NOT MACOSX_FRAMEWORK ) - ${include_HEADERS} - ${CMAKE_CURRENT_BINARY_DIR}/version.h - DESTINATION -- ${INCLUDE_INSTALL_DIR}/fluidsynth -+ ${CMAKE_INSTALL_INCLUDEDIR}/fluidsynth - ) - endif ( NOT MACOSX_FRAMEWORK ) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index c14622d..4e99dab 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -152,5 +152,5 @@ target_link_libraries ( libfluidsynth - ) - - install(TARGETS libfluidsynth -- LIBRARY DESTINATION lib -- ARCHIVE DESTINATION lib) -+ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) diff --git a/toolchains/caanoo/Dockerfile.m4 b/toolchains/caanoo/Dockerfile.m4 index 035dafb..3f2b9e0 100644 --- a/toolchains/caanoo/Dockerfile.m4 +++ b/toolchains/caanoo/Dockerfile.m4 @@ -90,4 +90,4 @@ local_package(sdl-net1.2) # TODO: openssl and curl -# fluidsynth-lite is unlikely to be fast enough. +# fluidsynth is unlikely to be fast enough. diff --git a/toolchains/common/packages/fluidsynth-lite/build.sh b/toolchains/common/packages/fluidlite/build.sh similarity index 57% rename from toolchains/common/packages/fluidsynth-lite/build.sh rename to toolchains/common/packages/fluidlite/build.sh index d7de774..3556ad1 100755 --- a/toolchains/common/packages/fluidsynth-lite/build.sh +++ b/toolchains/common/packages/fluidlite/build.sh @@ -1,6 +1,6 @@ #! /bin/sh -FLUIDSYNTH_VERSION=c539a8d9270ba5a3f7d6e460606483fc2ab1eb61 +FLUIDLITE_VERSION=57a0e74e708f699b13d7c85b28a4e1ff5b71887c PACKAGE_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) HELPERS_DIR=$PACKAGE_DIR/../.. @@ -8,12 +8,12 @@ HELPERS_DIR=$PACKAGE_DIR/../.. do_make_bdir -do_http_fetch fluidsynth-lite \ - "https://github.com/Doom64/fluidsynth-lite/archive/${FLUIDSYNTH_VERSION}.tar.gz" 'tar xzf' +do_http_fetch FluidLite \ + "https://github.com/divideconcept/FluidLite/archive/${FLUIDLITE_VERSION}.tar.gz" 'tar xzf' # -DCMAKE_SYSTEM_NAME=Windows for Windows -do_cmake "$@" +do_cmake -DFLUIDLITE_BUILD_SHARED=OFF "$@" do_make do_make install diff --git a/toolchains/devkit3ds/Dockerfile.m4 b/toolchains/devkit3ds/Dockerfile.m4 index 84945e2..e312129 100644 --- a/toolchains/devkit3ds/Dockerfile.m4 +++ b/toolchains/devkit3ds/Dockerfile.m4 @@ -67,4 +67,4 @@ helpers_package(a52dec) helpers_package(fribidi) -# No fluidsynth +helpers_package(fluidlite, -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/3DS.cmake) diff --git a/toolchains/devkitswitch/Dockerfile.m4 b/toolchains/devkitswitch/Dockerfile.m4 index cdb700c..f62455b 100644 --- a/toolchains/devkitswitch/Dockerfile.m4 +++ b/toolchains/devkitswitch/Dockerfile.m4 @@ -84,6 +84,4 @@ helpers_package(a52dec) # sdl2_net is already installed in original toolchain -# Copy specific Switch support -COPY packages/fluidsynth-lite lib-helpers/packages/fluidsynth-lite -helpers_package(fluidsynth-lite, -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/Switch.cmake) +helpers_package(fluidlite, -DCMAKE_TOOLCHAIN_FILE=${DEVKITPRO}/cmake/Switch.cmake) diff --git a/toolchains/devkitswitch/packages/fluidsynth-lite/patches/00-switch-support.patch b/toolchains/devkitswitch/packages/fluidsynth-lite/patches/00-switch-support.patch deleted file mode 100644 index 4243f96..0000000 --- a/toolchains/devkitswitch/packages/fluidsynth-lite/patches/00-switch-support.patch +++ /dev/null @@ -1,227 +0,0 @@ -diff --git a/src/config_switch.h b/src/config_switch.h -new file mode 100644 -index 0000000..06ba820 ---- /dev/null -+++ b/src/config_switch.h -@@ -0,0 +1,157 @@ -+#ifndef CONFIG_H -+#define CONFIG_H -+ -+/* Define to enable ALSA driver */ -+// #define ALSA_SUPPORT 0 -+ -+/* Define to activate sound output to files */ -+// #define AUFILE_SUPPORT 0 -+ -+/* whether or not we are supporting CoreAudio */ -+// #define COREAUDIO_SUPPORT 0 -+ -+/* whether or not we are supporting CoreMIDI */ -+// #define COREMIDI_SUPPORT 0 -+ -+/* whether or not we are supporting DART */ -+// #define DART_SUPPORT 0 -+ -+/* Define if building for Mac OS X Darwin */ -+// #define DARWIN 0 -+ -+/* Define if D-Bus support is enabled */ -+// #define DBUS_SUPPORT 0 -+ -+/* Soundfont to load automatically in some use cases */ -+#define DEFAULT_SOUNDFONT "/switch/default.sf2" -+ -+/* Define to enable FPE checks */ -+// #define FPE_CHECK 0 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_ARPA_INET_H 1 -+ -+/* Define to 1 if you have the header file. */ -+// #define HAVE_DLFCN_H 0 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_ERRNO_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_FCNTL_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_INTTYPES_H 1 -+ -+/* whether or not we are supporting ladcca */ -+// #define HAVE_LADCCA 0 -+ -+/* whether or not we are supporting lash */ -+// #define HAVE_LASH 0 -+ -+/* Define to 1 if you have the `dl' library (-ldl). */ -+// #define HAVE_LIBDL 0 -+ -+/* Define to 1 if you have the `MidiShare' library (-lMidiShare). */ -+// #define HAVE_LIBMIDISHARE 0 -+ -+/* Define to 1 if you have the `pthread' library (-lpthread). */ -+#define HAVE_LIBPTHREAD 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_LIMITS_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_MATH_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_MEMORY_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_NETINET_IN_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_NETINET_TCP_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_PTHREAD_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDARG_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDINT_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDBOOL_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDATOMIC_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDIO_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STDLIB_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STRINGS_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_THREADS_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_STRING_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_SYS_IOCTL_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_SYS_STAT_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_SYS_TIME_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_SYS_TYPES_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_UNISTD_H 1 -+ -+/* Define to 1 if you have the header file. */ -+#define HAVE_GETOPT_H 1 -+ -+/* Name of package */ -+#define PACKAGE "fluidsynth" -+ -+/* Define to the full name of this package. */ -+#define PACKAGE_NAME "switch-fluidsynth-lite" -+ -+/* Define to the full name and version of this package. */ -+#define PACKAGE_STRING "switch-fluidsynth-lite-1.1.6-nx" -+ -+/* Define to the one symbol short name of this package. */ -+#define PACKAGE_TARNAME @PACKAGE_TARNAME@ -+ -+/* Define to the version of this package. */ -+#define PACKAGE_VERSION @PACKAGE_VERSION@ -+ -+/* Define to 1 if you have the ANSI C header files. */ -+#define STDC_HEADERS 1 -+ -+/* Version number of package */ -+#define VERSION "1.1.6" -+ -+/* Define to do all DSP in single floating point precision */ -+#define WITH_FLOAT 1 -+ -+/* Define if the compiler supports VLA */ -+#define SUPPORTS_VLA 1 -+ -+/* Define to `__inline__' or `__inline' if that's what the C compiler -+ calls it, or to nothing if 'inline' is not supported under any name. */ -+#ifndef inline -+#define inline __inline -+#endif -+ -+#endif /* CONFIG_H */ -diff --git a/src/utils/fluid_sys.c b/src/utils/fluid_sys.c -index 9976f00..6829afc 100644 ---- a/src/utils/fluid_sys.c -+++ b/src/utils/fluid_sys.c -@@ -22,6 +22,8 @@ - #include - #elif defined(__APPLE__) - #include "apple/timing_mach.h" -+#elif defined(__SWITCH__) -+#include - #endif - - #include "fluid_sys.h" -@@ -119,6 +121,10 @@ fluid_default_log_function(int level, char* message, void* data) - { - FILE* out; - -+#if defined(__SWITCH__) && !defined(NXLINK_DEBUG) -+ return; -+#endif -+ - #if defined(WIN32) - out = stdout; - #else -@@ -426,6 +432,15 @@ fluid_thread_self_set_prio (int prio_level) - DosSetPriority (PRTYS_THREAD, PRTYC_REGULAR, PRTYD_MAXIMUM, 0); - } - -+#elif defined(__SWITCH__) /* Nintendo Switch specific stuff */ -+ -+void -+fluid_thread_self_set_prio (int prio_level) -+{ -+ u32 nx_priority = (prio_level >= FLUID_SYS_TIMER_HIGH_PRIO_LEVEL) ? 0x2D : 0x3B; -+ svcSetThreadPriority(CUR_THREAD_HANDLE, nx_priority); -+} -+ - #else /* POSIX stuff.. Nice POSIX.. Good POSIX. */ - - void -@@ -651,6 +666,8 @@ new_fluid_thread (const char *name, fluid_thread_func_t func, void *data, int pr - if (detach) { - #if _WIN32 - CloseHandle(*thread); -+#elif defined(__SWITCH__) -+ // detach unsupported in libnx - #else - pthread_detach(*thread); - #endif -diff --git a/src/utils/fluidsynth_priv.h b/src/utils/fluidsynth_priv.h -index eeacbbe..e37cf6d 100644 ---- a/src/utils/fluidsynth_priv.h -+++ b/src/utils/fluidsynth_priv.h -@@ -34,6 +34,10 @@ - #include "config_win32.h" - #endif - -+#if defined(__SWITCH__) -+#include "config_switch.h" -+#endif -+ - #if HAVE_STRING_H - #include - #endif diff --git a/toolchains/m4/android/packages_list.m4 b/toolchains/m4/android/packages_list.m4 index 2019b13..1adc2aa 100644 --- a/toolchains/m4/android/packages_list.m4 +++ b/toolchains/m4/android/packages_list.m4 @@ -47,7 +47,4 @@ android_package(libsdl2) COPY --from=android-helpers /lib-helpers/packages/libsdl2-net lib-helpers/packages/libsdl2-net helpers_package(libsdl2-net) -# Platform patch provided in android-common -# Fix destination directories -COPY --from=android-helpers /lib-helpers/packages/fluidsynth-lite lib-helpers/packages/fluidsynth-lite -helpers_package(fluidsynth-lite, -DBIN_INSTALL_DIR=bin/\$TARGET/\$API -DLIB_INSTALL_DIR=lib/\$TARGET/\$API) +helpers_package(fluidlite, -DBIN_INSTALL_DIR=bin/\$TARGET/\$API -DLIB_INSTALL_DIR=lib/\$TARGET/\$API) diff --git a/toolchains/open2x/Dockerfile.m4 b/toolchains/open2x/Dockerfile.m4 index 949b525..6aaef6e 100644 --- a/toolchains/open2x/Dockerfile.m4 +++ b/toolchains/open2x/Dockerfile.m4 @@ -62,5 +62,5 @@ helpers_package(fribidi) local_package(libsdl) -# fluidsynth-lite is unlikely to be fast enough. +# fluidsynth is unlikely to be fast enough. # The GP2X doesn't have network capabilities, so don't bother with sdl-net1.2 or curl diff --git a/toolchains/opendingux/Dockerfile.m4 b/toolchains/opendingux/Dockerfile.m4 index 5c52ca6..45f86d1 100644 --- a/toolchains/opendingux/Dockerfile.m4 +++ b/toolchains/opendingux/Dockerfile.m4 @@ -101,4 +101,4 @@ local_package(sdl-net1.2) # TODO: openssl and curl -# fluidsynth-lite is unlikely to be fast enough. +# fluidsynth is unlikely to be fast enough. diff --git a/toolchains/openpandora/Dockerfile.m4 b/toolchains/openpandora/Dockerfile.m4 index b581186..679e41c 100644 --- a/toolchains/openpandora/Dockerfile.m4 +++ b/toolchains/openpandora/Dockerfile.m4 @@ -107,4 +107,4 @@ local_package(gnutls) # Use same version as official toolchain local_package(curl) -# fluidsynth-lite is unlikely to be fast enough. +# fluidsynth is unlikely to be fast enough. diff --git a/toolchains/riscos/Dockerfile.m4 b/toolchains/riscos/Dockerfile.m4 index bfa1d21..89b46ae 100644 --- a/toolchains/riscos/Dockerfile.m4 +++ b/toolchains/riscos/Dockerfile.m4 @@ -95,7 +95,7 @@ helpers_package(a52dec) # helpers_package(curl) -helpers_package(fluidsynth-lite, -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake) +helpers_package(fluidlite, -DCMAKE_TOOLCHAIN_FILE=$GCCSDK_INSTALL_ENV/toolchain-riscos.cmake) helpers_package(freetype) diff --git a/toolchains/windows-9x/Dockerfile.m4 b/toolchains/windows-9x/Dockerfile.m4 index e161d74..09b1243 100644 --- a/toolchains/windows-9x/Dockerfile.m4 +++ b/toolchains/windows-9x/Dockerfile.m4 @@ -74,7 +74,7 @@ helpers_package(a52dec) # TODO: curl -# TODO: FluidLite +helpers_package(fluidlite, -DCMAKE_SYSTEM_NAME=Windows) helpers_package(freetype)