Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/mplayer/files/, media-video/mplayer/
Date: Mon, 19 Jun 2017 12:51:06
Message-Id: 1497876648.6a58da3acd14857965c3fe1030237fbb6c75bc91.aballier@gentoo
1 commit: 6a58da3acd14857965c3fe1030237fbb6c75bc91
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sat Jun 17 19:55:00 2017 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 19 12:50:48 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a58da3a
7
8 media-video/mplayer: Rev bump to add patch for CVE-2016-4352 (bug #581952)
9
10 Package-Manager: Portage-2.3.5, Repoman-2.3.2
11
12 .../mplayer/files/mplayer-1.3-CVE-2016-4352.patch | 24 +
13 media-video/mplayer/mplayer-1.3.0-r1.ebuild | 628 +++++++++++++++++++++
14 2 files changed, 652 insertions(+)
15
16 diff --git a/media-video/mplayer/files/mplayer-1.3-CVE-2016-4352.patch b/media-video/mplayer/files/mplayer-1.3-CVE-2016-4352.patch
17 new file mode 100644
18 index 00000000000..4eabf8b5f28
19 --- /dev/null
20 +++ b/media-video/mplayer/files/mplayer-1.3-CVE-2016-4352.patch
21 @@ -0,0 +1,24 @@
22 +https://trac.mplayerhq.hu/ticket/2295
23 +
24 +r37857
25 +
26 +--- old/libmpdemux/demux_gif.c
27 ++++ new/libmpdemux/demux_gif.c
28 +@@ -304,6 +304,17 @@
29 + return NULL;
30 + }
31 +
32 ++ // Validate image size, most code in this demuxer assumes w*h <= INT_MAX
33 ++ if ((int64_t)gif->SWidth * gif->SHeight > INT_MAX) {
34 ++ mp_msg(MSGT_DEMUX, MSGL_ERR,
35 ++ "[demux_gif] Unsupported picture size %dx%d.\n", gif->SWidth,
36 ++ gif->SHeight);
37 ++ if (DGifCloseFile(gif) == GIF_ERROR)
38 ++ print_gif_error(NULL);
39 ++ free(priv);
40 ++ return NULL;
41 ++ }
42 ++
43 + // create a new video stream header
44 + sh_video = new_sh_video(demuxer, 0);
45 +
46
47 diff --git a/media-video/mplayer/mplayer-1.3.0-r1.ebuild b/media-video/mplayer/mplayer-1.3.0-r1.ebuild
48 new file mode 100644
49 index 00000000000..0b643e2701b
50 --- /dev/null
51 +++ b/media-video/mplayer/mplayer-1.3.0-r1.ebuild
52 @@ -0,0 +1,628 @@
53 +# Copyright 1999-2017 Gentoo Foundation
54 +# Distributed under the terms of the GNU General Public License v2
55 +
56 +EAPI=5
57 +
58 +EGIT_REPO_URI="git://git.videolan.org/ffmpeg.git"
59 +ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk"
60 +[[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git-2" || SVN_ECLASS=""
61 +
62 +inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS}
63 +
64 +IUSE="cpu_flags_x86_3dnow cpu_flags_x86_3dnowext a52 aalib +alsa altivec aqua bidi bl bluray
65 +bs2b cddb +cdio cdparanoia cpudetection debug dga
66 +directfb doc dts dv dvb +dvd +dvdnav +enca +encode faac faad fbcon
67 +ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa
68 ++libass libcaca libmpeg2 lirc live lzo mad md5sum +cpu_flags_x86_mmx cpu_flags_x86_mmxext mng mp3 nas
69 ++network nut openal opengl +osdmenu oss png pnm pulseaudio pvr
70 +radio rar rtc rtmp samba selinux +shm sdl speex cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_ssse3
71 +tga theora tremor +truetype toolame twolame +unicode v4l vcd vdpau vidix
72 +vorbis +X x264 xinerama +xscreensaver +xv xvid xvmc yuv4mpeg zoran"
73 +
74 +VIDEO_CARDS="s3virge mga tdfx"
75 +for x in ${VIDEO_CARDS}; do
76 + IUSE+=" video_cards_${x}"
77 +done
78 +
79 +FONT_URI="
80 + mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
81 + mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
82 + mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
83 +"
84 +if [[ ${PV} == *9999* ]]; then
85 + RELEASE_URI=""
86 +elif [ "${PV%_rc*}" = "${PV}" -a "${PV%_pre*}" = "${PV}" ]; then
87 + MY_P="MPlayer-${PV}"
88 + S="${WORKDIR}/${MY_P}"
89 + RELEASE_URI="mirror://mplayer/releases/${MY_P}.tar.xz"
90 +else
91 + RELEASE_URI="mirror://gentoo/${P}.tar.xz"
92 +fi
93 +SRC_URI="${RELEASE_URI}
94 + !truetype? ( ${FONT_URI} )"
95 +
96 +DESCRIPTION="Media Player for Linux"
97 +HOMEPAGE="http://www.mplayerhq.hu/"
98 +
99 +FONT_RDEPS="
100 + virtual/ttf-fonts
101 + media-libs/fontconfig
102 + >=media-libs/freetype-2.2.1:2
103 +"
104 +X_RDEPS="
105 + x11-libs/libXext
106 + x11-libs/libXxf86vm
107 +"
108 +# Rar: althrought -gpl version is nice, it cant do most functions normal rars can
109 +# nemesi? ( net-libs/libnemesi )
110 +RDEPEND+="
111 + sys-libs/ncurses:0=
112 + app-arch/bzip2
113 + sys-libs/zlib
114 + >=media-video/ffmpeg-3.0:0=[vdpau?]
115 + a52? ( media-libs/a52dec )
116 + aalib? ( media-libs/aalib )
117 + alsa? ( media-libs/alsa-lib )
118 + bidi? ( dev-libs/fribidi )
119 + bluray? ( >=media-libs/libbluray-0.2.1:= )
120 + bs2b? ( media-libs/libbs2b )
121 + cdio? ( dev-libs/libcdio:0= dev-libs/libcdio-paranoia )
122 + cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
123 + dga? ( x11-libs/libXxf86dga )
124 + directfb? ( dev-libs/DirectFB )
125 + dts? ( media-libs/libdca )
126 + dv? ( media-libs/libdv )
127 + dvb? ( virtual/linuxtv-dvb-headers )
128 + dvd? ( >=media-libs/libdvdread-4.1.3 )
129 + dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
130 + encode? (
131 + !twolame? ( toolame? ( media-sound/toolame ) )
132 + twolame? ( media-sound/twolame )
133 + faac? ( media-libs/faac )
134 + mp3? ( media-sound/lame )
135 + x264? ( >=media-libs/x264-0.0.20100423:= )
136 + xvid? ( media-libs/xvid )
137 + )
138 + enca? ( app-i18n/enca )
139 + faad? ( media-libs/faad2 )
140 + ggi? ( media-libs/libggi media-libs/libggiwmh )
141 + gif? ( media-libs/giflib:0= )
142 + gsm? ( media-sound/gsm )
143 + iconv? ( virtual/libiconv )
144 + jack? ( media-sound/jack-audio-connection-kit )
145 + jpeg? ( virtual/jpeg:0 )
146 + jpeg2k? ( media-libs/openjpeg:0 )
147 + ladspa? ( media-libs/ladspa-sdk )
148 + libass? ( >=media-libs/libass-0.9.10:= )
149 + libcaca? ( media-libs/libcaca )
150 + libmpeg2? ( media-libs/libmpeg2 )
151 + lirc? ( app-misc/lirc )
152 + live? ( media-plugins/live )
153 + lzo? ( >=dev-libs/lzo-2 )
154 + mad? ( media-libs/libmad )
155 + mng? ( media-libs/libmng:= )
156 + mp3? ( media-sound/mpg123 )
157 + nas? ( media-libs/nas )
158 + nut? ( >=media-libs/libnut-661 )
159 + openal? ( media-libs/openal )
160 + opengl? ( virtual/opengl )
161 + png? ( media-libs/libpng:0= )
162 + pnm? ( media-libs/netpbm )
163 + pulseaudio? ( media-sound/pulseaudio )
164 + rar? (
165 + || (
166 + app-arch/unrar
167 + app-arch/rar
168 + )
169 + )
170 + rtmp? ( media-video/rtmpdump )
171 + samba? ( net-fs/samba )
172 + sdl? ( media-libs/libsdl )
173 + speex? ( media-libs/speex )
174 + theora? ( media-libs/libtheora[encode?] )
175 + tremor? ( media-libs/tremor )
176 + truetype? ( ${FONT_RDEPS} )
177 + vdpau? ( x11-libs/libvdpau )
178 + vorbis? ( !tremor? ( media-libs/libvorbis ) )
179 + X? ( ${X_RDEPS} )
180 + xinerama? ( x11-libs/libXinerama )
181 + xscreensaver? ( x11-libs/libXScrnSaver )
182 + xv? ( x11-libs/libXv )
183 + xvmc? ( x11-libs/libXvMC )
184 +"
185 +
186 +X_DEPS="
187 + x11-proto/videoproto
188 + x11-proto/xf86vidmodeproto
189 +"
190 +ASM_DEP="dev-lang/yasm"
191 +DEPEND="${RDEPEND}
192 + virtual/pkgconfig
193 + dga? ( x11-proto/xf86dgaproto )
194 + X? ( ${X_DEPS} )
195 + xinerama? ( x11-proto/xineramaproto )
196 + xscreensaver? ( x11-proto/scrnsaverproto )
197 + amd64? ( ${ASM_DEP} )
198 + doc? (
199 + dev-libs/libxslt app-text/docbook-xml-dtd
200 + app-text/docbook-xsl-stylesheets
201 + )
202 + x86? ( ${ASM_DEP} )
203 + x86-fbsd? ( ${ASM_DEP} )
204 +"
205 +RDEPEND+="
206 + selinux? ( sec-policy/selinux-mplayer )
207 +"
208 +
209 +SLOT="0"
210 +LICENSE="GPL-2"
211 +if [[ ${PV} != *9999* ]]; then
212 + KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
213 +else
214 + KEYWORDS="~alpha ~arm ~hppa ~ia64"
215 +fi
216 +
217 +# faac codecs are nonfree
218 +# libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio
219 +# dvd navigation requires dvd read support
220 +# ass and freetype font require iconv and ass requires freetype fonts
221 +# unicode transformations are usefull only with iconv
222 +# radio requires oss or alsa backend
223 +# xvmc requires xvideo support
224 +REQUIRED_USE="
225 + dga? ( X )
226 + dvdnav? ( dvd )
227 + enca? ( iconv )
228 + ggi? ( X )
229 + libass? ( truetype )
230 + opengl? ( X )
231 + osdmenu? ( X )
232 + truetype? ( iconv )
233 + vdpau? ( X )
234 + vidix? ( X )
235 + xinerama? ( X )
236 + xscreensaver? ( X )
237 + xv? ( X )
238 + xvmc? ( xv )"
239 +RESTRICT="faac? ( bindist )"
240 +
241 +pkg_setup() {
242 + if [[ ${PV} == *9999* ]]; then
243 + elog
244 + elog "This is a live ebuild which installs the latest from upstream's"
245 + elog "subversion repository, and is unsupported by Gentoo."
246 + elog "Everything but bugs in the ebuild itself will be ignored."
247 + elog
248 + fi
249 +
250 + if use cpudetection; then
251 + ewarn
252 + ewarn "You've enabled the cpudetection flag. This feature is"
253 + ewarn "included mainly for people who want to use the same"
254 + ewarn "binary on another system with a different CPU architecture."
255 + ewarn "MPlayer will already detect your CPU settings by default at"
256 + ewarn "buildtime; this flag is used for runtime detection."
257 + ewarn "You won't need this turned on if you are only building"
258 + ewarn "mplayer for this system. Also, if your compile fails, try"
259 + ewarn "disabling this use flag."
260 + fi
261 +
262 + if has_version 'media-video/libav' ; then
263 + ewarn "Please note that upstream uses media-video/ffmpeg."
264 + ewarn "media-video/libav should be fine in theory but if you"
265 + ewarn "experience any problem, try to move to media-video/ffmpeg."
266 + fi
267 +}
268 +
269 +src_unpack() {
270 + if [[ ${PV} = *9999* ]]; then
271 + subversion_src_unpack
272 + cd "${WORKDIR}"
273 + rm -rf "${WORKDIR}/${P}/ffmpeg/"
274 + ( S="${WORKDIR}/${P}/ffmpeg/" git-2_src_unpack )
275 + else
276 + unpack ${A}
277 + fi
278 +
279 + if [[ ${PV} = *9999* ]] || [[ "${PV%_rc*}" = "${PV}" ]]; then
280 + cd "${S}"
281 + cp "${FILESDIR}/dump_ffmpeg.sh" . || die
282 + chmod +x dump_ffmpeg.sh
283 + ./dump_ffmpeg.sh || die
284 + fi
285 +
286 + if ! use truetype; then
287 + unpack font-arial-iso-8859-1.tar.bz2 \
288 + font-arial-iso-8859-2.tar.bz2 \
289 + font-arial-cp1250.tar.bz2
290 + fi
291 +}
292 +
293 +src_prepare() {
294 + local svf=snapshot_version
295 + if [[ ${PV} = *9999* ]]; then
296 + # Set SVN version manually
297 + subversion_wc_info
298 + printf "${ESVN_WC_REVISION}" > $svf
299 + else
300 + epatch "${FILESDIR}"/${PN}-1.3-CVE-2016-4352.patch
301 + fi
302 + if [ ! -f VERSION ] ; then
303 + [ -f "$svf" ] || die "Missing ${svf}. Did you generate your snapshot with prepare_mplayer.sh?"
304 + local sv=$(<$svf)
305 + printf "SVN-r${sv} (Gentoo)" > VERSION
306 + fi
307 +
308 + # fix path to bash executable in configure scripts
309 + sed -i -e "1c\#!${EPREFIX}/bin/bash" configure version.sh || die
310 +
311 + base_src_prepare
312 +
313 + # Use sane default for >=virtual/udev-197
314 + sed -i -e '/default_dvd_device/s:/dev/dvd:/dev/cdrom:' configure || die
315 +}
316 +
317 +src_configure() {
318 + local myconf=""
319 + local uses i
320 +
321 + # set LINGUAS
322 + [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
323 + [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/zh/zh_CN}" #482968
324 +
325 + # mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
326 + # compilation in almost every situation. The reason for this is
327 + # because if --enable is used, it will force the build of that option,
328 + # regardless of whether the dependency is available or not.
329 +
330 + ###################
331 + #Optional features#
332 + ###################
333 + # disable svga since we don't want it
334 + # disable arts since we don't have kde3
335 + # always disable internal ass
336 + # disable opus and ilbc since it only controls support in internal
337 + # ffmpeg which we do not use
338 + myconf+="
339 + --disable-svga --disable-svgalib_helper
340 + --disable-ass-internal
341 + --disable-arts
342 + --disable-kai
343 + --disable-libopus
344 + --disable-libilbc
345 + $(use_enable network networking)
346 + $(use_enable joystick)
347 + "
348 + uses="bl bluray enca ftp rtc vcd" # nemesi <- not working with in-tree ebuild
349 + myconf+=" --disable-nemesi" # nemesi automagic disable
350 + for i in ${uses}; do
351 + use ${i} || myconf+=" --disable-${i}"
352 + done
353 + use bidi || myconf+=" --disable-fribidi"
354 + use ipv6 || myconf+=" --disable-inet6"
355 + use libass || myconf+=" --disable-ass"
356 + use nut || myconf+=" --disable-libnut"
357 + use rar || myconf+=" --disable-unrarexec"
358 + use samba || myconf+=" --disable-smb"
359 + use lirc || myconf+=" --disable-lirc --disable-lircc --disable-apple-ir"
360 +
361 + # libcdio support: prefer libcdio over cdparanoia
362 + # don't check for cddb w/cdio
363 + if use cdio; then
364 + myconf+=" --disable-cdparanoia"
365 + else
366 + myconf+=" --disable-libcdio"
367 + use cdparanoia || myconf+=" --disable-cdparanoia"
368 + use cddb || myconf+=" --disable-cddb"
369 + fi
370 +
371 + ################################
372 + # DVD read, navigation support #
373 + ################################
374 + #
375 + # dvdread - accessing a DVD
376 + # dvdnav - navigation of menus
377 + use dvd || myconf+=" --disable-dvdread"
378 + use dvdnav || myconf+=" --disable-dvdnav"
379 +
380 + #############
381 + # Subtitles #
382 + #############
383 + #
384 + # SRT/ASS/SSA (subtitles) requires freetype support
385 + # freetype support requires iconv
386 + # iconv optionally can use unicode
387 + use truetype || myconf+=" --disable-freetype"
388 + use iconv || myconf+=" --disable-iconv --charset=noconv"
389 + use iconv && use unicode && myconf+=" --charset=UTF-8"
390 +
391 + #####################################
392 + # DVB / Video4Linux / Radio support #
393 + #####################################
394 + myconf+=" --disable-tv-bsdbt848"
395 + # broken upstream, won't work with recent kernels
396 + myconf+=" --disable-ivtv"
397 + # gone since linux-headers-2.6.38
398 + myconf+=" --disable-tv-v4l1"
399 + if { use dvb || use v4l || use pvr || use radio; }; then
400 + use dvb || myconf+=" --disable-dvb"
401 + use pvr || myconf+=" --disable-pvr"
402 + use v4l || myconf+=" --disable-tv-v4l2"
403 + if use radio && { use dvb || use v4l; }; then
404 + myconf+="
405 + --enable-radio
406 + $(use_enable encode radio-capture)
407 + "
408 + else
409 + myconf+="
410 + --disable-radio-v4l2
411 + --disable-radio-bsdbt848
412 + "
413 + fi
414 + else
415 + myconf+="
416 + --disable-tv
417 + --disable-tv-v4l2
418 + --disable-radio
419 + --disable-radio-v4l2
420 + --disable-radio-bsdbt848
421 + --disable-dvb
422 + --disable-v4l2
423 + --disable-pvr"
424 + fi
425 +
426 + ##########
427 + # Codecs #
428 + ##########
429 + myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support
430 + myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2
431 + use dts || myconf+=" --disable-libdca"
432 + if ! use mp3; then
433 + myconf+="
434 + --disable-mp3lame
435 + --disable-mpg123
436 + "
437 + fi
438 + uses="a52 bs2b dv gsm lzo rtmp vorbis"
439 + for i in ${uses}; do
440 + use ${i} || myconf+=" --disable-lib${i}"
441 + done
442 +
443 + uses="faad gif jpeg libmpeg2 live mad mng png pnm speex tga theora tremor"
444 + for i in ${uses}; do
445 + use ${i} || myconf+=" --disable-${i}"
446 + done
447 + use jpeg2k || myconf+=" --disable-libopenjpeg"
448 +
449 + # Encoding
450 + uses="faac x264 xvid toolame twolame"
451 + if use encode; then
452 + for i in ${uses}; do
453 + use ${i} || myconf+=" --disable-${i}"
454 + done
455 + else
456 + myconf+=" --disable-mencoder"
457 + for i in ${uses}; do
458 + myconf+=" --disable-${i}"
459 + use ${i} && elog "Useflag \"${i}\" will only be useful for encoding, i.e., with \"encode\" useflag enabled."
460 + done
461 + fi
462 +
463 + #################
464 + # Binary codecs #
465 + #################
466 + myconf+=" --disable-qtx --disable-real --disable-win32dll"
467 +
468 + ################
469 + # Video Output #
470 + ################
471 + uses="directfb md5sum sdl yuv4mpeg"
472 + for i in ${uses}; do
473 + use ${i} || myconf+=" --disable-${i}"
474 + done
475 + use aalib || myconf+=" --disable-aa"
476 + use fbcon || myconf+=" --disable-fbdev"
477 + use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
478 + use libcaca || myconf+=" --disable-caca"
479 + use zoran || myconf+=" --disable-zr"
480 +
481 + if ! use kernel_linux || ! use video_cards_mga; then
482 + myconf+=" --disable-mga --disable-xmga"
483 + fi
484 +
485 + if use video_cards_tdfx; then
486 + myconf+="
487 + $(use_enable video_cards_tdfx tdfxvid)
488 + $(use_enable fbcon tdfxfb)
489 + "
490 + else
491 + myconf+="
492 + --disable-3dfx
493 + --disable-tdfxvid
494 + --disable-tdfxfb
495 + "
496 + fi
497 +
498 + # sun card, disable by default, see bug #258729
499 + myconf+=" --disable-xvr100"
500 +
501 + ################
502 + # Audio Output #
503 + ################
504 + myconf+=" --disable-esd"
505 + uses="alsa jack ladspa nas openal"
506 + for i in ${uses}; do
507 + use ${i} || myconf+=" --disable-${i}"
508 + done
509 + use pulseaudio || myconf+=" --disable-pulse"
510 + if ! use radio; then
511 + use oss || myconf+=" --disable-ossaudio"
512 + fi
513 +
514 + ####################
515 + # Advanced Options #
516 + ####################
517 + # Platform specific flags, hardcoded on amd64 (see below)
518 + use cpudetection && myconf+=" --enable-runtime-cpudetection"
519 +
520 + uses="3dnow 3dnowext mmx mmxext sse sse2 ssse3"
521 + for i in ${uses}; do
522 + myconf+=" $(use_enable cpu_flags_x86_${i} ${i})"
523 + done
524 +
525 + uses="altivec shm"
526 + for i in ${uses}; do
527 + myconf+=" $(use_enable ${i})"
528 + done
529 +
530 + use debug && myconf+=" --enable-debug=3"
531 +
532 + if use x86 && gcc-specs-pie; then
533 + filter-flags -fPIC -fPIE
534 + append-ldflags -nopie
535 + fi
536 +
537 + ###########################
538 + # X enabled configuration #
539 + ###########################
540 + myconf+=" --disable-gui"
541 + myconf+=" --disable-vesa"
542 + uses="ggi vdpau xinerama xv"
543 + for i in ${uses}; do
544 + use ${i} || myconf+=" --disable-${i}"
545 + done
546 + use dga || myconf+=" --disable-dga1 --disable-dga2"
547 + use opengl || myconf+=" --disable-gl"
548 + use osdmenu && myconf+=" --enable-menu"
549 + use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb"
550 + use xscreensaver || myconf+=" --disable-xss"
551 + use X || myconf+=" --disable-x11"
552 + if use xvmc; then
553 + myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
554 + else
555 + myconf+=" --disable-xvmc"
556 + fi
557 +
558 + ############################
559 + # OSX (aqua) configuration #
560 + ############################
561 + if use aqua; then
562 + myconf+="
563 + --enable-macosx-finder
564 + --enable-macosx-bundle
565 + "
566 + fi
567 +
568 + ./configure \
569 + --cc="$(tc-getCC)" \
570 + --host-cc="$(tc-getBUILD_CC)" \
571 + --prefix="${EPREFIX}/usr" \
572 + --bindir="${EPREFIX}/usr/bin" \
573 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
574 + --confdir="${EPREFIX}/etc/mplayer" \
575 + --datadir="${EPREFIX}/usr/share/mplayer${namesuf}" \
576 + --mandir="${EPREFIX}/usr/share/man" \
577 + --disable-ffmpeg_a \
578 + ${myconf} || die
579 +}
580 +
581 +src_compile() {
582 + base_src_compile
583 + # Build only user-requested docs if they're available.
584 + if use doc ; then
585 + # select available languages from $LINGUAS
586 + local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
587 + local BUILT_DOCS=""
588 + for i in ${LINGUAS} ; do
589 + has ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
590 + done
591 + if [[ -z $BUILT_DOCS ]]; then
592 + emake -j1 html-chunked
593 + else
594 + for i in ${BUILT_DOCS}; do
595 + emake -j1 html-chunked-${i}
596 + done
597 + fi
598 + fi
599 +}
600 +
601 +src_install() {
602 + local i
603 +
604 + emake \
605 + DESTDIR="${D}" \
606 + INSTALLSTRIP="" \
607 + install
608 +
609 + dodoc AUTHORS Changelog Copyright README etc/codecs.conf
610 +
611 + docinto tech/
612 + dodoc DOCS/tech/{*.txt,MAINTAINERS,mpsub.sub,playtree,TODO,wishlist}
613 + docinto TOOLS/
614 + dodoc -r TOOLS
615 + docinto tech/mirrors/
616 + dodoc DOCS/tech/mirrors/*
617 +
618 + if use doc; then
619 + docinto html/
620 + dohtml -r "${S}"/DOCS/HTML/*
621 + fi
622 +
623 + if ! use truetype; then
624 + dodir /usr/share/mplayer/fonts
625 + # Do this generic, as the mplayer people like to change the structure
626 + # of their zips ...
627 + for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
628 + cp -pPR "${i}" "${ED}/usr/share/mplayer/fonts"
629 + done
630 + # Fix the font symlink ...
631 + rm -rf "${ED}/usr/share/mplayer/font"
632 + dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
633 + fi
634 +
635 + insinto /etc/mplayer
636 + newins "${S}/etc/example.conf" mplayer.conf
637 + cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
638 +# Config options can be section specific, global
639 +# options should go in the default section
640 +[default]
641 +_EOF_
642 + doins "${S}/etc/input.conf"
643 + if use osdmenu; then
644 + doins "${S}/etc/menu.conf"
645 + fi
646 +
647 + if use truetype; then
648 + cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
649 +fontconfig=1
650 +subfont-osd-scale=4
651 +subfont-text-scale=3
652 +_EOF_
653 + fi
654 +
655 + # bug 256203
656 + if use rar; then
657 + cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
658 +unrarexec=${EPREFIX}/usr/bin/unrar
659 +_EOF_
660 + fi
661 +
662 + dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
663 + newbin "${S}/TOOLS/midentify.sh" midentify
664 +}
665 +
666 +pkg_preinst() {
667 + [[ -d ${EROOT}/usr/share/mplayer/Skin/default ]] && \
668 + rm -rf "${EROOT}/usr/share/mplayer/Skin/default"
669 +}
670 +
671 +pkg_postrm() {
672 + # Cleanup stale symlinks
673 + [ -L "${EROOT}/usr/share/mplayer/font" -a \
674 + ! -e "${EROOT}/usr/share/mplayer/font" ] && \
675 + rm -f "${EROOT}/usr/share/mplayer/font"
676 +
677 + [ -L "${EROOT}/usr/share/mplayer/subfont.ttf" -a \
678 + ! -e "${EROOT}/usr/share/mplayer/subfont.ttf" ] && \
679 + rm -f "${EROOT}/usr/share/mplayer/subfont.ttf"
680 +}