1 |
commit: 8ebfae3dd7d5badea7fa7dd04bbd59bfd96762b5 |
2 |
Author: Sam James <sam <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Sep 12 20:03:07 2022 +0000 |
4 |
Commit: Sam James <sam <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Sep 12 20:03:31 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8ebfae3d |
7 |
|
8 |
media-sound/timidity++: fix configure tests with Clang 15 |
9 |
|
10 |
Signed-off-by: Sam James <sam <AT> gentoo.org> |
11 |
|
12 |
.../timidity++-2.15.0-clang-15-configure.patch | 27 +++ |
13 |
media-sound/timidity++/timidity++-2.15.0-r5.ebuild | 236 +++++++++++++++++++++ |
14 |
2 files changed, 263 insertions(+) |
15 |
|
16 |
diff --git a/media-sound/timidity++/files/timidity++-2.15.0-clang-15-configure.patch b/media-sound/timidity++/files/timidity++-2.15.0-clang-15-configure.patch |
17 |
new file mode 100644 |
18 |
index 000000000000..80fa7a904d12 |
19 |
--- /dev/null |
20 |
+++ b/media-sound/timidity++/files/timidity++-2.15.0-clang-15-configure.patch |
21 |
@@ -0,0 +1,27 @@ |
22 |
+conftest.c:114:4: error: call to undeclared library function 'exit' with type 'void (int) __attribute__((noreturn))'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] |
23 |
+--- a/configure.in |
24 |
++++ b/configure.in |
25 |
+@@ -696,6 +696,7 @@ dnl *** |
26 |
+ AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[ |
27 |
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
28 |
+ #include <stdarg.h> |
29 |
++ #include <stdlib.h> |
30 |
+ void f (int i, ...) { |
31 |
+ va_list args1, args2; |
32 |
+ va_start (args1, i); |
33 |
+@@ -715,6 +716,7 @@ AC_CACHE_CHECK([for an implementation of va_copy()],lib_cv_va_copy,[ |
34 |
+ AC_CACHE_CHECK([for an implementation of __va_copy()],lib_cv___va_copy,[ |
35 |
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
36 |
+ #include <stdarg.h> |
37 |
++ #include <stdlib.h> |
38 |
+ void f (int i, ...) { |
39 |
+ va_list args1, args2; |
40 |
+ va_start (args1, i); |
41 |
+@@ -745,6 +747,7 @@ fi |
42 |
+ AC_CACHE_CHECK([whether va_lists can be copied by value],lib_cv_va_val_copy,[ |
43 |
+ AC_RUN_IFELSE([AC_LANG_SOURCE([[ |
44 |
+ #include <stdarg.h> |
45 |
++ #include <stdlib.h> |
46 |
+ void f (int i, ...) { |
47 |
+ va_list args1, args2; |
48 |
+ va_start (args1, i); |
49 |
|
50 |
diff --git a/media-sound/timidity++/timidity++-2.15.0-r5.ebuild b/media-sound/timidity++/timidity++-2.15.0-r5.ebuild |
51 |
new file mode 100644 |
52 |
index 000000000000..7748c68b9c2b |
53 |
--- /dev/null |
54 |
+++ b/media-sound/timidity++/timidity++-2.15.0-r5.ebuild |
55 |
@@ -0,0 +1,236 @@ |
56 |
+# Copyright 1999-2022 Gentoo Authors |
57 |
+# Distributed under the terms of the GNU General Public License v2 |
58 |
+ |
59 |
+EAPI=7 |
60 |
+ |
61 |
+inherit autotools desktop elisp-common flag-o-matic systemd xdg |
62 |
+ |
63 |
+MY_PV="${PV/_/-}" |
64 |
+MY_P="TiMidity++-${MY_PV}" |
65 |
+ |
66 |
+DESCRIPTION="A handy MIDI to WAV converter with OSS and ALSA output support" |
67 |
+HOMEPAGE="http://timidity.sourceforge.net/" |
68 |
+SRC_URI="mirror://sourceforge/timidity/${MY_P}.tar.xz" |
69 |
+S="${WORKDIR}/${MY_P}" |
70 |
+ |
71 |
+LICENSE="GPL-2" |
72 |
+SLOT="0" |
73 |
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ppc ~ppc64 ~riscv ~sparc ~x86" |
74 |
+IUSE="alsa ao emacs flac gtk jack motif nas ncurses ogg oss selinux slang speex tk vorbis X Xaw3d" |
75 |
+ |
76 |
+REQUIRED_USE="tk? ( X )" |
77 |
+ |
78 |
+DEPEND=" |
79 |
+ alsa? ( media-libs/alsa-lib ) |
80 |
+ ao? ( >=media-libs/libao-0.8.5 ) |
81 |
+ emacs? ( >=app-editors/emacs-23.1:* ) |
82 |
+ flac? ( media-libs/flac:= ) |
83 |
+ gtk? ( x11-libs/gtk+:2 ) |
84 |
+ jack? ( virtual/jack ) |
85 |
+ motif? ( >=x11-libs/motif-2.3:0 ) |
86 |
+ nas? ( >=media-libs/nas-1.4 ) |
87 |
+ ncurses? ( sys-libs/ncurses:0= ) |
88 |
+ ogg? ( media-libs/libogg ) |
89 |
+ slang? ( sys-libs/slang ) |
90 |
+ speex? ( media-libs/speex ) |
91 |
+ tk? ( dev-lang/tk:= ) |
92 |
+ vorbis? ( media-libs/libvorbis ) |
93 |
+ X? ( |
94 |
+ media-libs/libpng:= |
95 |
+ x11-libs/libX11 |
96 |
+ x11-libs/libXext |
97 |
+ Xaw3d? ( x11-libs/libXaw3d ) |
98 |
+ !Xaw3d? ( x11-libs/libXaw ) |
99 |
+ ) |
100 |
+" |
101 |
+ |
102 |
+RDEPEND=" |
103 |
+ ${DEPEND} |
104 |
+ acct-group/audio |
105 |
+ acct-group/nobody |
106 |
+ acct-user/timidity |
107 |
+ app-eselect/eselect-timidity |
108 |
+ alsa? ( media-sound/alsa-utils ) |
109 |
+ selinux? ( sec-policy/selinux-timidity ) |
110 |
+" |
111 |
+ |
112 |
+PDEPEND="|| ( media-sound/timidity-eawpatches media-sound/timidity-freepats )" |
113 |
+ |
114 |
+SITEFILE=50${PN}-gentoo.el |
115 |
+ |
116 |
+DOCS=( AUTHORS ChangeLog NEWS README "${FILESDIR}"/timidity.cfg-r1 ) |
117 |
+ |
118 |
+PATCHES=( |
119 |
+ "${FILESDIR}"/${PN}-2.14.0-params.patch |
120 |
+ "${FILESDIR}"/${PN}-2.14.0-ar.patch |
121 |
+ "${FILESDIR}"/${PN}-2.14.0-configure-flags.patch |
122 |
+ "${FILESDIR}"/${PN}-2.15.0-pkg-config.patch |
123 |
+ "${FILESDIR}"/${PN}-2.14.0-CVE-2017-1154{6,7}.patch |
124 |
+ "${FILESDIR}"/${PN}-2.15.0-lto-workaround.patch |
125 |
+ "${FILESDIR}"/${PN}-2.15.0-clang-15-configure.patch |
126 |
+) |
127 |
+ |
128 |
+src_prepare() { |
129 |
+ default |
130 |
+ |
131 |
+ mv configure.{in,ac} || die |
132 |
+ |
133 |
+ eautoreconf |
134 |
+} |
135 |
+ |
136 |
+src_configure() { |
137 |
+ export EXTRACFLAGS="${CFLAGS}" #385817 |
138 |
+ |
139 |
+ local audios |
140 |
+ # List by preference |
141 |
+ local xaw_provider=$(usex Xaw3d 'xaw3d' 'xaw') |
142 |
+ |
143 |
+ # configure workarounds: configure.in here is written for an old version |
144 |
+ # of autoconf and upstream seems quite dead. |
145 |
+ # |
146 |
+ # 1. Avoid janky configure test breaking |
147 |
+ # ```checking for sys/wait.h that is POSIX.1 compatible... yes |
148 |
+ # ./configure: 7995: test: =: unexpected operator``` |
149 |
+ export ac_cv_header_sys_time_h=yes |
150 |
+ # |
151 |
+ # 2. And yes, we expect standard header locations (this configure test is flaky for us too) |
152 |
+ # This avoids a bunch of implicit decl. errors which only happen with USE=-Xaw3d(?!) |
153 |
+ append-cppflags -DSTDC_HEADERS |
154 |
+ |
155 |
+ local myeconfargs=( |
156 |
+ --localstatedir=/var/state/${PN} |
157 |
+ --with-module-dir="${EPREFIX}/usr/share/timidity" |
158 |
+ --with-lispdir="${SITELISP}/${PN}" |
159 |
+ --with-elf |
160 |
+ --enable-server |
161 |
+ --enable-network |
162 |
+ --enable-dynamic |
163 |
+ --enable-vt100 |
164 |
+ --enable-spline=cubic |
165 |
+ $(use_enable emacs) |
166 |
+ $(use_enable slang) |
167 |
+ $(use_enable ncurses) |
168 |
+ $(use_with X x) |
169 |
+ $(use_enable X spectrogram) |
170 |
+ $(use_enable X wrd) |
171 |
+ $(use_enable X xskin) |
172 |
+ $(use_enable X xaw) |
173 |
+ $(use_enable gtk) |
174 |
+ $(use_enable tk tcltk) |
175 |
+ $(use_enable motif) |
176 |
+ $(use_with Xaw3d xawlib ${xaw_provider}) |
177 |
+ ) |
178 |
+ |
179 |
+ use flac && audios+=",flac" |
180 |
+ use speex && audios+=",speex" |
181 |
+ use vorbis && audios+=",vorbis" |
182 |
+ use ogg && audios+=",ogg" |
183 |
+ use oss && audios+=",oss" |
184 |
+ use jack && audios+=",jack" |
185 |
+ use ao && audios+=",ao" |
186 |
+ |
187 |
+ if use nas; then |
188 |
+ audios+=",nas" |
189 |
+ myeconfargs+=( |
190 |
+ --with-nas-library="/usr/$(get_libdir)/libaudio.so" |
191 |
+ --with-x |
192 |
+ ) |
193 |
+ use X || ewarn "Basic X11 support will be enabled because required by nas." |
194 |
+ fi |
195 |
+ |
196 |
+ if use alsa; then |
197 |
+ audios+=",alsa" |
198 |
+ myeconfargs+=( |
199 |
+ --with-default-output=alsa |
200 |
+ --enable-alsaseq |
201 |
+ ) |
202 |
+ fi |
203 |
+ |
204 |
+ if use motif; then |
205 |
+ myeconfargs+=( |
206 |
+ --with-x |
207 |
+ ) |
208 |
+ use X || ewarn "Basic X11 support will be enabled because required by motif." |
209 |
+ fi |
210 |
+ |
211 |
+ # needs to come after all audios have been collected |
212 |
+ myeconfargs+=( |
213 |
+ --enable-audio=${audios} |
214 |
+ ) |
215 |
+ |
216 |
+ econf "${myeconfargs[@]}" |
217 |
+} |
218 |
+ |
219 |
+src_install() { |
220 |
+ emake DESTDIR="${D}" install |
221 |
+ einstalldocs |
222 |
+ |
223 |
+ # these are only for the ALSA sequencer mode |
224 |
+ if use alsa; then |
225 |
+ newconfd "${FILESDIR}"/conf.d.timidity.2 timidity |
226 |
+ newinitd "${FILESDIR}"/init.d.timidity.4 timidity |
227 |
+ |
228 |
+ systemd_dounit "${FILESDIR}"/timidity.service |
229 |
+ fi |
230 |
+ |
231 |
+ insinto /etc |
232 |
+ newins "${FILESDIR}"/timidity.cfg-r1 timidity.cfg |
233 |
+ |
234 |
+ dodir /usr/share/timidity |
235 |
+ dosym ../../../etc/timidity.cfg /usr/share/timidity/timidity.cfg |
236 |
+ |
237 |
+ if use emacs; then |
238 |
+ elisp-site-file-install "${FILESDIR}/${SITEFILE}" |
239 |
+ fi |
240 |
+ |
241 |
+ doicon "${FILESDIR}"/timidity.xpm |
242 |
+ newmenu "${FILESDIR}"/timidity.desktop.2 timidity.desktop |
243 |
+ |
244 |
+ # Order of preference: gtk, X (Xaw), ncurses, slang |
245 |
+ # Do not create menu item for terminal ones |
246 |
+ local interface="-id" |
247 |
+ local terminal="true" |
248 |
+ local nodisplay="true" |
249 |
+ if use gtk || use X; then |
250 |
+ interface="-ia" |
251 |
+ terminal="false" |
252 |
+ nodisplay="false" |
253 |
+ use gtk && interface="-ig" |
254 |
+ elif use ncurses || use slang; then |
255 |
+ local interface="-is" |
256 |
+ use ncurses && interface="-in" |
257 |
+ fi |
258 |
+ sed -e "s/Exec=timidity/Exec=timidity ${interface}/" \ |
259 |
+ -e "s/Terminal=.*/Terminal=${terminal}/" \ |
260 |
+ -e "s/NoDisplay=.*/NoDisplay=${nodisplay}/" \ |
261 |
+ -i "${ED}"/usr/share/applications/timidity.desktop || die |
262 |
+} |
263 |
+ |
264 |
+pkg_preinst() { |
265 |
+ xdg_pkg_preinst |
266 |
+} |
267 |
+ |
268 |
+pkg_postinst() { |
269 |
+ use emacs && elisp-site-regen |
270 |
+ |
271 |
+ elog "A timidity config file has been installed in /etc/timidity.cfg." |
272 |
+ elog "Do not edit this file as it will interfere with the eselect timidity tool." |
273 |
+ elog "The tool 'eselect timidity' can be used to switch between installed patchsets." |
274 |
+ |
275 |
+ if use alsa; then |
276 |
+ elog "An init script for the alsa timidity sequencer has been installed." |
277 |
+ elog "If you wish to use the timidity virtual sequencer, edit /etc/conf.d/timidity" |
278 |
+ elog "and run 'rc-update add timidity <runlevel> && /etc/init.d/timidity start'" |
279 |
+ fi |
280 |
+ |
281 |
+ if use sparc; then |
282 |
+ elog "Only saving to wave file and ALSA soundback has been tested working." |
283 |
+ fi |
284 |
+ |
285 |
+ xdg_pkg_postinst |
286 |
+} |
287 |
+ |
288 |
+pkg_postrm() { |
289 |
+ use emacs && elisp-site-regen |
290 |
+ xdg_pkg_postrm |
291 |
+} |