From 86bafee93b31de01d0d21f67f2b95b4b043c5dff Mon Sep 17 00:00:00 2001 From: Nicolas PARLANT Date: Sat, 23 May 2026 08:15:44 +0200 Subject: [PATCH] media-plugins/audacious-plugins: add support for libsidplayfp-3 backport patches from 4.6beta1 Signed-off-by: Nicolas PARLANT Part-of: https://codeberg.org/gentoo/gentoo/pulls/956 Signed-off-by: Sam James --- .../audacious-plugins-4.5.1.ebuild | 5 + ...dacious-plugins-4.5.1-libsidplayfp-3.patch | 137 ++++++++++++++++++ 2 files changed, 142 insertions(+) create mode 100644 media-plugins/audacious-plugins/files/audacious-plugins-4.5.1-libsidplayfp-3.patch diff --git a/media-plugins/audacious-plugins/audacious-plugins-4.5.1.ebuild b/media-plugins/audacious-plugins/audacious-plugins-4.5.1.ebuild index da905be8f9b9e..cc516d2135bbb 100644 --- a/media-plugins/audacious-plugins/audacious-plugins-4.5.1.ebuild +++ b/media-plugins/audacious-plugins/audacious-plugins-4.5.1.ebuild @@ -143,6 +143,11 @@ DEPEND=" " RDEPEND="${DEPEND}" +PATCHES=( + # backport from 4.6beta1 + "${FILESDIR}"/${P}-libsidplayfp-3.patch +) + src_prepare() { default # avoid automagic for glspectrum diff --git a/media-plugins/audacious-plugins/files/audacious-plugins-4.5.1-libsidplayfp-3.patch b/media-plugins/audacious-plugins/files/audacious-plugins-4.5.1-libsidplayfp-3.patch new file mode 100644 index 0000000000000..b466d40e2c9b1 --- /dev/null +++ b/media-plugins/audacious-plugins/files/audacious-plugins-4.5.1-libsidplayfp-3.patch @@ -0,0 +1,137 @@ +Backport support for libsidplayfp-3 from 4.6beta1 +https://github.com/audacious-media-player/audacious-plugins/commit/42c05763a136d6523d611473ff3701e2d9e30bec +https://github.com/audacious-media-player/audacious-plugins/commit/2aaf45bd3840858e23b75d5863129a510299abd6 +From 42c05763a136d6523d611473ff3701e2d9e30bec Mon Sep 17 00:00:00 2001 +From: Thomas Lange +Date: Thu, 7 May 2026 20:25:10 +0200 +Subject: [PATCH] sid: Use new sidplayfp API. Closes: #1706 + +The previous play() function is deprecated meanwhile. +--- a/src/sid/xs_sidplay2.cc ++++ b/src/sid/xs_sidplay2.cc +@@ -37,6 +37,14 @@ + #include + #include + ++#ifndef LIBSIDPLAYFP_CHECK_VERSION ++#define LIBSIDPLAYFP_CHECK_VERSION(major,minor,micro) \ ++ (LIBSIDPLAYFP_VERSION_MAJ > (major) || \ ++ (LIBSIDPLAYFP_VERSION_MAJ == (major) && LIBSIDPLAYFP_VERSION_MIN > (minor)) || \ ++ (LIBSIDPLAYFP_VERSION_MAJ == (major) && LIBSIDPLAYFP_VERSION_MIN == (minor) && \ ++ LIBSIDPLAYFP_VERSION_LEV >= (micro))) ++#endif ++ + #include + #include + +@@ -99,7 +107,7 @@ bool xs_sidplayfp_init() + return false; + } + +-#if (LIBSIDPLAYFP_VERSION_MAJ << 8) + LIBSIDPLAYFP_VERSION_MIN < 0x020A ++#if !LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0) + state.currBuilder->filter(xs_cfg.emulateFilters); + if (!state.currBuilder->getStatus()) { + AUDERR("reSID->filter(%d) failed.\n", xs_cfg.emulateFilters); +@@ -141,7 +149,7 @@ bool xs_sidplayfp_init() + return false; + } + +-#if (LIBSIDPLAYFP_VERSION_MAJ << 8) + LIBSIDPLAYFP_VERSION_MIN >= 0x020A ++#if LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0) + /* Call filter() after config() to have an effect */ + state.currEng->filter(0, xs_cfg.emulateFilters); + state.currEng->filter(1, xs_cfg.emulateFilters); +@@ -212,6 +220,11 @@ bool xs_sidplayfp_initsong(int subtune) + return false; + } + ++#if LIBSIDPLAYFP_CHECK_VERSION(2, 15, 0) ++ bool stereo = xs_cfg.audioChannels == XS_CHN_STEREO; ++ state.currEng->initMixer(stereo); ++#endif ++ + return true; + } + +@@ -220,7 +233,15 @@ bool xs_sidplayfp_initsong(int subtune) + */ + unsigned xs_sidplayfp_fillbuffer(char * audioBuffer, unsigned audioBufSize) + { ++#if LIBSIDPLAYFP_CHECK_VERSION(2, 15, 0) ++ int samples = state.currEng->play(audioBufSize / 2); ++ if (samples < 0) ++ return 0; ++ ++ return state.currEng->mix((short *)audioBuffer, samples) * 2; ++#else + return state.currEng->play((short *)audioBuffer, audioBufSize / 2) * 2; ++#endif + } + + +From 2aaf45bd3840858e23b75d5863129a510299abd6 Mon Sep 17 00:00:00 2001 +From: Thomas Lange +Date: Thu, 7 May 2026 20:29:50 +0200 +Subject: [PATCH] sid: Support version 3.0 of libsidplayfp version + +libsidplayfp 3.0 contains the header +only when built with ReSIDfp support, depending on the new library +libresidfp. Print a warning if this is not the case. + +See also: https://github.com/libsidplayfp/libsidplayfp/releases/tag/v3.0.0 +--- a/src/sid/meson.build ++++ b/src/sid/meson.build +@@ -1,6 +1,18 @@ + sidplayfp_dep = dependency('libsidplayfp', version: '>= 2.0', required: false) +-have_sid = sidplayfp_dep.found() + ++# libsidplayfp 3.0 moved the ReSIDfp engine to an external library (libresidfp). ++# It is optional for libsidplayfp, but the SID plugin for Audacious requires it. ++if sidplayfp_dep.version().version_compare('>= 3.0') ++ residfp_dep = dependency('libresidfp', version: '>= 1.0', required: false) ++ if not residfp_dep.found() ++ warning('The SID plugin was disabled because your libsidplayfp installation ' + ++ 'lacks ReSIDfp support. Make sure it was built with the optional ' + ++ 'libresidfp dependency.') ++ endif ++ have_sid = sidplayfp_dep.found() and residfp_dep.found() ++else ++ have_sid = sidplayfp_dep.found() ++endif + + if have_sid + sid_datadir = join_paths(get_option('prefix'), get_option('datadir')) +--- a/src/sid/xs_sidplay2.cc ++++ b/src/sid/xs_sidplay2.cc +@@ -82,6 +82,7 @@ bool xs_sidplayfp_init() + /* Get current configuration */ + SidConfig config = state.currEng->config(); + ++#if !LIBSIDPLAYFP_CHECK_VERSION(3, 0, 0) + /* Configure channels and stuff */ + switch (xs_cfg.audioChannels) + { +@@ -93,6 +94,7 @@ bool xs_sidplayfp_init() + config.playback = SidConfig::MONO; + break; + } ++#endif + + /* Audio parameters sanity checking and setup */ + config.frequency = xs_cfg.audioFrequency; +@@ -100,12 +102,14 @@ bool xs_sidplayfp_init() + /* Initialize builder object */ + state.currBuilder = new ReSIDfpBuilder("ReSIDfp builder"); + ++#if !LIBSIDPLAYFP_CHECK_VERSION(3, 0, 0) + /* Builder object created, initialize it */ + state.currBuilder->create(state.currEng->info().maxsids()); + if (!state.currBuilder->getStatus()) { + AUDERR("reSID->create() failed.\n"); + return false; + } ++#endif + + #if !LIBSIDPLAYFP_CHECK_VERSION(2, 10, 0) + state.currBuilder->filter(xs_cfg.emulateFilters);