1 |
commit: fef415c56f13404c0ec5501d26012eaf9ca34292 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jul 30 22:15:45 2017 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jul 30 22:15:55 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fef415c5 |
7 |
|
8 |
media-sound/xmms2: fix hash computation on big-endian platforms |
9 |
|
10 |
Was manifested as a single test failure in xmms2. |
11 |
|
12 |
Package-Manager: Portage-2.3.6, Repoman-2.3.3 |
13 |
|
14 |
.../xmms2/files/xmms2-0.8_p20161122-be-hash.patch | 39 +++ |
15 |
media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild | 294 +++++++++++++++++++++ |
16 |
2 files changed, 333 insertions(+) |
17 |
|
18 |
diff --git a/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch |
19 |
new file mode 100644 |
20 |
index 00000000000..5fa43298cf7 |
21 |
--- /dev/null |
22 |
+++ b/media-sound/xmms2/files/xmms2-0.8_p20161122-be-hash.patch |
23 |
@@ -0,0 +1,39 @@ |
24 |
+From d97c8b8239e8b3c5ddb951d427b7d78ea7faad25 Mon Sep 17 00:00:00 2001 |
25 |
+From: Sergei Trofimovich <slyfox@g.o> |
26 |
+Date: Sun, 30 Jul 2017 23:08:02 +0100 |
27 |
+Subject: [PATCH] OTHER: _xmmsv_dict_hash: make hash function |
28 |
+ endianness-agnostic |
29 |
+ |
30 |
+The following code: |
31 |
+ uint32_t k; |
32 |
+ memcpy (&k, data, sizeof (k)); |
33 |
+computes different data depending on platform endianness. |
34 |
+ |
35 |
+That causes test_xmmsv_serialize_coll_match test to fail |
36 |
+as collection order is serialized in wrong order. |
37 |
+ |
38 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
39 |
+--- |
40 |
+ src/lib/xmmstypes/xmmsv_dict.c | 6 ++++-- |
41 |
+ 1 file changed, 4 insertions(+), 2 deletions(-) |
42 |
+ |
43 |
+diff --git a/src/lib/xmmstypes/xmmsv_dict.c b/src/lib/xmmstypes/xmmsv_dict.c |
44 |
+index 5ebe4eb3..32533285 100644 |
45 |
+--- a/src/lib/xmmstypes/xmmsv_dict.c |
46 |
++++ b/src/lib/xmmstypes/xmmsv_dict.c |
47 |
+@@ -66,8 +66,10 @@ _xmmsv_dict_hash (const void *key, int len) |
48 |
+ |
49 |
+ while (len >= 4) |
50 |
+ { |
51 |
+- uint32_t k; |
52 |
+- memcpy (&k, data, sizeof (k)); |
53 |
++ uint32_t k = data [0] |
54 |
++ | data [1] << 8 |
55 |
++ | data [2] << 16 |
56 |
++ | data [3] << 24; |
57 |
+ |
58 |
+ k *= m; |
59 |
+ k ^= k >> r; |
60 |
+-- |
61 |
+2.13.3 |
62 |
+ |
63 |
|
64 |
diff --git a/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild b/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild |
65 |
new file mode 100644 |
66 |
index 00000000000..68cca7d5b76 |
67 |
--- /dev/null |
68 |
+++ b/media-sound/xmms2/xmms2-0.8_p20161122-r1.ebuild |
69 |
@@ -0,0 +1,294 @@ |
70 |
+# Copyright 1999-2017 Gentoo Foundation |
71 |
+# Distributed under the terms of the GNU General Public License v2 |
72 |
+ |
73 |
+EAPI=6 |
74 |
+ |
75 |
+PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} ) |
76 |
+USE_RUBY="ruby20 ruby21 ruby22" |
77 |
+ |
78 |
+inherit eutils multiprocessing python-single-r1 ruby-single toolchain-funcs |
79 |
+ |
80 |
+# generated as 'python2 ./utils/gen-tarball.py' from clean git tree |
81 |
+MY_P="${P%_p*}DrO_o-949-gca15e830" |
82 |
+ |
83 |
+DESCRIPTION="X(cross)platform Music Multiplexing System. Next generation of the XMMS player" |
84 |
+HOMEPAGE="https://xmms2.org/wiki/Main_Page" |
85 |
+#SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.bz2" |
86 |
+SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${MY_P}.tar.bz2" |
87 |
+LICENSE="GPL-2 LGPL-2.1" |
88 |
+ |
89 |
+SLOT="0" |
90 |
+KEYWORDS="~alpha ~amd64 ~ppc ~x86" |
91 |
+ |
92 |
+IUSE="aac airplay +alsa ao asf cdda curl cxx ffmpeg flac fluidsynth gvfs ices |
93 |
+jack mac mlib-update mms +mad modplug mp3 mp4 musepack ofa opus oss |
94 |
+perl phonehome pulseaudio python ruby samba +server sid sndfile speex |
95 |
+test valgrind +vorbis vocoder wavpack xml zeroconf" |
96 |
+ |
97 |
+RDEPEND="server? ( |
98 |
+ >=dev-db/sqlite-3.3.4 |
99 |
+ |
100 |
+ aac? ( >=media-libs/faad2-2.0 ) |
101 |
+ airplay? ( dev-libs/openssl:0= ) |
102 |
+ alsa? ( media-libs/alsa-lib ) |
103 |
+ ao? ( media-libs/libao ) |
104 |
+ cdda? ( dev-libs/libcdio-paranoia |
105 |
+ >=media-libs/libdiscid-0.1.1 |
106 |
+ >=media-sound/cdparanoia-3.9.8 ) |
107 |
+ curl? ( >=net-misc/curl-7.15.1 ) |
108 |
+ ffmpeg? ( virtual/ffmpeg ) |
109 |
+ flac? ( media-libs/flac ) |
110 |
+ fluidsynth? ( media-sound/fluidsynth ) |
111 |
+ gvfs? ( gnome-base/gnome-vfs ) |
112 |
+ ices? ( media-libs/libogg |
113 |
+ media-libs/libshout |
114 |
+ media-libs/libvorbis ) |
115 |
+ jack? ( >=media-sound/jack-audio-connection-kit-0.101.1 ) |
116 |
+ mac? ( media-sound/mac ) |
117 |
+ mms? ( virtual/ffmpeg |
118 |
+ >=media-libs/libmms-0.3 ) |
119 |
+ modplug? ( media-libs/libmodplug ) |
120 |
+ mad? ( media-libs/libmad ) |
121 |
+ mp3? ( >=media-sound/mpg123-1.5.1 ) |
122 |
+ musepack? ( media-sound/musepack-tools ) |
123 |
+ ofa? ( media-libs/libofa ) |
124 |
+ opus? ( media-libs/opus |
125 |
+ media-libs/opusfile ) |
126 |
+ pulseaudio? ( media-sound/pulseaudio ) |
127 |
+ samba? ( >=net-fs/samba-4.2 ) |
128 |
+ sid? ( media-sound/sidplay |
129 |
+ media-libs/resid ) |
130 |
+ sndfile? ( media-libs/libsndfile ) |
131 |
+ speex? ( media-libs/speex |
132 |
+ media-libs/libogg ) |
133 |
+ vorbis? ( media-libs/libvorbis ) |
134 |
+ vocoder? ( sci-libs/fftw:3.0= media-libs/libsamplerate ) |
135 |
+ wavpack? ( media-sound/wavpack ) |
136 |
+ xml? ( dev-libs/libxml2 ) |
137 |
+ zeroconf? ( net-dns/avahi[mdnsresponder-compat] ) |
138 |
+ ) |
139 |
+ |
140 |
+ >=dev-libs/glib-2.12.9 |
141 |
+ cxx? ( >=dev-libs/boost-1.32 ) |
142 |
+ perl? ( >=dev-lang/perl-5.8.8 ) |
143 |
+ python? ( ${PYTHON_DEPS} ) |
144 |
+ ruby? ( ${RUBY_DEPS} ) |
145 |
+" |
146 |
+ |
147 |
+DEPEND="${RDEPEND} |
148 |
+ dev-lang/python |
149 |
+ virtual/pkgconfig |
150 |
+ perl? ( dev-perl/Module-Build |
151 |
+ virtual/perl-Module-Metadata ) |
152 |
+ python? ( >=dev-python/cython-0.15.1 |
153 |
+ dev-python/pyrex ) |
154 |
+ test? ( dev-util/cunit |
155 |
+ valgrind? ( dev-util/valgrind ) ) |
156 |
+" |
157 |
+ |
158 |
+REQUIRED_USE="${PYTHON_REQUIRED_USE}" |
159 |
+ |
160 |
+S="${WORKDIR}/${MY_P}" |
161 |
+ |
162 |
+pkg_setup() { |
163 |
+ # used both for building xmms2 and |
164 |
+ # optionally linking client library |
165 |
+ # against python |
166 |
+ python-single-r1_pkg_setup |
167 |
+} |
168 |
+ |
169 |
+# use_enable() is taken as proto |
170 |
+# $1 - useflag |
171 |
+# $2 - xmms2 option/plugin name (equals to $1 if not set) |
172 |
+ |
173 |
+xmms2_flag() { |
174 |
+ [[ -z $1 ]] && eerror "!!! empty arg. usage: xmms2_flag <USEFLAG> [<xmms2_flagname>]." |
175 |
+ |
176 |
+ local UWORD=${2:-$1} |
177 |
+ |
178 |
+ case $1 in |
179 |
+ ENABLED) |
180 |
+ echo ",${UWORD}" |
181 |
+ ;; |
182 |
+ DISABLED) |
183 |
+ ;; |
184 |
+ *) |
185 |
+ use $1 && echo ",${UWORD}" |
186 |
+ ;; |
187 |
+ esac |
188 |
+} |
189 |
+ |
190 |
+src_prepare() { |
191 |
+ ./waf # inflate waf |
192 |
+ cd .waf* || die |
193 |
+ # needs port |
194 |
+ #epatch "${FILESDIR}/${PN}"-0.8DrO_o-waflib-fix-perl.patch #578778 |
195 |
+ cd "${S}" |
196 |
+ |
197 |
+ eapply "${FILESDIR}/${PN}"-0.8-ffmpeg2.patch #536232 |
198 |
+ |
199 |
+ eapply "${FILESDIR}/${PN}"-0.8-rtvg.patch #424377 |
200 |
+ |
201 |
+ # required to build tarball from git tree |
202 |
+ eapply "${FILESDIR}/${P}"-tarball.patch |
203 |
+ |
204 |
+ # fix hash to be the same on LE/BE platforms |
205 |
+ eapply "${FILESDIR}/${P}"-be-hash.patch |
206 |
+ |
207 |
+ eapply_user |
208 |
+} |
209 |
+ |
210 |
+src_configure() { |
211 |
+ # ./configure alike options. |
212 |
+ local waf_params="--prefix=/usr \ |
213 |
+ --libdir=/usr/$(get_libdir) \ |
214 |
+ --with-target-platform=${CHOST} \ |
215 |
+ --mandir=/usr/share/man \ |
216 |
+ --infodir=/usr/share/info \ |
217 |
+ --datadir=/usr/share \ |
218 |
+ --sysconfdir=/etc \ |
219 |
+ --localstatedir=/var/lib" |
220 |
+ |
221 |
+ local optionals="" |
222 |
+ local plugins="" |
223 |
+ if ! use server ; then |
224 |
+ waf_params+=" --without-xmms2d" |
225 |
+ else |
226 |
+ # some fun static mappings: |
227 |
+ local option_map=( # USE # sorted xmms2 option flag (same, as USE if empty) |
228 |
+ "phonehome et" |
229 |
+ "ENABLED launcher" |
230 |
+ "mlib-update medialib-updater" |
231 |
+ "ENABLED nycli" |
232 |
+ " perl" |
233 |
+ "ENABLED pixmaps" |
234 |
+ " python" |
235 |
+ " ruby" |
236 |
+ "DISABLED tests" |
237 |
+ "DISABLED vistest" |
238 |
+ "cxx xmmsclient++" |
239 |
+ "cxx xmmsclient++-glib" |
240 |
+ "DISABLED xmmsclient-cf" |
241 |
+ "DISABLED xmmsclient-ecore" # not in tree |
242 |
+ |
243 |
+ "test tests" |
244 |
+ ) |
245 |
+ |
246 |
+ local plugin_map=( # USE # sorted xmms2 plugin flag (same, as USE if empty) |
247 |
+ " alsa" |
248 |
+ " airplay" |
249 |
+ " ao" |
250 |
+ "ffmpeg apefile" |
251 |
+ "ffmpeg avcodec" |
252 |
+ " asf" |
253 |
+ "ENABLED asx" |
254 |
+ " cdda" |
255 |
+ "DISABLED coreaudio" # MacOS only? |
256 |
+ " curl" |
257 |
+ "ENABLED cue" |
258 |
+ "zeroconf daap" |
259 |
+ "ENABLED diskwrite" |
260 |
+ "ENABLED equalizer" |
261 |
+ "aac faad" |
262 |
+ "ENABLED file" |
263 |
+ " flac" |
264 |
+ " fluidsynth" |
265 |
+ "ffmpeg flv" |
266 |
+ "ffmpeg tta" |
267 |
+ "DISABLED gme" # not in tree |
268 |
+ " gvfs" |
269 |
+ "ENABLED html" |
270 |
+ " ices" |
271 |
+ "ENABLED icymetaint" |
272 |
+ "ENABLED id3v2" |
273 |
+ " jack" |
274 |
+ "ENABLED karaoke" |
275 |
+ "ENABLED m3u" |
276 |
+ " mac" |
277 |
+ " mms" |
278 |
+ " mad" |
279 |
+ "ENABLED midsquash" |
280 |
+ " mp4" # bug #387961 (aac, mp3, ape can sit there) |
281 |
+ "mp3 mpg123" |
282 |
+ " modplug" |
283 |
+ " musepack" |
284 |
+ "DISABLED nms" # not in tree |
285 |
+ "ENABLED normalize" |
286 |
+ "ENABLED null" |
287 |
+ "ENABLED nulstripper" |
288 |
+ " ofa" |
289 |
+ " opus" |
290 |
+ " oss" |
291 |
+ "ENABLED pls" |
292 |
+ "pulseaudio pulse" |
293 |
+ "ENABLED replaygain" |
294 |
+ "xml rss" |
295 |
+ " samba" |
296 |
+ "DISABLED sc68" #not in tree |
297 |
+ " sid" |
298 |
+ " sndfile" |
299 |
+ " speex" |
300 |
+ "DISABLED sun" # {Open,Net}BSD only |
301 |
+ "DISABLED tremor" # not in tree |
302 |
+ " vorbis" |
303 |
+ " vocoder" |
304 |
+ "ffmpeg tta" |
305 |
+ "ENABLED wave" |
306 |
+ "DISABLED waveout" # windows only |
307 |
+ " wavpack" |
308 |
+ "xml xspf" |
309 |
+ "ENABLED xml" |
310 |
+ ) |
311 |
+ |
312 |
+ local option |
313 |
+ for option in "${option_map[@]}"; do |
314 |
+ optionals+=$(xmms2_flag $option) |
315 |
+ done |
316 |
+ |
317 |
+ local plugin |
318 |
+ for plugin in "${plugin_map[@]}"; do |
319 |
+ plugins+=$(xmms2_flag $plugin) |
320 |
+ done |
321 |
+ fi # ! server |
322 |
+ |
323 |
+ # pass them explicitely even if empty as we try to avoid magic deps |
324 |
+ waf_params+=" --with-optionals=${optionals:1}" # skip first ',' if yet |
325 |
+ waf_params+=" --with-plugins=${plugins:1}" |
326 |
+ waf_params+=" $(use_with valgrind)" |
327 |
+ |
328 |
+ CC="$(tc-getCC)" \ |
329 |
+ CPP="$(tc-getCPP)" \ |
330 |
+ AR="$(tc-getAR)" \ |
331 |
+ RANLIB="$(tc-getRANLIB)" \ |
332 |
+ CXX="$(tc-getCXX)" \ |
333 |
+ ./waf configure ${waf_params} || die "'waf configure' failed" |
334 |
+} |
335 |
+ |
336 |
+src_compile() { |
337 |
+ # waf is very keen to run tests in build phase (bug #424377) but |
338 |
+ # it does not bother running tests twice, so the hack below works: |
339 |
+ ./waf --verbose build || ./waf --verbose build || die "waf build failed" |
340 |
+} |
341 |
+ |
342 |
+src_test() { |
343 |
+ # rerun tests |
344 |
+ ./waf --alltests || die "waf --alltests failed" |
345 |
+} |
346 |
+ |
347 |
+src_install() { |
348 |
+ ./waf --without-ldconfig --destdir="${D}" install || die "'waf install' failed" |
349 |
+ dodoc AUTHORS TODO |
350 |
+} |
351 |
+ |
352 |
+pkg_postinst() { |
353 |
+ elog "This version is built on experimental development code" |
354 |
+ elog "If you encounter any errors report them at http://bugs.xmms2.org" |
355 |
+ elog "and visit #xmms2 at irc://irc.freenode.net" |
356 |
+ if use phonehome ; then |
357 |
+ einfo "" |
358 |
+ einfo "The phone-home client xmms2-et was activated" |
359 |
+ einfo "This client sends anonymous usage-statistics to the xmms2" |
360 |
+ einfo "developers which may help finding bugs" |
361 |
+ einfo "Disable the phonehome useflag if you don't like that" |
362 |
+ fi |
363 |
+} |