Gentoo Archives: gentoo-commits

From: Andreas Sturmlechner <asturm@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-plugins/calf/, media-plugins/calf/files/
Date: Sat, 06 Apr 2019 20:47:14
Message-Id: 1554583611.da177b66a409bd6be238fdfac3b676d580a0f130.asturm@gentoo
1 commit: da177b66a409bd6be238fdfac3b676d580a0f130
2 Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
3 AuthorDate: Sat Apr 6 20:42:22 2019 +0000
4 Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 6 20:46:51 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da177b66
7
8 media-plugins/calf: Fix build with >=fluidsynth-2
9
10 Reported-by: Anton Gubarkov <anton.gubarkov <AT> gmail.com>
11 Closes: https://bugs.gentoo.org/680128
12 Package-Manager: Portage-2.3.62, Repoman-2.3.12
13 Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
14
15 media-plugins/calf/calf-0.90.1.ebuild | 3 +-
16 .../calf/files/calf-0.90.1-fluidsynth-2.patch | 66 ++++++++++++++++++++++
17 2 files changed, 68 insertions(+), 1 deletion(-)
18
19 diff --git a/media-plugins/calf/calf-0.90.1.ebuild b/media-plugins/calf/calf-0.90.1.ebuild
20 index 37fb836f5ee..24614bd103c 100644
21 --- a/media-plugins/calf/calf-0.90.1.ebuild
22 +++ b/media-plugins/calf/calf-0.90.1.ebuild
23 @@ -46,6 +46,7 @@ PATCHES=(
24 "${FILESDIR}/${P}-no-automagic.patch"
25 "${FILESDIR}/${P}-htmldir.patch"
26 "${FILESDIR}/${P}-desktop.patch"
27 + "${FILESDIR}/${P}-fluidsynth-2.patch"
28 )
29
30 src_prepare() {
31 @@ -72,5 +73,5 @@ src_configure() {
32 src_install() {
33 default
34 mv "${ED}"/usr/share/bash-completion/completions/calf \
35 - "${ED}"/usr/share/bash-completion/completions/calfjackhost
36 + "${ED}"/usr/share/bash-completion/completions/calfjackhost || die
37 }
38
39 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
40 new file mode 100644
41 index 00000000000..083b1e95d7d
42 --- /dev/null
43 +++ b/media-plugins/calf/files/calf-0.90.1-fluidsynth-2.patch
44 @@ -0,0 +1,66 @@
45 +From bba03b6080dc198f3513b5c29fe1ba4ff9e4aa59 Mon Sep 17 00:00:00 2001
46 +From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@×××××.com>
47 +Date: Wed, 10 Oct 2018 00:22:46 +0200
48 +Subject: [PATCH] fluidsynth: port to API for fluidsynth version > 2.0.0
49 +MIME-Version: 1.0
50 +Content-Type: text/plain; charset=UTF-8
51 +Content-Transfer-Encoding: 8bit
52 +
53 +Build tested with fluidsynth 1.1.11 and 2.0.1
54 +
55 +Signed-off-by: Andreas Müller <schnitzeltony@×××××.com>
56 +---
57 + src/fluidsynth.cpp | 25 +++++++++++++++++++++++++
58 + 1 file changed, 25 insertions(+)
59 +
60 +diff --git a/src/fluidsynth.cpp b/src/fluidsynth.cpp
61 +index c5d307d76..54023dc8b 100644
62 +--- a/src/fluidsynth.cpp
63 ++++ b/src/fluidsynth.cpp
64 +@@ -74,6 +74,7 @@ fluid_synth_t *fluidsynth_audio_module::create_synth(int &new_sfid)
65 + new_sfid = sid;
66 +
67 + fluid_sfont_t* sfont = fluid_synth_get_sfont(s, 0);
68 ++#if FLUIDSYNTH_VERSION_MAJOR < 2
69 + soundfont_name = (*sfont->get_name)(sfont);
70 +
71 + sfont->iteration_start(sfont);
72 +@@ -92,6 +93,26 @@ fluid_synth_t *fluidsynth_audio_module::create_synth(int &new_sfid)
73 + if (first_preset == -1)
74 + first_preset = id;
75 + }
76 ++#else
77 ++ soundfont_name = fluid_sfont_get_name(sfont);
78 ++
79 ++ fluid_sfont_iteration_start(sfont);
80 ++
81 ++ string preset_list;
82 ++ fluid_preset_t* tmp;
83 ++ int first_preset = -1;
84 ++ while((tmp = fluid_sfont_iteration_next(sfont)))
85 ++ {
86 ++ string pname = fluid_preset_get_name(tmp);
87 ++ int bank = fluid_preset_get_banknum(tmp);
88 ++ int num = fluid_preset_get_num(tmp);
89 ++ int id = num + 128 * bank;
90 ++ sf_preset_names[id] = pname;
91 ++ preset_list += calf_utils::i2s(id) + "\t" + pname + "\n";
92 ++ if (first_preset == -1)
93 ++ first_preset = id;
94 ++ }
95 ++#endif
96 + if (first_preset != -1)
97 + {
98 + fluid_synth_bank_select(s, 0, first_preset >> 7);
99 +@@ -134,7 +155,11 @@ void fluidsynth_audio_module::update_preset_num(int channel)
100 + {
101 + fluid_preset_t *p = fluid_synth_get_channel_preset(synth, channel);
102 + if (p)
103 ++#if FLUIDSYNTH_VERSION_MAJOR < 2
104 + last_selected_presets[channel] = p->get_num(p) + 128 * p->get_banknum(p);
105 ++#else
106 ++ last_selected_presets[channel] = fluid_preset_get_num(p) + 128 * fluid_preset_get_banknum(p);
107 ++#endif
108 + else
109 + last_selected_presets[channel] = -1;
110 + status_serial++;