On Wed Jan 17, 2024 at 12:01:26PM -0500, Thomas Frohwein wrote: > Hi, >
Thank you for carrying on! > Following up on [1], I adjusted the fluidsynth diff to the latest > version 2.3.4. Got interested in this when revisiting simutrans [2] > which looks for fluidsynth>=2.1. I tested fluidsynth with shockolate > and generaluser-gs-soundfont which works as previously. I assume from > looking at the prior discussion that updating fluidsynth would require > updating qsynth (see [3]). It would be nice to get an okay from the qsynth maintainer sebastia@. > > One (minor?) issue is that the test binaries aren't built and so `make > test` doesn't show any useful results. I looked a little through the > cmake files and couldn't spot the problem, but that could probably be > revisited later...? As written in the tests/README we have to call the ninja "check" target. The test call is in this task. See the diff below. > > ok to catch up our fluidsynth port? +1 Let's finally get this done > > [1] https://marc.info/?l=openbsd-ports&m=169510187608944&w=2 > [2] https://marc.info/?l=openbsd-ports&m=167885681717633&w=2 > [3] https://marc.info/?l=openbsd-ports&m=169505209015569&w=2 > Do we need the COMPILER line and C++ comment? That is the default and gcc4 can handle C++98? ;) diff --git a/audio/fluidsynth/Makefile b/audio/fluidsynth/Makefile index 3c04d0488b9..7cf69f0f600 100644 --- a/audio/fluidsynth/Makefile +++ b/audio/fluidsynth/Makefile @@ -1,50 +1,49 @@ COMMENT = SoundFont2 software synthesizer + GH_ACCOUNT = FluidSynth GH_PROJECT = fluidsynth -GH_TAGNAME = v1.1.9 -REVISION = 1 +GH_TAGNAME = v2.3.4 -SHARED_LIBS += fluidsynth 2.0 # 6.0 +SHARED_LIBS += fluidsynth 3.0 # 6.0 CATEGORIES = audio + HOMEPAGE = https://www.fluidsynth.org/ # LGPLv2+ PERMIT_PACKAGE = Yes -WANTLIB = FLAC c glib-2.0 gthread-2.0 iconv intl m curses ogg opus -WANTLIB += pcre2-8 pthread readline sndfile sndio vorbis vorbisenc +WANTLIB += ${COMPILER_LIBCXX} SDL2 c glib-2.0 gthread-2.0 intl +WANTLIB += m readline sndfile sndio -LIB_DEPENDS = audio/libsndfile \ - devel/glib2 +# C++98 +COMPILER = base-clang ports-gcc base-gcc -AUTOCONF_VERSION = 2.69 -AUTOMAKE_VERSION = 1.16 -AUTORECONF = ./autogen.sh +MODULES = devel/cmake + +LIB_DEPENDS = audio/libsndfile \ + devel/glib2 \ + devel/sdl2 -# autogen.sh needs aclocal/lib-ld.m4 BUILD_DEPENDS += devel/gettext,-tools -CONFIGURE_STYLE = autoreconf -CONFIGURE_ARGS += --disable-coreaudio \ - --disable-coremidi \ - --disable-dart \ - --disable-dbus-support \ - --disable-lash \ - --disable-ladcca \ - --disable-midishare \ - --disable-oss-support \ - --disable-portaudio-support \ - --disable-pulse-support - -# broken -CONFIGURE_ARGS += --disable-jack-support +CONFIGURE_ARGS = -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=On \ + -Denable-jack=OFF \ + -Denable-coreaudio=OFF \ + -Denable-coremidi=OFF \ + -Denable-dart=OFF \ + -Denable-dbus=OFF \ + -Denable-lash=OFF \ + -Denable-ladcca=OFF \ + -Denable-midishare=OFF \ + -Denable-oss=OFF \ + -Denable-pipewire=OFF \ + -Denable-pulseaudio=OFF post-patch: cp ${FILESDIR}/fluid_sndio.c ${WRKSRC}/src/drivers/ - # not defined in autoconf build, but required by source code - # upstream really wants cmake, but the sndio patches need porting first - sed -i 's,DEFAULT_SOUNDFONT,"${LOCALBASE}/share/generaluser-gs/GeneralUser_GS.sf2",' \ - ${WRKSRC}/src/synth/fluid_synth.c + +do-test: + cd ${WRKBUILD} && exec ${SETENV} ${ALL_TEST_ENV} ninja check .include <bsd.port.mk> diff --git a/audio/fluidsynth/distinfo b/audio/fluidsynth/distinfo index 6c0edb3c9f6..8910d791f50 100644 --- a/audio/fluidsynth/distinfo +++ b/audio/fluidsynth/distinfo @@ -1,2 +1,2 @@ -SHA256 (fluidsynth-1.1.9.tar.gz) = 3WMh4Tp8h17zAyZEvTGX6Es9JJKOI3m8gGa3ys571BA= -SIZE (fluidsynth-1.1.9.tar.gz) = 630651 +SHA256 (fluidsynth-2.3.4.tar.gz) = FSnvW8O57zrcKnlkUFkS9zBRA+Jp5QzAMW9QCyIFOsk= +SIZE (fluidsynth-2.3.4.tar.gz) = 1775291 diff --git a/audio/fluidsynth/patches/patch-Makefile_am b/audio/fluidsynth/patches/patch-Makefile_am deleted file mode 100644 index 11899324c8e..00000000000 --- a/audio/fluidsynth/patches/patch-Makefile_am +++ /dev/null @@ -1,10 +0,0 @@ -automake: Don't whine about not having README - -Index: Makefile.am ---- Makefile.am.orig -+++ Makefile.am -@@ -9,3 +9,4 @@ EXTRA_DIST = TODO acinclude.m4 autogen.sh fluidsynth.p - DISTCLEANFILES = fluidsynth.pc - pkgconfigdir = $(libdir)/pkgconfig - pkgconfig_DATA = fluidsynth.pc -+README: README.md diff --git a/audio/fluidsynth/patches/patch-configure_ac b/audio/fluidsynth/patches/patch-configure_ac deleted file mode 100644 index 39f42ceea34..00000000000 --- a/audio/fluidsynth/patches/patch-configure_ac +++ /dev/null @@ -1,62 +0,0 @@ -Index: configure.ac ---- configure.ac.orig -+++ configure.ac -@@ -94,7 +94,7 @@ dnl Check for GNU LD - AC_LIB_PROG_LD_GNU - AM_CONDITIONAL(GNU_LD_SUPPORT, test "x$with_gnu_ld" = "xyes") - --AM_CONDITIONAL(MINGW32_SUPPORT, test "$mingw32_support" == "yes") -+AM_CONDITIONAL(MINGW32_SUPPORT, test "$mingw32_support" = "yes") - - AC_ARG_ENABLE(double, AS_HELP_STRING([--enable-double], - [double floating point for dsp (default=float)]), -@@ -150,7 +150,7 @@ if test "$GCC" = yes; then - CFLAGS="${CFLAGS} ${FCCFLAGS} -g -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Wno-unused-parameter -Wno-cast-qual" - AC_DEFINE(DEBUG, 1, [Define to activate debugging message]) - else -- CFLAGS="${CFLAGS} ${FCCFLAGS} -O2 -fomit-frame-pointer -funroll-all-loops -finline-functions -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-unused-parameter -Wno-cast-qual" -+ CFLAGS="${CFLAGS} ${FCCFLAGS} -Wall -W -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wcast-align -Wstrict-prototypes -Winline -Wno-unused-parameter -Wno-cast-qual" - AC_DEFINE(DEBUG, 0, [Define to activate debugging message]) - fi - fi -@@ -291,7 +291,27 @@ dnl - Check support for OSS audio - AC_OSS_AUDIO - AM_CONDITIONAL(OSS_SUPPORT, test "$OSS_SUPPORT" = "1") - -+dnl - Check for sndio support -+AC_ARG_ENABLE(sndio-support, AS_HELP_STRING([--disable-sndio-support], -+ [disable sndio support (default=auto)]), -+ enable_sndio=$enableval, enable_sndio="yes") - -+if test "x$enable_sndio" != "xno"; then -+ AC_CHECK_HEADER(sndio.h, SNDIO_SUPPORT=1, SNDIO_SUPPORT=0) -+else -+ SNDIO_SUPPORT=0 -+fi -+ -+if test "$SNDIO_SUPPORT" = "1"; then -+ AC_DEFINE(SNDIO_SUPPORT, 1, [Define to enable sndio driver]) -+fi -+AM_CONDITIONAL(SNDIO_SUPPORT, test "$SNDIO_SUPPORT" = "1") -+SNDIO_CFLAGS="" -+AC_SUBST(SNDIO_CFLAGS) -+SNDIO_LIBS="-lsndio" -+AC_SUBST(SNDIO_LIBS) -+ -+ - dnl - Check support for MidiShare - AC_MIDISHARE - -@@ -547,6 +567,12 @@ if test "${OSS_SUPPORT}" = "1"; then - echo "OSS: yes" - else - echo "OSS: no" -+fi -+ -+if test "${SNDIO_SUPPORT}" = "1"; then -+ echo "sndio: yes" -+else -+ echo "sndio: no" - fi - - if test "${MIDISHARE_SUPPORT}" = "1"; then diff --git a/audio/fluidsynth/patches/patch-fluidsynth_pc_in b/audio/fluidsynth/patches/patch-fluidsynth_pc_in deleted file mode 100644 index 699b9e76e5f..00000000000 --- a/audio/fluidsynth/patches/patch-fluidsynth_pc_in +++ /dev/null @@ -1,9 +0,0 @@ ---- fluidsynth.pc.in.orig Thu Aug 16 05:01:13 2012 -+++ fluidsynth.pc.in Sun Mar 24 23:55:55 2013 -@@ -6,5 +6,5 @@ includedir=@includedir@ - Name: FluidSynth - Description: Software SoundFont synth - Version: @VERSION@ --Libs: -L${libdir} -lfluidsynth -+Libs: -L${libdir} -lfluidsynth @READLINE_LIBS@ @LIBFLUID_LIBS@ @LIBS@ - Cflags: -I${includedir} diff --git a/audio/fluidsynth/patches/patch-src_Makefile_am b/audio/fluidsynth/patches/patch-src_Makefile_am deleted file mode 100644 index 6c67cf763a4..00000000000 --- a/audio/fluidsynth/patches/patch-src_Makefile_am +++ /dev/null @@ -1,38 +0,0 @@ -Index: src/Makefile.am ---- src/Makefile.am.orig -+++ src/Makefile.am -@@ -40,6 +40,9 @@ if OSS_SUPPORT - fluid_oss = drivers/fluid_oss.c - endif - -+if SNDIO_SUPPORT -+fluid_sndio = drivers/fluid_sndio.c -+endif - - # if LASH_SUPPORT || LADCCA_SUPPORT (Makefile supports OR?) - if LASH_SUPPORT -@@ -68,6 +71,7 @@ EXTRA_DIST = fluid_dll.c \ - drivers/fluid_oss.c \ - drivers/fluid_portaudio.c \ - drivers/fluid_pulse.c \ -+ drivers/fluid_sndio.c \ - drivers/fluid_sndmgr.c \ - drivers/fluid_winmidi.c \ - config_macos.h \ -@@ -93,6 +97,7 @@ libfluidsynth_la_SOURCES = \ - $(fluid_oss) \ - $(fluid_portaudio) \ - $(fluid_pulse) \ -+ $(fluid_sndio) \ - $(fluid_windows) \ - $(fluid_dart) \ - $(fluid_rtkit) \ -@@ -180,7 +185,7 @@ INCLUDES = -I$(top_srcdir)/include \ - libfluidsynth_la_LIBADD = $(LIBFLUID_LIBS) $(LASH_LIBS) $(LADCCA_LIBS) \ - $(READLINE_LIBS) $(COREAUDIO_LIBS) $(COREMIDI_LIBS) $(JACK_LIBS) \ - $(ALSA_LIBS) $(PULSE_LIBS) $(PORTAUDIO_LIBS) $(DART_LIBS) \ -- $(GLIB_LIBS) $(LIBSNDFILE_LIBS) $(DBUS_LIBS) -+ $(GLIB_LIBS) $(LIBSNDFILE_LIBS) $(DBUS_LIBS) $(SNDIO_LIBS) - - libfluidsynth_la_LDFLAGS = \ - -version-info @LT_VERSION_INFO@ \ diff --git a/audio/fluidsynth/patches/patch-src_drivers_fluid_adriver_c b/audio/fluidsynth/patches/patch-src_drivers_fluid_adriver_c deleted file mode 100644 index 1b73cbc17eb..00000000000 --- a/audio/fluidsynth/patches/patch-src_drivers_fluid_adriver_c +++ /dev/null @@ -1,55 +0,0 @@ -Index: src/drivers/fluid_adriver.c ---- src/drivers/fluid_adriver.c.orig -+++ src/drivers/fluid_adriver.c -@@ -64,6 +64,15 @@ int delete_fluid_oss_audio_driver(fluid_audio_driver_t - void fluid_oss_audio_driver_settings(fluid_settings_t* settings); - #endif - -+#if SNDIO_SUPPORT -+fluid_audio_driver_t* new_fluid_sndio_audio_driver(fluid_settings_t* settings, -+ fluid_synth_t* synth); -+fluid_audio_driver_t* new_fluid_sndio_audio_driver2(fluid_settings_t* settings, -+ fluid_audio_func_t func, void* data); -+int delete_fluid_sndio_audio_driver(fluid_audio_driver_t* p); -+void fluid_sndio_audio_driver_settings(fluid_settings_t* settings); -+#endif -+ - #if COREAUDIO_SUPPORT - fluid_audio_driver_t* new_fluid_core_audio_driver(fluid_settings_t* settings, - fluid_synth_t* synth); -@@ -122,6 +131,14 @@ int delete_fluid_file_audio_driver(fluid_audio_driver_ - /* Available audio drivers, listed in order of preference */ - static const fluid_audriver_definition_t fluid_audio_drivers[] = - { -+#if SNDIO_SUPPORT -+ { "sndio", -+ new_fluid_sndio_audio_driver, -+ new_fluid_sndio_audio_driver2, -+ delete_fluid_sndio_audio_driver, -+ fluid_sndio_audio_driver_settings }, -+#endif -+ - #if JACK_SUPPORT - { "jack", - new_fluid_jack_audio_driver, -@@ -238,7 +255,9 @@ void fluid_audio_driver_settings(fluid_settings_t* set - FLUID_DEFAULT_AUDIO_RT_PRIO, 0, 99, 0, NULL, NULL); - - /* Set the default driver */ --#if JACK_SUPPORT -+#if SNDIO_SUPPORT -+ fluid_settings_register_str(settings, "audio.driver", "sndio", 0, NULL, NULL); -+#elif JACK_SUPPORT - fluid_settings_register_str(settings, "audio.driver", "jack", 0, NULL, NULL); - #elif ALSA_SUPPORT - fluid_settings_register_str(settings, "audio.driver", "alsa", 0, NULL, NULL); -@@ -271,6 +290,9 @@ void fluid_audio_driver_settings(fluid_settings_t* set - #endif - #if OSS_SUPPORT - fluid_settings_add_option(settings, "audio.driver", "oss"); -+#endif -+#if SNDIO_SUPPORT -+ fluid_settings_add_option(settings, "audio.driver", "sndio"); - #endif - #if COREAUDIO_SUPPORT - fluid_settings_add_option(settings, "audio.driver", "coreaudio"); diff --git a/audio/fluidsynth/patches/patch-src_drivers_fluid_jack_c b/audio/fluidsynth/patches/patch-src_drivers_fluid_jack_c deleted file mode 100644 index 8e0b0360815..00000000000 --- a/audio/fluidsynth/patches/patch-src_drivers_fluid_jack_c +++ /dev/null @@ -1,12 +0,0 @@ -Index: src/drivers/fluid_jack.c ---- src/drivers/fluid_jack.c.orig -+++ src/drivers/fluid_jack.c -@@ -108,7 +108,7 @@ fluid_jack_audio_driver_settings(fluid_settings_t* set - { - fluid_settings_register_str(settings, "audio.jack.id", "fluidsynth", 0, NULL, NULL); - fluid_settings_register_int(settings, "audio.jack.multi", 0, 0, 1, FLUID_HINT_TOGGLED, NULL, NULL); -- fluid_settings_register_int(settings, "audio.jack.autoconnect", 0, 0, 1, FLUID_HINT_TOGGLED, NULL, NULL); -+ fluid_settings_register_int(settings, "audio.jack.autoconnect", 1, 0, 1, FLUID_HINT_TOGGLED, NULL, NULL); - fluid_settings_register_str(settings, "audio.jack.server", "", 0, NULL, NULL); - } - diff --git a/audio/fluidsynth/patches/patch-src_drivers_fluid_mdriver_c b/audio/fluidsynth/patches/patch-src_drivers_fluid_mdriver_c deleted file mode 100644 index 9f85b8f5468..00000000000 --- a/audio/fluidsynth/patches/patch-src_drivers_fluid_mdriver_c +++ /dev/null @@ -1,62 +0,0 @@ -Index: src/drivers/fluid_mdriver.c ---- src/drivers/fluid_mdriver.c.orig -+++ src/drivers/fluid_mdriver.c -@@ -24,7 +24,7 @@ - #undef FLUID_MIDI_SUPPORT - - #if ALSA_SUPPORT || JACK_SUPPORT || OSS_SUPPORT || \ -- WINMIDI_SUPPORT || MIDISHARE_SUPPORT || COREMIDI_SUPPORT -+ WINMIDI_SUPPORT || MIDISHARE_SUPPORT || COREMIDI_SUPPORT || SNDIO_SUPPORT - /* At least an input driver exits */ - #define FLUID_MIDI_SUPPORT 1 - #endif -@@ -53,6 +53,15 @@ fluid_midi_driver_t *new_fluid_jack_midi_driver (fluid - int delete_fluid_jack_midi_driver(fluid_midi_driver_t *p); - #endif - -+/* SNDIO */ -+#if SNDIO_SUPPORT -+fluid_midi_driver_t* new_fluid_sndio_midi_driver(fluid_settings_t* settings, -+ handle_midi_event_func_t handler, -+ void* event_handler_data); -+int delete_fluid_sndio_midi_driver(fluid_midi_driver_t* p); -+void fluid_sndio_midi_driver_settings(fluid_settings_t* settings); -+#endif -+ - /* OSS */ - #if OSS_SUPPORT - fluid_midi_driver_t* new_fluid_oss_midi_driver(fluid_settings_t* settings, -@@ -105,6 +114,12 @@ struct fluid_mdriver_definition_t { - - - struct fluid_mdriver_definition_t fluid_midi_drivers[] = { -+#if SNDIO_SUPPORT -+ { "sndio", -+ new_fluid_sndio_midi_driver, -+ delete_fluid_sndio_midi_driver, -+ fluid_sndio_midi_driver_settings }, -+#endif - #if JACK_SUPPORT - { "jack", - new_fluid_jack_midi_driver, -@@ -158,7 +173,9 @@ void fluid_midi_driver_settings(fluid_settings_t* sett - FLUID_DEFAULT_MIDI_RT_PRIO, 0, 99, 0, NULL, NULL); - - /* Set the default driver */ --#if ALSA_SUPPORT -+#if SNDIO_SUPPORT -+ fluid_settings_register_str(settings, "midi.driver", "sndio", 0, NULL, NULL); -+#elif ALSA_SUPPORT - fluid_settings_register_str(settings, "midi.driver", "alsa_seq", 0, NULL, NULL); - #elif JACK_SUPPORT - fluid_settings_register_str(settings, "midi.driver", "jack", 0, NULL, NULL); -@@ -178,6 +195,9 @@ void fluid_midi_driver_settings(fluid_settings_t* sett - #if ALSA_SUPPORT - fluid_settings_add_option(settings, "midi.driver", "alsa_seq"); - fluid_settings_add_option(settings, "midi.driver", "alsa_raw"); -+#endif -+#if SNDIO_SUPPORT -+ fluid_settings_add_option(settings, "midi.driver", "sndio"); - #endif - #if JACK_SUPPORT - fluid_settings_add_option(settings, "midi.driver", "jack"); diff --git a/audio/fluidsynth/patches/patch-src_fluidsynth_c b/audio/fluidsynth/patches/patch-src_fluidsynth_c deleted file mode 100644 index 5c02c2f6eb5..00000000000 --- a/audio/fluidsynth/patches/patch-src_fluidsynth_c +++ /dev/null @@ -1,13 +0,0 @@ -Index: src/fluidsynth.c ---- src/fluidsynth.c.orig -+++ src/fluidsynth.c -@@ -324,7 +324,9 @@ int main(int argc, char** argv) - {"audio-groups", 1, 0, 'G'}, - {"chorus", 1, 0, 'C'}, - {"connect-jack-outputs", 0, 0, 'j'}, -+#ifdef LASH_ENABLED - {"disable-lash", 0, 0, 'l'}, -+#endif - {"dump", 0, 0, 'd'}, - {"fast-render", 1, 0, 'F'}, - {"gain", 1, 0, 'g'}, diff --git a/audio/fluidsynth/patches/patch-src_utils_fluid_sys_c b/audio/fluidsynth/patches/patch-src_utils_fluid_sys_c deleted file mode 100644 index 0268d7bf6c0..00000000000 --- a/audio/fluidsynth/patches/patch-src_utils_fluid_sys_c +++ /dev/null @@ -1,14 +0,0 @@ -Index: src/utils/fluid_sys.c ---- src/utils/fluid_sys.c.orig -+++ src/utils/fluid_sys.c -@@ -429,8 +429,10 @@ fluid_thread_self_set_prio (int prio_level) - memset(&priority, 0, sizeof(priority)); - priority.sched_priority = prio_level; - -+// #if !defined(__OpenBSD__) - if (pthread_setschedparam (pthread_self (), SCHED_FIFO, &priority) == 0) { - return; -+// #endif - } - #ifdef DBUS_SUPPORT - /* Try to gain high priority via rtkit */ diff --git a/audio/fluidsynth/patches/patch-src_utils_fluidsynth_priv_h b/audio/fluidsynth/patches/patch-src_utils_fluidsynth_priv_h deleted file mode 100644 index 6c470f070be..00000000000 --- a/audio/fluidsynth/patches/patch-src_utils_fluidsynth_priv_h +++ /dev/null @@ -1,16 +0,0 @@ -Don't use a header that is not provided - -Index: src/utils/fluidsynth_priv.h ---- src/utils/fluidsynth_priv.h.orig -+++ src/utils/fluidsynth_priv.h -@@ -28,10 +28,6 @@ - #include "config.h" - #endif - --#if defined(__POWERPC__) && !(defined(__APPLE__) && defined(__MACH__)) --#include "config_maxmsp43.h" --#endif -- - #if defined(WIN32) && !defined(MINGW32) - #include "config_win32.h" - #endif diff --git a/audio/fluidsynth/pkg/PLIST b/audio/fluidsynth/pkg/PLIST index d305a93852a..37c39e29282 100644 --- a/audio/fluidsynth/pkg/PLIST +++ b/audio/fluidsynth/pkg/PLIST @@ -4,11 +4,11 @@ include/fluidsynth.h include/fluidsynth/audio.h include/fluidsynth/event.h include/fluidsynth/gen.h +include/fluidsynth/ladspa.h include/fluidsynth/log.h include/fluidsynth/midi.h include/fluidsynth/misc.h include/fluidsynth/mod.h -include/fluidsynth/ramsfont.h include/fluidsynth/seq.h include/fluidsynth/seqbind.h include/fluidsynth/settings.h @@ -18,8 +18,11 @@ include/fluidsynth/synth.h include/fluidsynth/types.h include/fluidsynth/version.h include/fluidsynth/voice.h -@static-lib lib/libfluidsynth.a -lib/libfluidsynth.la +lib/cmake/fluidsynth/ +lib/cmake/fluidsynth/FluidSynthConfig.cmake +lib/cmake/fluidsynth/FluidSynthConfigVersion.cmake +lib/cmake/fluidsynth/FluidSynthTargets${MODCMAKE_BUILD_SUFFIX} +lib/cmake/fluidsynth/FluidSynthTargets.cmake @lib lib/libfluidsynth.so.${LIBfluidsynth_VERSION} lib/pkgconfig/fluidsynth.pc @man man/man1/fluidsynth.1