commit:     e30fcf2e2f7b63e6e03b473bb4b5c30a70940043
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 03:09:22 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jun  3 03:29:00 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e30fcf2e

media-sound/fluidsynth: add 2.4.6

* Use SDL3

  From the 2.4.4 release notes:
  > Support for SDL3 has been added, support for SDL2 has been deprecated [...]

  SDL2 support is going to be dropped in 2.5.0, so let's get a move on. Was
  going to change to SDL3 anyway but this is more of a push.

* Use cmake-multilib more idiomatically (spit into _all and such).

* Install an OpenRC init script (bug #450074).

* Add USE=openmp.

* Always build network support (bug #930788).

  It seems to be needed for pipewire/pulseaudio and I can't really see
  a reason to omit it anyway.

Closes: https://bugs.gentoo.org/450074
Closes: https://bugs.gentoo.org/930788
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-sound/fluidsynth/Manifest                |   1 +
 media-sound/fluidsynth/files/fluidsynth.confd  |   7 ++
 media-sound/fluidsynth/files/fluidsynth.init   |  17 +++
 media-sound/fluidsynth/fluidsynth-2.4.6.ebuild | 142 +++++++++++++++++++++++++
 4 files changed, 167 insertions(+)

diff --git a/media-sound/fluidsynth/Manifest b/media-sound/fluidsynth/Manifest
index 5ba57de548c2..80ce7807d0ca 100644
--- a/media-sound/fluidsynth/Manifest
+++ b/media-sound/fluidsynth/Manifest
@@ -1 +1,2 @@
 DIST fluidsynth-2.4.3.tar.gz 1788637 BLAKE2B 
d79a2a7a1486619c0a2f23019c30d44f2b260d95495f5be8073f60464ca0d95096a71f15fa9d2ee9469de74a972d103f79eb56950ff21c2483b27187f0e17999
 SHA512 
847d2f4529ac1bad735b71b57067c50586df7e2526c6311925c209c0635ee1e1dca1bd77dc6006181fc19a616738c8de1242bfb209707c8dbea9d7e2acc61017
+DIST fluidsynth-2.4.6.tar.gz 1793331 BLAKE2B 
cddc60ddd97a7403d264a81712b7b71869a49a0927839491897f368dd77484bdb55e07433f95f42b4cd18f57ea111681cd0f5a36f1e77047b34f37bcd7d146bc
 SHA512 
2d5424d80234742be45f1c7cdf696182c96b684232bb92b079edf270d726c5d1292c5fc42c8b580ae1a89642ad7b536245977928bbeecedd94443f6e1f47d5fd

diff --git a/media-sound/fluidsynth/files/fluidsynth.confd 
b/media-sound/fluidsynth/files/fluidsynth.confd
new file mode 100644
index 000000000000..1cc4c0dedd36
--- /dev/null
+++ b/media-sound/fluidsynth/files/fluidsynth.confd
@@ -0,0 +1,7 @@
+# Additional options to pass to FluidSynth
+FLUIDSYNTH_OPTS=""
+
+# Path to the SoundFont
+# For playback of general MIDI files, media-sound/fluid-soundfont is a good
+# choice. The SoundFont is located at /usr/share/sounds/sf2/FluidR3_GM.sf2
+SOUND_FONT=""

diff --git a/media-sound/fluidsynth/files/fluidsynth.init 
b/media-sound/fluidsynth/files/fluidsynth.init
new file mode 100644
index 000000000000..dbfaa2de316b
--- /dev/null
+++ b/media-sound/fluidsynth/files/fluidsynth.init
@@ -0,0 +1,17 @@
+#!/sbin/openrc-run
+
+command="/usr/bin/fluidsynth"
+command_args="-is ${FLUIDSYNTH_OPTS} ${SOUND_FONT}"
+command_background=true
+pidfile="/run/fluidsynth.pid"
+
+depend() {
+       need alsasound
+}
+
+start_pre() {
+       if [ -z "${SOUND_FONT}" ] ; then
+               eerror "Please specify a SoundFont in /etc/conf.d/fluidsynth"
+               return 1
+       fi
+}

diff --git a/media-sound/fluidsynth/fluidsynth-2.4.6.ebuild 
b/media-sound/fluidsynth/fluidsynth-2.4.6.ebuild
new file mode 100644
index 000000000000..7b7e30b74d91
--- /dev/null
+++ b/media-sound/fluidsynth/fluidsynth-2.4.6.ebuild
@@ -0,0 +1,142 @@
+# Copyright 1999-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake-multilib systemd toolchain-funcs
+
+DESCRIPTION="Software real-time synthesizer based on the Soundfont 2 
specifications"
+HOMEPAGE="https://www.fluidsynth.org";
+SRC_URI="https://github.com/FluidSynth/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0/3"
+KEYWORDS="~amd64"
+IUSE="alsa dbus debug doc ipv6 jack ladspa network openmp oss pipewire 
portaudio pulseaudio +readline sdl +sndfile systemd threads"
+
+BDEPEND="
+       virtual/pkgconfig
+       doc? (
+               app-text/doxygen
+               dev-libs/libxslt
+       )
+"
+DEPEND="
+       dev-libs/glib:2[${MULTILIB_USEDEP}]
+       alsa? (
+               media-libs/alsa-lib[${MULTILIB_USEDEP}]
+       )
+       dbus? ( sys-apps/dbus[${MULTILIB_USEDEP}] )
+       jack? ( virtual/jack[${MULTILIB_USEDEP}] )
+       ladspa? (
+               media-libs/ladspa-sdk[${MULTILIB_USEDEP}]
+               media-plugins/cmt-plugins[${MULTILIB_USEDEP}]
+       )
+       pipewire? (
+               media-video/pipewire:0=[${MULTILIB_USEDEP}]
+       )
+       portaudio? ( media-libs/portaudio[${MULTILIB_USEDEP}] )
+       pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
+       readline? ( sys-libs/readline:0=[${MULTILIB_USEDEP}] )
+       sdl? ( media-libs/libsdl3[${MULTILIB_USEDEP}] )
+       sndfile? ( media-libs/libsndfile[${MULTILIB_USEDEP}] )
+"
+RDEPEND="${DEPEND}"
+
+DOCS=( AUTHORS CONTRIBUTING.md README.md THANKS TODO 
doc/fluidsynth-v20-devdoc.txt )
+
+pkg_pretend() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+pkg_setup() {
+       [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
+}
+
+src_prepare() {
+       # https://bugs.gentoo.org/833979#c17
+       sed -i "/CONFIGURE_COMMAND/{n;s/$/ 
-DCMAKE_C_COMPILER=$(tc-getBUILD_CC)/}" \
+               src/CMakeLists.txt || die
+       cmake_src_prepare
+}
+
+src_configure() {
+       local mycmakeargs=(
+               -Denable-alsa=$(usex alsa)
+               -Denable-aufile=ON
+               -Denable-dbus=$(usex dbus)
+               -Denable-dsound=OFF # Windows
+               -Denable-floats=OFF # loat instead of double for DSP samples
+               -Denable-fpe-check=$(usex debug)
+               -Denable-ipv6=$(usex ipv6)
+               -Denable-jack=$(usex jack)
+               -Denable-ladspa=$(usex ladspa)
+               -Denable-libinstpatch=OFF # 
https://github.com/swami/libinstpatch
+               -Denable-midishare=OFF # http://midishare.sourceforge.net/
+               -Denable-network=$(usex network)
+               -Denable-openmp=$(usex openmp)
+               -Denable-opensles=OFF
+               -Denable-oboe=OFF # requires OpenSLES and/or AAudio
+               -Denable-oss=$(usex oss)
+               -Denable-libsndfile=$(usex sndfile)
+               -Denable-portaudio=$(usex portaudio)
+               -Denable-profiling=$(usex debug)
+               -Denable-pulseaudio=$(usex pulseaudio)
+               -Denable-pipewire=$(usex pipewire)
+               -Denable-readline=$(usex readline)
+               -Denable-sdl3=$(usex sdl)
+               -Denable-sdl2=OFF
+               -Denable-systemd=$(usex systemd)
+               -Denable-threads=$(usex threads)
+               -Denable-trap-on-fpe=$(usex debug)
+               -Denable-ubsan=OFF # compile and link against UBSan (for 
debugging fluidsynth internals)
+               -Denable-waveout=OFF # Windows
+               -Denable-winmidi=OFF # Windows
+               $(cmake_use_find_package doc Doxygen)
+               -DFLUID_DAEMON_ENV_FILE="/etc/fluidsynth.conf"
+       )
+
+       cmake-multilib_src_configure
+}
+
+multilib_src_compile() {
+       cmake_src_compile
+       use doc && multilib_is_native_abi && cmake_build doxygen
+}
+
+multilib_src_test() {
+       eninja check
+}
+
+multilib_src_install() {
+       cmake_src_install
+
+       if multilib_is_native_abi ; then
+               systemd_dounit "${BUILD_DIR}/fluidsynth.service"
+
+               insinto /etc
+               doins "${BUILD_DIR}/fluidsynth.conf"
+
+               if use doc ; then
+                       docinto .
+                       dodoc -r "${BUILD_DIR}/doc/api/html"
+               fi
+       fi
+}
+
+multilib_src_install_all() {
+       docinto pdf
+       dodoc doc/*.pdf
+
+       docinto examples
+       dodoc doc/examples/*.c
+
+       newinitd "${FILESDIR}/fluidsynth.init" fluidsynth
+       newconfd "${FILESDIR}/fluidsynth.confd" fluidsynth
+}
+
+pkg_postinst() {
+       elog "When using fluidsynth as a system service, make sure"
+       elog "to configure your fluidsynth settings globally in "
+       elog "/etc/fluidsynth.conf or per-user in ~/.config/fluidsynth"
+}

Reply via email to