Thursday, August 31, 2023

UPDATE: fluidsynth-2.3.2

Update fluidsynth to 2.3.2. I built all consumers happy expect from
audio/qsynth (Looks like it needs an update).

I would like to get positive feedback from people who have tested with
the sndio backend.

Cheers Rafael

Index: Makefile
===================================================================
RCS file: /cvs/ports/audio/fluidsynth/Makefile,v
retrieving revision 1.34
diff -u -p -u -p -r1.34 Makefile
--- Makefile 5 Nov 2022 17:06:22 -0000 1.34
+++ Makefile 31 Aug 2023 12:39:00 -0000
@@ -1,50 +1,47 @@
COMMENT = SoundFont2 software synthesizer
+
GH_ACCOUNT = FluidSynth
GH_PROJECT = fluidsynth
-GH_TAGNAME = v1.1.9
-REVISION = 1
+GH_TAGNAME = v2.3.2

-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
+MODULES = devel/cmake

-AUTOCONF_VERSION = 2.69
-AUTOMAKE_VERSION = 1.16
-AUTORECONF = ./autogen.sh
+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
+MODCMAKE_LDFLAGS = -lc
+
+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

-# broken
-CONFIGURE_ARGS += --disable-jack-support
++MODCMAKE_LDFLAGS = -lc

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

.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/audio/fluidsynth/distinfo,v
retrieving revision 1.4
diff -u -p -u -p -r1.4 distinfo
--- distinfo 25 Jun 2021 21:48:40 -0000 1.4
+++ distinfo 31 Aug 2023 12:39:00 -0000
@@ -1,2 +1,2 @@
-SHA256 (fluidsynth-1.1.9.tar.gz) = 3WMh4Tp8h17zAyZEvTGX6Es9JJKOI3m8gGa3ys571BA=
-SIZE (fluidsynth-1.1.9.tar.gz) = 630651
+SHA256 (fluidsynth-2.3.2.tar.gz) = zWEIEPMFZuKPuYw2UB8ARGoG+muuPcViyM04aP4cD8c=
+SIZE (fluidsynth-2.3.2.tar.gz) = 1773755
Index: patches/patch-CMakeLists_txt
===================================================================
RCS file: patches/patch-CMakeLists_txt
diff -N patches/patch-CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-CMakeLists_txt 31 Aug 2023 12:39:00 -0000
@@ -0,0 +1,31 @@
+Index: CMakeLists.txt
+--- CMakeLists.txt.orig
++++ CMakeLists.txt
+@@ -95,6 +95,7 @@ option ( enable-waveout "compile Windows WaveOut suppo
+ option ( enable-winmidi "compile Windows MIDI support (if it is available)" on )
+ option ( enable-sdl2 "compile SDL2 audio support (if it is available)" on )
+ option ( enable-pulseaudio "compile PulseAudio support (if it is available)" on )
++option ( enable-sndio "compile sndio support (if it is available)" on )
+ option ( enable-pipewire "compile PipeWire support (if it is available)" on )
+ option ( enable-readline "compile readline lib line editing (if it is available)" on )
+ option ( enable-threads "enable multi-threading support (such as parallel voice synthesis)" on )
+@@ -544,6 +545,19 @@ if ( enable-libsndfile )
+ endif (SndFile_WITH_EXTERNAL_LIBS)
+ endif ( LIBSNDFILE_SUPPORT )
+ endif ( enable-libsndfile )
++
++unset ( SNDIO_SUPPORT CACHE )
++if ( enable-sndio )
++ pkg_check_modules(SNDIO REQUIRED sndio)
++ if ( SNDIO_FOUND AND SNDIO_LIBRARY )
++ set ( SNDIO_SUPPORT TRUE )
++ set ( SNDIO_LIBRARIES ${SNDIO_LIBRARY} ${SNDIO_LIBRARY} )
++ message ( STATUS "Found sndio: ${SNDIO_LIBRARIES}" )
++ list( APPEND PC_REQUIRES_PRIV "libpulse-simple")
++ else ( SNDIO_FOUND AND SNDIO_LIBRARY )
++ message( FATAL_ERROR "Could NOT find sndio" )
++ endif ( SNDIO_FOUND AND SNDIO_LIBRARY )
++endif ( enable-sndio )
+
+ unset ( PULSE_SUPPORT CACHE )
+ if ( enable-pulseaudio )
Index: patches/patch-Makefile_am
===================================================================
RCS file: patches/patch-Makefile_am
diff -N patches/patch-Makefile_am
--- patches/patch-Makefile_am 11 Mar 2022 18:20:09 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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
Index: patches/patch-configure_ac
===================================================================
RCS file: patches/patch-configure_ac
diff -N patches/patch-configure_ac
--- patches/patch-configure_ac 11 Mar 2022 18:20:09 -0000 1.6
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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
Index: patches/patch-fluidsynth_pc_in
===================================================================
RCS file: patches/patch-fluidsynth_pc_in
diff -N patches/patch-fluidsynth_pc_in
--- patches/patch-fluidsynth_pc_in 11 Mar 2022 18:20:09 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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}
Index: patches/patch-src_CMakeLists_txt
===================================================================
RCS file: patches/patch-src_CMakeLists_txt
diff -N patches/patch-src_CMakeLists_txt
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_CMakeLists_txt 31 Aug 2023 12:39:00 -0000
@@ -0,0 +1,26 @@
+Index: src/CMakeLists.txt
+--- src/CMakeLists.txt.orig
++++ src/CMakeLists.txt
+@@ -21,6 +21,10 @@
+
+ # ************ library ************
+
++if ( SNDIO_SUPPORT )
++ set ( fluid_pulse_SOURCES drivers/fluid_sndio.c )
++endif ( SNDIO_SUPPORT )
++
+ if ( PULSE_SUPPORT )
+ set ( fluid_pulse_SOURCES drivers/fluid_pulse.c )
+ endif ( PULSE_SUPPORT )
+@@ -357,6 +361,11 @@ target_link_libraries ( libfluidsynth-OBJ PUBLIC GLib2
+
+ if ( TARGET SndFile::sndfile AND LIBSNDFILE_SUPPORT )
+ target_link_libraries ( libfluidsynth-OBJ PUBLIC SndFile::sndfile )
++endif()
++
++if ( SNDIO_SUPPORT )
++ target_include_directories( libfluidsynth-OBJ PRIVATE ${SNDIO_INCLUDE_DIRS} )
++ target_link_libraries ( libfluidsynth-OBJ PUBLIC ${SNDIO_LIBRARIES} )
+ endif()
+
+ if ( PULSE_SUPPORT )
Index: patches/patch-src_Makefile_am
===================================================================
RCS file: patches/patch-src_Makefile_am
diff -N patches/patch-src_Makefile_am
--- patches/patch-src_Makefile_am 11 Mar 2022 18:20:09 -0000 1.5
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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@ \
Index: patches/patch-src_drivers_fluid_adriver_c
===================================================================
RCS file: patches/patch-src_drivers_fluid_adriver_c
diff -N patches/patch-src_drivers_fluid_adriver_c
--- patches/patch-src_drivers_fluid_adriver_c 11 Mar 2022 18:20:09 -0000 1.3
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -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);
-

No comments:

Post a Comment