/[gentoo-x86]/media-video/mplayer/mplayer-1.0_rc4_p20110322-r1.ebuild
Gentoo

Contents of /media-video/mplayer/mplayer-1.0_rc4_p20110322-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (show annotations) (download)
Fri Feb 8 12:55:53 2013 UTC (21 months, 2 weeks ago) by aballier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.12: +1 -1 lines
FILE REMOVED
remove old

(Portage version: 2.2.0_alpha161/cvs/Linux x86_64, signed Manifest commit with key 160F534A)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/mplayer/mplayer-1.0_rc4_p20110322-r1.ebuild,v 1.12 2012/06/17 05:19:59 yngwin Exp $
4
5 EAPI=4
6
7 EGIT_REPO_URI="git://git.libav.org/libav.git"
8 EGIT_PROJECT="ffmpeg"
9 ESVN_REPO_URI="svn://svn.mplayerhq.hu/mplayer/trunk"
10 [[ ${PV} = *9999* ]] && SVN_ECLASS="subversion git" || SVN_ECLASS=""
11
12 inherit toolchain-funcs eutils flag-o-matic multilib base ${SVN_ECLASS}
13
14 # BUMP ME PLZ, NO COOKIES OTHERWISE
15 [[ ${PV} != *9999* ]] && MPLAYER_REVISION=SVN-r33094
16
17 IUSE="3dnow 3dnowext +a52 aalib +alsa altivec aqua bidi bindist bl bluray
18 bs2b cddb +cdio cdparanoia cpudetection custom-cpuopts debug dga +dirac
19 directfb doc +dts +dv dvb +dvd +dvdnav dxr3 +enca +encode +faac +faad fbcon
20 ftp gif ggi gsm +iconv ipv6 jack joystick jpeg jpeg2k kernel_linux ladspa
21 +libass libcaca libmpeg2 lirc +live lzo mad md5sum +mmx mmxext mng +mp3 mpg123
22 nas +network nut openal amr +opengl +osdmenu oss png pnm pulseaudio pvr
23 +quicktime radio +rar +real +rtc rtmp samba +shm +schroedinger sdl +speex
24 sse sse2 ssse3 tga +theora +tremor +truetype +toolame +twolame +unicode
25 v4l vdpau vidix +vorbis vpx win32codecs +X +x264 xanim xinerama +xscreensaver
26 +xv +xvid xvmc zoran"
27 [[ ${PV} == *9999* ]] && IUSE+=" external-ffmpeg"
28
29 VIDEO_CARDS="s3virge mga tdfx vesa"
30 for x in ${VIDEO_CARDS}; do
31 IUSE+=" video_cards_${x}"
32 done
33
34 FONT_URI="
35 mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
36 mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
37 mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2
38 "
39 if [[ ${PV} == *9999* ]]; then
40 RELEASE_URI=""
41 else
42 RELEASE_URI="http://dev.gentoo.org/~scarabeus/${P}.tar.xz
43 mirror://gentoo/${P}.tar.xz"
44 fi
45 SRC_URI="${RELEASE_URI}
46 !truetype? ( ${FONT_URI} )"
47
48 DESCRIPTION="Media Player for Linux"
49 HOMEPAGE="http://www.mplayerhq.hu/"
50
51 FONT_RDEPS="
52 virtual/ttf-fonts
53 media-libs/fontconfig
54 >=media-libs/freetype-2.2.1:2
55 "
56 X_RDEPS="
57 x11-libs/libXext
58 x11-libs/libXxf86vm
59 "
60 [[ ${PV} == *9999* ]] && RDEPEND+=" external-ffmpeg? ( media-video/ffmpeg )"
61 # Rar: althrought -gpl version is nice, it cant do most functions normal rars can
62 # nemesi? ( net-libs/libnemesi )
63 RDEPEND+="
64 sys-libs/ncurses
65 app-arch/bzip2
66 sys-libs/zlib
67 !bindist? (
68 x86? (
69 win32codecs? ( media-libs/win32codecs )
70 )
71 )
72 X? (
73 ${X_RDEPS}
74 dga? ( x11-libs/libXxf86dga )
75 ggi? (
76 media-libs/libggi
77 media-libs/libggiwmh
78 )
79 opengl? ( virtual/opengl )
80 vdpau? ( x11-libs/libvdpau )
81 xinerama? ( x11-libs/libXinerama )
82 xscreensaver? ( x11-libs/libXScrnSaver )
83 xv? (
84 x11-libs/libXv
85 xvmc? ( x11-libs/libXvMC )
86 )
87 )
88 a52? ( media-libs/a52dec )
89 aalib? ( media-libs/aalib )
90 alsa? ( media-libs/alsa-lib )
91 amr? ( !bindist? ( media-libs/opencore-amr ) )
92 bidi? ( dev-libs/fribidi )
93 bluray? ( media-libs/libbluray )
94 bs2b? ( media-libs/libbs2b )
95 cdio? ( dev-libs/libcdio )
96 cdparanoia? ( !cdio? ( media-sound/cdparanoia ) )
97 dirac? ( media-video/dirac )
98 directfb? ( dev-libs/DirectFB )
99 dts? ( media-libs/libdca )
100 dv? ( media-libs/libdv )
101 dvb? ( virtual/linuxtv-dvb-headers )
102 dvd? (
103 >=media-libs/libdvdread-4.1.3
104 dvdnav? ( >=media-libs/libdvdnav-4.1.3 )
105 )
106 encode? (
107 !twolame? ( toolame? ( media-sound/toolame ) )
108 twolame? ( media-sound/twolame )
109 faac? ( !bindist? ( media-libs/faac ) )
110 mp3? ( media-sound/lame )
111 x264? ( >=media-libs/x264-0.0.20100423 )
112 xvid? ( media-libs/xvid )
113 )
114 enca? ( app-i18n/enca )
115 faad? ( media-libs/faad2 )
116 gif? ( media-libs/giflib )
117 gsm? ( media-sound/gsm )
118 iconv? ( virtual/libiconv )
119 jack? ( media-sound/jack-audio-connection-kit )
120 jpeg? ( virtual/jpeg )
121 jpeg2k? ( media-libs/openjpeg )
122 ladspa? ( media-libs/ladspa-sdk )
123 libass? ( ${FONT_RDEPS} >=media-libs/libass-0.9.10[enca?] )
124 libcaca? ( media-libs/libcaca )
125 libmpeg2? ( media-libs/libmpeg2 )
126 lirc? ( app-misc/lirc )
127 live? ( media-plugins/live )
128 lzo? ( >=dev-libs/lzo-2 )
129 mad? ( media-libs/libmad )
130 mng? ( media-libs/libmng )
131 mpg123? ( media-sound/mpg123 )
132 nas? ( media-libs/nas )
133 nut? ( >=media-libs/libnut-661 )
134 openal? ( media-libs/openal )
135 png? ( media-libs/libpng )
136 pnm? ( media-libs/netpbm )
137 pulseaudio? ( media-sound/pulseaudio )
138 rar? (
139 || (
140 app-arch/unrar
141 app-arch/rar
142 )
143 )
144 rtmp? ( media-video/rtmpdump )
145 samba? ( net-fs/samba )
146 schroedinger? ( media-libs/schroedinger )
147 sdl? ( media-libs/libsdl )
148 speex? ( media-libs/speex )
149 theora? ( media-libs/libtheora[encode?] )
150 truetype? ( ${FONT_RDEPS} )
151 vorbis? ( media-libs/libvorbis )
152 vpx? ( media-libs/libvpx )
153 xanim? ( media-video/xanim )
154 "
155
156 X_DEPS="
157 x11-proto/videoproto
158 x11-proto/xf86vidmodeproto
159 "
160 ASM_DEP="dev-lang/yasm"
161 DEPEND="${RDEPEND}
162 virtual/pkgconfig
163 X? (
164 ${X_DEPS}
165 dga? ( x11-proto/xf86dgaproto )
166 dxr3? ( media-video/em8300-libraries )
167 xinerama? ( x11-proto/xineramaproto )
168 xscreensaver? ( x11-proto/scrnsaverproto )
169 )
170 amd64? ( ${ASM_DEP} )
171 doc? (
172 dev-libs/libxslt app-text/docbook-xml-dtd
173 app-text/docbook-xsl-stylesheets
174 )
175 x86? ( ${ASM_DEP} )
176 x86-fbsd? ( ${ASM_DEP} )
177 "
178
179 SLOT="0"
180 LICENSE="GPL-2"
181 if [[ ${PV} != *9999* ]]; then
182 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~x86-solaris"
183 else
184 KEYWORDS=""
185 fi
186
187 # bindist does not cope with amr codecs (#299405#c6), faac codecs are nonfree, win32codecs are nonfree
188 # libcdio support: prefer libcdio over cdparanoia and don't check for cddb w/cdio
189 # dvd navigation requires dvd read support
190 # ass and freetype font require iconv and ass requires freetype fonts
191 # unicode transformations are usefull only with iconv
192 # libvorbis require external tremor to work
193 # radio requires oss or alsa backend
194 # xvmc requires xvideo support
195 REQUIRED_USE="bindist? ( !amr !faac !win32codecs )"
196
197 PATCHES=(
198 "${FILESDIR}"/${P}-gcc46.patch
199 "${FILESDIR}"/${P}-sami_subtitle_parsing.patch
200 )
201
202 pkg_setup() {
203 if [[ ${PV} == *9999* ]]; then
204 elog
205 elog "This is a live ebuild which installs the latest from upstream's"
206 elog "subversion repository, and is unsupported by Gentoo."
207 elog "Everything but bugs in the ebuild itself will be ignored."
208 elog
209 fi
210
211 if use cpudetection; then
212 ewarn
213 ewarn "You've enabled the cpudetection flag. This feature is"
214 ewarn "included mainly for people who want to use the same"
215 ewarn "binary on another system with a different CPU architecture."
216 ewarn "MPlayer will already detect your CPU settings by default at"
217 ewarn "buildtime; this flag is used for runtime detection."
218 ewarn "You won't need this turned on if you are only building"
219 ewarn "mplayer for this system. Also, if your compile fails, try"
220 ewarn "disabling this use flag."
221 fi
222
223 if use custom-cpuopts; then
224 ewarn
225 ewarn "You are using the custom-cpuopts flag which will"
226 ewarn "specifically allow you to enable / disable certain"
227 ewarn "CPU optimizations."
228 ewarn
229 ewarn "Most desktop users won't need this functionality, but it"
230 ewarn "is included for corner cases like cross-compiling and"
231 ewarn "certain profiles. If unsure, disable this flag and MPlayer"
232 ewarn "will automatically detect and use your available CPU"
233 ewarn "optimizations."
234 ewarn
235 ewarn "Using this flag means your build is unsupported, so"
236 ewarn "please make sure your CPU optimization use flags (3dnow"
237 ewarn "3dnowext mmx mmxext sse sse2 ssse3) are properly set."
238 fi
239 }
240
241 src_unpack() {
242 if [[ ${PV} = *9999* ]]; then
243 subversion_src_unpack
244 cd "${WORKDIR}"
245 rm -rf "${WORKDIR}/${P}/ffmpeg/"
246 ( S="${WORKDIR}/${P}/ffmpeg/" git_src_unpack )
247 else
248 unpack ${A}
249 fi
250
251 if ! use truetype; then
252 unpack font-arial-iso-8859-1.tar.bz2 \
253 font-arial-iso-8859-2.tar.bz2 \
254 font-arial-cp1250.tar.bz2
255 fi
256 }
257
258 src_prepare() {
259 if [[ ${PV} = *9999* ]]; then
260 # Set SVN version manually
261 subversion_wc_info
262 sed -i -e "s/UNKNOWN/${ESVN_WC_REVISION}/" "${S}/version.sh" || die
263 else
264 # Set version #
265 sed -i -e "s/UNKNOWN/${MPLAYER_REVISION}/" "${S}/version.sh" || die
266 fi
267
268 # fix path to bash executable in configure scripts
269 sed -i -e "1c\#!${EPREFIX}/bin/bash" configure version.sh || die
270
271 base_src_prepare
272 }
273
274 src_configure() {
275 local myconf=""
276 local uses i
277
278 # set LINGUAS
279 [[ -n $LINGUAS ]] && LINGUAS="${LINGUAS/da/dk}"
280
281 # mplayer ebuild uses "use foo || --disable-foo" to forcibly disable
282 # compilation in almost every situation. The reason for this is
283 # because if --enable is used, it will force the build of that option,
284 # regardless of whether the dependency is available or not.
285
286 ###################
287 #Optional features#
288 ###################
289 # disable svga since we don't want it
290 # disable arts since we don't have kde3
291 # always disable internal ass
292 myconf+="
293 --disable-svga --disable-svgalib_helper
294 --disable-ass-internal
295 --disable-arts
296 --disable-kai
297 $(use_enable network networking)
298 $(use_enable joystick)
299 "
300 uses="bl bluray enca ftp rtc" # nemesi <- not working with in-tree ebuild
301 myconf+=" --disable-nemesi" # nemesi automagic disable
302 for i in ${uses}; do
303 use ${i} || myconf+=" --disable-${i}"
304 done
305 use bidi || myconf+=" --disable-fribidi"
306 use ipv6 || myconf+=" --disable-inet6"
307 use libass || myconf+=" --disable-ass"
308 use nut || myconf+=" --disable-libnut"
309 use rar || myconf+=" --disable-unrarexec"
310 use samba || myconf+=" --disable-smb"
311 if ! use lirc; then
312 myconf+="
313 --disable-lirc
314 --disable-lircc
315 --disable-apple-ir
316 "
317 fi
318
319 # libcdio support: prefer libcdio over cdparanoia
320 # don't check for cddb w/cdio
321 if use cdio; then
322 myconf+=" --disable-cdparanoia"
323 else
324 myconf+=" --disable-libcdio"
325 use cdparanoia || myconf+=" --disable-cdparanoia"
326 use cddb || myconf+=" --disable-cddb"
327 fi
328
329 ################################
330 # DVD read, navigation support #
331 ################################
332 #
333 # dvdread - accessing a DVD
334 # dvdnav - navigation of menus
335 #
336 # use external libdvdcss, dvdread and dvdnav
337 myconf+=" --disable-dvdread-internal --disable-libdvdcss-internal"
338 if use dvd; then
339 use dvdnav || myconf+=" --disable-dvdnav"
340 else
341 myconf+="
342 --disable-dvdnav
343 --disable-dvdread
344 "
345 fi
346
347 #############
348 # Subtitles #
349 #############
350 #
351 # SRT/ASS/SSA (subtitles) requires freetype support
352 # freetype support requires iconv
353 # iconv optionally can use unicode
354 if ! use libass && ! use truetype; then
355 myconf+=" --disable-freetype"
356 if ! use iconv; then
357 myconf+="
358 --disable-iconv
359 --charset=noconv
360 "
361 fi
362 fi
363 use iconv && use unicode && myconf+=" --charset=UTF-8"
364
365 #####################################
366 # DVB / Video4Linux / Radio support #
367 #####################################
368 myconf+=" --disable-tv-bsdbt848"
369 # broken upstream, won't work with recent kernels
370 myconf+=" --disable-ivtv"
371 # gone since linux-headers-2.6.38
372 myconf+=" --disable-tv-v4l1"
373 if { use dvb || use v4l || use pvr || use radio; }; then
374 use dvb || myconf+=" --disable-dvb"
375 use pvr || myconf+=" --disable-pvr"
376 use v4l || myconf+=" --disable-tv-v4l2"
377 if use radio && { use dvb || use v4l; }; then
378 myconf+="
379 --enable-radio
380 $(use_enable encode radio-capture)
381 "
382 else
383 myconf+="
384 --disable-radio-v4l2
385 --disable-radio-bsdbt848
386 "
387 fi
388 else
389 myconf+="
390 --disable-tv
391 --disable-tv-v4l2
392 --disable-radio
393 --disable-radio-v4l2
394 --disable-radio-bsdbt848
395 --disable-dvb
396 --disable-v4l2
397 --disable-pvr"
398 fi
399
400 ##########
401 # Codecs #
402 ##########
403 myconf+=" --disable-musepack" # Use internal musepack codecs for SV7 and SV8 support
404 myconf+=" --disable-libmpeg2-internal" # always use system media-libs/libmpeg2
405 use dirac || myconf+=" --disable-libdirac-lavc"
406 use dts || myconf+=" --disable-libdca"
407 if ! use mp3; then
408 myconf+="
409 --disable-mp3lame
410 --disable-mp3lame-lavc
411 --disable-mp3lib
412 "
413 fi
414 uses="a52 bs2b dv gsm lzo rtmp"
415 for i in ${uses}; do
416 use ${i} || myconf+=" --disable-lib${i}"
417 done
418 use schroedinger || myconf+=" --disable-libschroedinger-lavc"
419 use amr || myconf+=" --disable-libopencore_amrnb --disable-libopencore_amrwb"
420
421 uses="faad gif jpeg libmpeg2 live mad mng mpg123 png pnm speex tga theora xanim"
422 for i in ${uses}; do
423 use ${i} || myconf+=" --disable-${i}"
424 done
425 use jpeg2k || myconf+=" --disable-libopenjpeg"
426 if use vorbis || use tremor; then
427 use tremor || myconf+=" --disable-tremor-internal"
428 use vorbis || myconf+=" --disable-libvorbis"
429 else
430 myconf+="
431 --disable-tremor-internal
432 --disable-tremor
433 --disable-libvorbis
434 "
435 fi
436 use vpx || myconf+=" --disable-libvpx-lavc"
437 # Encoding
438 uses="faac x264 xvid toolame twolame"
439 if use encode; then
440 for i in ${uses}; do
441 use ${i} || myconf+=" --disable-${i}"
442 done
443 use faac || myconf+=" --disable-faac-lavc"
444 if use bindist && use faac; then
445 ewarn "faac is nonfree and cannot be distributed; disabling faac support."
446 myconf+=" --disable-faac --disable-faac-lavc"
447 fi
448 else
449 myconf+=" --disable-mencoder"
450 myconf+=" --disable-faac-lavc"
451 for i in ${uses}; do
452 myconf+=" --disable-${i}"
453 use ${i} && elog "Useflag \"${i}\" require \"encode\" useflag enabled to work."
454 done
455 fi
456
457 #################
458 # Binary codecs #
459 #################
460 # bug 213836
461 if ! use x86 || ! use win32codecs; then
462 use quicktime || myconf+=" --disable-qtx"
463 fi
464
465 ######################
466 # RealPlayer support #
467 ######################
468 # Realplayer support shows up in four places:
469 # - libavcodec (internal)
470 # - win32codecs
471 # - realcodecs (win32codecs libs)
472 # - realcodecs (realplayer libs)
473
474 # internal
475 use real || myconf+=" --disable-real"
476
477 # Real binary codec support only available on x86, amd64
478 if use real; then
479 use x86 && myconf+=" --codecsdir=/opt/RealPlayer/codecs"
480 use amd64 && myconf+=" --codecsdir=/usr/$(get_libdir)/codecs"
481 fi
482 myconf+=" $(use_enable win32codecs win32dll)"
483
484 ################
485 # Video Output #
486 ################
487 uses="directfb md5sum sdl"
488 for i in ${uses}; do
489 use ${i} || myconf+=" --disable-${i}"
490 done
491 use aalib || myconf+=" --disable-aa"
492 use fbcon || myconf+=" --disable-fbdev"
493 use fbcon && use video_cards_s3virge && myconf+=" --enable-s3fb"
494 use libcaca || myconf+=" --disable-caca"
495 use zoran || myconf+=" --disable-zr"
496
497 if ! use kernel_linux || ! use video_cards_mga; then
498 myconf+=" --disable-mga --disable-xmga"
499 fi
500
501 if use video_cards_tdfx; then
502 myconf+="
503 $(use_enable video_cards_tdfx tdfxvid)
504 $(use_enable fbcon tdfxfb)
505 "
506 else
507 myconf+="
508 --disable-3dfx
509 --disable-tdfxvid
510 --disable-tdfxfb
511 "
512 fi
513
514 # sun card, disable by default, see bug #258729
515 myconf+=" --disable-xvr100"
516
517 ################
518 # Audio Output #
519 ################
520 myconf+=" --disable-esd"
521 uses="alsa jack ladspa nas openal"
522 for i in ${uses}; do
523 use ${i} || myconf+=" --disable-${i}"
524 done
525 use pulseaudio || myconf+=" --disable-pulse"
526 if ! use radio; then
527 use oss || myconf+=" --disable-ossaudio"
528 fi
529
530 ####################
531 # Advanced Options #
532 ####################
533 # Platform specific flags, hardcoded on amd64 (see below)
534 use cpudetection && myconf+=" --enable-runtime-cpudetection"
535
536 # Turning off CPU optimizations usually will break the build.
537 # However, this use flag, if enabled, will allow users to completely
538 # specify which ones to use. If disabled, mplayer will automatically
539 # enable all CPU optimizations that the host build supports.
540 if use custom-cpuopts; then
541 uses="3dnow 3dnowext altivec mmx mmxext shm sse sse2 ssse3"
542 for i in ${uses}; do
543 myconf+=" $(use_enable ${i})"
544 done
545 fi
546
547 use debug && myconf+=" --enable-debug=3"
548
549 if use x86 && gcc-specs-pie; then
550 filter-flags -fPIC -fPIE
551 append-ldflags -nopie
552 fi
553
554 is-flag -O? || append-flags -O2
555
556 # workaround bug, x86 just has too few registers, see c.f.
557 # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=402950#44
558 # and 32-bits OSX, bug 329861
559 if [[ ${CHOST} == i?86-* ]] ; then
560 use debug || append-flags -fomit-frame-pointer
561 fi
562
563 ###########################
564 # X enabled configuration #
565 ###########################
566 myconf+=" --disable-gui"
567 if use X; then
568 uses="dxr3 ggi xinerama"
569 for i in ${uses}; do
570 use ${i} || myconf+=" --disable-${i}"
571 done
572 use dga || myconf+=" --disable-dga1 --disable-dga2"
573 use opengl || myconf+=" --disable-gl"
574 use osdmenu && myconf+=" --enable-menu"
575 use vdpau || myconf+=" --disable-vdpau"
576 use video_cards_vesa || myconf+=" --disable-vesa"
577 use vidix || myconf+=" --disable-vidix --disable-vidix-pcidb"
578 use xscreensaver || myconf+=" --disable-xss"
579
580 if use xv; then
581 if use xvmc; then
582 myconf+=" --enable-xvmc --with-xvmclib=XvMCW"
583 else
584 myconf+=" --disable-xvmc"
585 fi
586 else
587 myconf+="
588 --disable-xv
589 --disable-xvmc
590 "
591 use xvmc && elog "Disabling xvmc because it requires \"xv\" useflag enabled."
592 fi
593 else
594 myconf+="
595 --disable-dga1
596 --disable-dga2
597 --disable-dxr3
598 --disable-ggi
599 --disable-gl
600 --disable-vdpau
601 --disable-vidix
602 --disable-vidix-pcidb
603 --disable-xinerama
604 --disable-xss
605 --disable-xv
606 --disable-xvmc
607 --disable-x11
608 "
609 uses="dga dxr3 ggi opengl osdmenu vdpau vidix xinerama xscreensaver xv"
610 for i in ${uses}; do
611 use ${i} && elog "Useflag \"${i}\" require \"X\" useflag enabled to work."
612 done
613 fi
614
615 ############################
616 # OSX (aqua) configuration #
617 ############################
618 if use aqua; then
619 myconf+="
620 --enable-macosx-finder
621 --enable-macosx-bundle
622 "
623 fi
624
625 ###################
626 # External FFmpeg #
627 ###################
628 if [[ ${PV} == *9999* ]]; then
629 use external-ffmpeg && myconf+=" --disable-ffmpeg_a"
630 fi
631
632 myconf="--cc=$(tc-getCC)
633 --host-cc=$(tc-getBUILD_CC)
634 --prefix=${EPREFIX}/usr
635 --bindir=${EPREFIX}/usr/bin
636 --libdir=${EPREFIX}/usr/$(get_libdir)
637 --confdir=${EPREFIX}/etc/mplayer
638 --datadir=${EPREFIX}/usr/share/mplayer${namesuf}
639 --mandir=${EPREFIX}/usr/share/man
640 ${myconf}"
641
642 CFLAGS="${CFLAGS}" ./configure ${myconf} || die
643 }
644
645 src_compile() {
646 base_src_compile
647 # Build only user-requested docs if they're available.
648 if use doc ; then
649 # select available languages from $LINGUAS
650 LINGUAS=${LINGUAS/zh/zh_CN}
651 local ALLOWED_LINGUAS="cs de en es fr hu it pl ru zh_CN"
652 local BUILT_DOCS=""
653 for i in ${LINGUAS} ; do
654 has ${i} ${ALLOWED_LINGUAS} && BUILT_DOCS+=" ${i}"
655 done
656 if [[ -z $BUILT_DOCS ]]; then
657 emake -j1 -C DOCS/xml html-chunked
658 else
659 for i in ${BUILT_DOCS}; do
660 emake -j1 -C DOCS/xml html-chunked-${i}
661 done
662 fi
663 fi
664 }
665
666 src_install() {
667 local i
668
669 emake \
670 DESTDIR="${D}" \
671 INSTALLSTRIP="" \
672 install
673
674 dodoc AUTHORS Changelog Copyright README etc/codecs.conf
675
676 docinto tech/
677 dodoc DOCS/tech/{*.txt,MAINTAINERS,mpsub.sub,playtree,TODO,wishlist}
678 docinto TOOLS/
679 dodoc -r TOOLS
680 if use real; then
681 docinto tech/realcodecs/
682 dodoc DOCS/tech/realcodecs/*
683 fi
684 docinto tech/mirrors/
685 dodoc DOCS/tech/mirrors/*
686
687 if use doc; then
688 docinto html/
689 dohtml -r "${S}"/DOCS/HTML/*
690 fi
691
692 if ! use libass && ! use truetype; then
693 dodir /usr/share/mplayer/fonts
694 # Do this generic, as the mplayer people like to change the structure
695 # of their zips ...
696 for i in $(find "${WORKDIR}/" -type d -name 'font-arial-*'); do
697 cp -pPR "${i}" "${ED}/usr/share/mplayer/fonts"
698 done
699 # Fix the font symlink ...
700 rm -rf "${ED}/usr/share/mplayer/font"
701 dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
702 fi
703
704 insinto /etc/mplayer
705 newins "${S}/etc/example.conf" mplayer.conf
706 cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
707 # Config options can be section specific, global
708 # options should go in the default section
709 [default]
710 _EOF_
711 doins "${S}/etc/input.conf"
712 if use osdmenu; then
713 doins "${S}/etc/menu.conf"
714 fi
715
716 if use libass || use truetype; then
717 cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
718 fontconfig=1
719 subfont-osd-scale=4
720 subfont-text-scale=3
721 _EOF_
722 fi
723
724 # bug 256203
725 if use rar; then
726 cat >> "${ED}/etc/mplayer/mplayer.conf" << _EOF_
727 unrarexec=${EPREFIX}/usr/bin/unrar
728 _EOF_
729 fi
730
731 dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
732 newbin "${S}/TOOLS/midentify.sh" midentify
733 }
734
735 pkg_preinst() {
736 [[ -d ${EROOT}/usr/share/mplayer/Skin/default ]] && \
737 rm -rf "${EROOT}/usr/share/mplayer/Skin/default"
738 }
739
740 pkg_postrm() {
741 # Cleanup stale symlinks
742 [ -L "${EROOT}/usr/share/mplayer/font" -a \
743 ! -e "${EROOT}/usr/share/mplayer/font" ] && \
744 rm -f "${EROOT}/usr/share/mplayer/font"
745
746 [ -L "${EROOT}/usr/share/mplayer/subfont.ttf" -a \
747 ! -e "${EROOT}/usr/share/mplayer/subfont.ttf" ] && \
748 rm -f "${EROOT}/usr/share/mplayer/subfont.ttf"
749 }

  ViewVC Help
Powered by ViewVC 1.1.20