summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2019-04-06 22:42:22 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2019-04-06 22:46:51 +0200
commitda177b66a409bd6be238fdfac3b676d580a0f130 (patch)
treefce6bfc3161a6732f4625dedfe73a1d9bc3ab9e5 /media-plugins
parentpackage.mask: Add mask block for Perl 5.28.2 bump (diff)
downloadgentoo-da177b66a409bd6be238fdfac3b676d580a0f130.tar.gz
gentoo-da177b66a409bd6be238fdfac3b676d580a0f130.tar.bz2
gentoo-da177b66a409bd6be238fdfac3b676d580a0f130.zip
media-plugins/calf: Fix build with >=fluidsynth-2
Reported-by: Anton Gubarkov <anton.gubarkov@gmail.com> Closes: https://bugs.gentoo.org/680128 Package-Manager: Portage-2.3.62, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'media-plugins')
-rw-r--r--media-plugins/calf/calf-0.90.1.ebuild3
-rw-r--r--media-plugins/calf/files/calf-0.90.1-fluidsynth-2.patch66
2 files changed, 68 insertions, 1 deletions
diff --git a/media-plugins/calf/calf-0.90.1.ebuild b/media-plugins/calf/calf-0.90.1.ebuild
index 37fb836f5ee..24614bd103c 100644
--- a/media-plugins/calf/calf-0.90.1.ebuild
+++ b/media-plugins/calf/calf-0.90.1.ebuild
@@ -46,6 +46,7 @@ PATCHES=(
"${FILESDIR}/${P}-no-automagic.patch"
"${FILESDIR}/${P}-htmldir.patch"
"${FILESDIR}/${P}-desktop.patch"
+ "${FILESDIR}/${P}-fluidsynth-2.patch"
)
src_prepare() {
@@ -72,5 +73,5 @@ src_configure() {
src_install() {
default
mv "${ED}"/usr/share/bash-completion/completions/calf \
- "${ED}"/usr/share/bash-completion/completions/calfjackhost
+ "${ED}"/usr/share/bash-completion/completions/calfjackhost || die
}
diff --git a/media-plugins/calf/files/calf-0.90.1-fluidsynth-2.patch b/media-plugins/calf/files/calf-0.90.1-fluidsynth-2.patch
new file mode 100644
index 00000000000..083b1e95d7d
--- /dev/null
+++ b/media-plugins/calf/files/calf-0.90.1-fluidsynth-2.patch
@@ -0,0 +1,66 @@
+From bba03b6080dc198f3513b5c29fe1ba4ff9e4aa59 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@gmail.com>
+Date: Wed, 10 Oct 2018 00:22:46 +0200
+Subject: [PATCH] fluidsynth: port to API for fluidsynth version > 2.0.0
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Build tested with fluidsynth 1.1.11 and 2.0.1
+
+Signed-off-by: Andreas Müller <schnitzeltony@gmail.com>
+---
+ src/fluidsynth.cpp | 25 +++++++++++++++++++++++++
+ 1 file changed, 25 insertions(+)
+
+diff --git a/src/fluidsynth.cpp b/src/fluidsynth.cpp
+index c5d307d76..54023dc8b 100644
+--- a/src/fluidsynth.cpp
++++ b/src/fluidsynth.cpp
+@@ -74,6 +74,7 @@ fluid_synth_t *fluidsynth_audio_module::create_synth(int &new_sfid)
+ new_sfid = sid;
+
+ fluid_sfont_t* sfont = fluid_synth_get_sfont(s, 0);
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ soundfont_name = (*sfont->get_name)(sfont);
+
+ sfont->iteration_start(sfont);
+@@ -92,6 +93,26 @@ fluid_synth_t *fluidsynth_audio_module::create_synth(int &new_sfid)
+ if (first_preset == -1)
+ first_preset = id;
+ }
++#else
++ soundfont_name = fluid_sfont_get_name(sfont);
++
++ fluid_sfont_iteration_start(sfont);
++
++ string preset_list;
++ fluid_preset_t* tmp;
++ int first_preset = -1;
++ while((tmp = fluid_sfont_iteration_next(sfont)))
++ {
++ string pname = fluid_preset_get_name(tmp);
++ int bank = fluid_preset_get_banknum(tmp);
++ int num = fluid_preset_get_num(tmp);
++ int id = num + 128 * bank;
++ sf_preset_names[id] = pname;
++ preset_list += calf_utils::i2s(id) + "\t" + pname + "\n";
++ if (first_preset == -1)
++ first_preset = id;
++ }
++#endif
+ if (first_preset != -1)
+ {
+ fluid_synth_bank_select(s, 0, first_preset >> 7);
+@@ -134,7 +155,11 @@ void fluidsynth_audio_module::update_preset_num(int channel)
+ {
+ fluid_preset_t *p = fluid_synth_get_channel_preset(synth, channel);
+ if (p)
++#if FLUIDSYNTH_VERSION_MAJOR < 2
+ last_selected_presets[channel] = p->get_num(p) + 128 * p->get_banknum(p);
++#else
++ last_selected_presets[channel] = fluid_preset_get_num(p) + 128 * fluid_preset_get_banknum(p);
++#endif
+ else
+ last_selected_presets[channel] = -1;
+ status_serial++;