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

Contents of /media-video/mplayer/mplayer-1.0_rc2_p27458.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Aug 13 14:22:58 2008 UTC (6 years, 2 months ago) by beandog
Branch: MAIN
Snapshot bump; Re-enable pvr support, bug 230820; Fix dxr3 deps, bug 233542; Fix x264 deps, bug 234287
(Portage version: 2.2_rc7/cvs/Linux 2.6.25-tuxonice-r6 x86_64)

1 # Copyright 1999-2008 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI="1"
6
7 inherit eutils flag-o-matic multilib
8
9 # Ugly hack, feel free to fix
10 MPLAYER_REVISION=27458
11
12 IUSE="3dnow 3dnowext +a52 aac -aalib +alsa altivec amrnb amrwb -arts bidi bl
13 bindist cddb cdio cdparanoia -cpudetection -custom-cflags -custom-cpuopts debug
14 dga doc dts dvb directfb +dvd dv dxr2 dxr3 enca encode esd -fbcon ftp -gif ggi
15 -gtk iconv ipv6 jack joystick -jpeg kernel_linux ladspa -libcaca lirc live lzo
16 +mad -md5sum +mmx mmxext mp2 +mp3 musepack nas nemesi +vorbis opengl
17 openal oss -png -pnm pulseaudio -pvr quicktime radio -rar real rtc -samba sdl
18 speex srt sse sse2 ssse3 svga teletext tga +theora +truetype unicode v4l v4l2 vidix win32codecs +X x264 xanim xinerama +xscreensaver +xv xvid xvmc zoran"
19
20 VIDEO_CARDS="s3virge mga tdfx vesa"
21
22 for x in ${VIDEO_CARDS}; do
23 IUSE="${IUSE} video_cards_${x}"
24 done
25
26 BLUV="1.7"
27 SVGV="1.9.17"
28 AMR_URI="http://www.3gpp.org/ftp/Specs/archive"
29 SRC_URI="mirror://gentoo/${P}.tar.bz2
30 !truetype? ( mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
31 mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
32 mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2 )
33 !iconv? ( mirror://mplayer/releases/fonts/font-arial-iso-8859-1.tar.bz2
34 mirror://mplayer/releases/fonts/font-arial-iso-8859-2.tar.bz2
35 mirror://mplayer/releases/fonts/font-arial-cp1250.tar.bz2 )
36 gtk? ( mirror://mplayer/Skin/Blue-${BLUV}.tar.bz2 )
37 svga? ( http://mplayerhq.hu/~alex/svgalib_helper-${SVGV}-mplayer.tar.bz2 )"
38
39 DESCRIPTION="Media Player for Linux"
40 HOMEPAGE="http://www.mplayerhq.hu/"
41
42 RDEPEND="sys-libs/ncurses
43 !bindist? (
44 x86? (
45 win32codecs? ( media-libs/win32codecs )
46 real? ( media-libs/win32codecs
47 media-video/realplayer )
48 )
49 amd64? ( real? ( media-libs/amd64codecs ) )
50 )
51 aalib? ( media-libs/aalib )
52 alsa? ( media-libs/alsa-lib )
53 amrnb? ( media-libs/amrnb )
54 amrwb? ( media-libs/amrwb )
55 arts? ( kde-base/arts )
56 openal? ( media-libs/openal )
57 bidi? ( dev-libs/fribidi )
58 cdio? ( dev-libs/libcdio )
59 cdparanoia? ( media-sound/cdparanoia )
60 directfb? ( dev-libs/DirectFB )
61 dga? ( x11-libs/libXxf86dga )
62 dts? ( media-libs/libdca )
63 dv? ( media-libs/libdv )
64 dvb? ( media-tv/linuxtv-dvb-headers )
65 encode? (
66 aac? ( media-libs/faac )
67 mp2? ( media-sound/twolame )
68 mp3? ( media-sound/lame )
69 x264? ( >=media-libs/x264-0.0.20080406 )
70 )
71 esd? ( media-sound/esound )
72 enca? ( app-i18n/enca )
73 gif? ( media-libs/giflib )
74 ggi? ( media-libs/libggi
75 media-libs/libggiwmh )
76 gtk? ( media-libs/libpng
77 x11-libs/libXxf86vm
78 x11-libs/libXext
79 x11-libs/libXi
80 =x11-libs/gtk+-2* )
81 jpeg? ( media-libs/jpeg )
82 ladspa? ( media-libs/ladspa-sdk )
83 libcaca? ( media-libs/libcaca )
84 lirc? ( app-misc/lirc )
85 lzo? ( >=dev-libs/lzo-2 )
86 mad? ( media-libs/libmad )
87 musepack? ( >=media-libs/libmpcdec-1.2.2 )
88 nas? ( media-libs/nas )
89 opengl? ( virtual/opengl )
90 png? ( media-libs/libpng )
91 pnm? ( media-libs/netpbm )
92 pulseaudio? ( media-sound/pulseaudio )
93 samba? ( net-fs/samba )
94 sdl? ( media-libs/libsdl )
95 speex? ( >=media-libs/speex-1.1.7 )
96 srt? ( >=media-libs/freetype-2.1
97 media-libs/fontconfig )
98 svga? ( media-libs/svgalib )
99 theora? ( media-libs/libtheora )
100 live? ( >=media-plugins/live-2007.02.20 )
101 truetype? ( >=media-libs/freetype-2.1
102 media-libs/fontconfig )
103 vidix? ( x11-libs/libXxf86vm
104 x11-libs/libXext )
105 xanim? ( media-video/xanim )
106 xinerama? ( x11-libs/libXinerama
107 x11-libs/libXxf86vm
108 x11-libs/libXext )
109 xscreensaver? ( x11-libs/libXScrnSaver )
110 xv? ( x11-libs/libXv
111 x11-libs/libXxf86vm
112 x11-libs/libXext
113 xvmc? ( x11-libs/libXvMC ) )
114 xvid? ( media-libs/xvid )
115 X? ( x11-libs/libXxf86vm
116 x11-libs/libXext
117 )"
118
119 DEPEND="${RDEPEND}
120 doc? ( >=app-text/docbook-sgml-dtd-4.1.2
121 app-text/docbook-xml-dtd
122 >=app-text/docbook-xml-simple-dtd-1.50.0
123 dev-libs/libxslt )
124 dga? ( x11-proto/xf86dgaproto )
125 dxr3? ( media-video/em8300-libraries )
126 xinerama? ( x11-proto/xineramaproto )
127 xv? ( x11-proto/videoproto
128 x11-proto/xf86vidmodeproto )
129 gtk? ( x11-proto/xextproto
130 x11-proto/xf86vidmodeproto )
131 X? ( x11-proto/xextproto
132 x11-proto/xf86vidmodeproto )
133 xscreensaver? ( x11-proto/scrnsaverproto )
134 iconv? ( virtual/libiconv )"
135 # Make sure the assembler USE flags are unmasked on amd64
136 # Remove this once default-linux/amd64/2006.1 is deprecated
137 DEPEND="${DEPEND} amd64? ( >=sys-apps/portage-2.1.2 )
138 mp2? ( >=sys-apps/portage-2.1.2 )"
139
140 SLOT="0"
141 LICENSE="GPL-2"
142 KEYWORDS="~amd64 ~x86"
143
144 pkg_setup() {
145
146 if [[ -n ${LINGUAS} ]]; then
147 elog ""
148 elog "MPlayer's build system uses the LINGUAS variable for both"
149 elog "output messages and which man pages to build. The first"
150 elog "language in the LINGUAS variable will be used to display"
151 elog "output messages. See bug #228799."
152 fi
153
154 if use gtk; then
155 ewarn ""
156 ewarn "You've enabled the 'gtk' use flag which will build"
157 ewarn "GMPlayer, which is no longer actively developed upstream"
158 ewarn "and is not supported by Gentoo. There are alternatives"
159 ewarn "for a GUI frontend: smplayer, gnome-mplayer and kmplayer."
160 fi
161
162 if use cpudetection; then
163 ewarn ""
164 ewarn "You've enabled the cpudetection flag. This feature is"
165 ewarn "included mainly for people who want to use the same"
166 ewarn "binary on another system with a different CPU architecture."
167 ewarn "MPlayer will already detect your CPU settings by default at"
168 ewarn "buildtime; this flag is used for runtime detection."
169 ewarn "You won't need this turned on if you are only building"
170 ewarn "mplayer for this system. Also, if your compile fails, try"
171 ewarn "disabling this use flag."
172 fi
173
174 if use custom-cpuopts; then
175 ewarn ""
176 ewarn "You are using the custom-cpuopts flag which will"
177 ewarn "specifically allow you to enable / disable certain"
178 ewarn "CPU optimizations."
179 ewarn ""
180 ewarn "Most desktop users won't need this functionality, but it"
181 ewarn "is included for corner cases like cross-compiling and"
182 ewarn "certain profiles. If unsure, disable this flag and MPlayer"
183 ewarn "will automatically detect and use your available CPU"
184 ewarn "optimizations."
185 ewarn ""
186 ewarn "Using this flag means your build is unsupported, so"
187 ewarn "please make sure your CPU optimization use flags (3dnow"
188 ewarn "3dnowext mmx mmxext sse sse2 ssse3) are properly set."
189 fi
190 }
191
192 src_unpack() {
193 unpack ${A}
194
195 if ! use truetype ; then
196 unpack font-arial-iso-8859-1.tar.bz2 \
197 font-arial-iso-8859-2.tar.bz2 \
198 font-arial-cp1250.tar.bz2
199 fi
200
201 use gtk && unpack "Blue-${BLUV}.tar.bz2"
202
203 use svga && unpack "svgalib_helper-${SVGV}-mplayer.tar.bz2"
204
205 cd "${S}"
206
207 # Set version #
208 sed -i s/UNKNOWN/${MPLAYER_REVISION}/ "${S}/version.sh"
209
210 # Fix hppa compilation
211 use hppa && sed -i -e "s/-O4/-O1/" "${S}/configure"
212
213 if use svga; then
214 echo
215 einfo "Enabling vidix non-root mode."
216 einfo "(You need a proper svgalib_helper.o module for your kernel"
217 einfo "to actually use this)"
218 echo
219
220 mv "${WORKDIR}/svgalib_helper" "${S}/libdha"
221 fi
222
223 # Fix polish spelling errors
224 [[ -n ${LINGUAS} ]] && sed -e 's:Zarządano:Zażądano:' -i help/help_mp-pl.h
225 }
226
227 src_compile() {
228
229 local myconf=" --disable-tv-bsdbt848 \
230 --disable-faad-external"
231
232 # broken upstream, won't work with recent kernels
233 myconf="${myconf} --disable-ivtv"
234
235 # MPlayer reads in the LINGUAS variable from make.conf, and sets
236 # the languages accordingly. Some will have to be altered to match
237 # upstream's naming scheme.
238 [[ -n $LINGUAS ]] && LINGUAS=${LINGUAS/da/dk}
239
240 ################
241 #Optional features#
242 ###############
243 use bidi || myconf="${myconf} --disable-fribidi"
244 use bl && myconf="${myconf} --enable-bl"
245 use enca || myconf="${myconf} --disable-enca"
246 use ftp || myconf="${myconf} --disable-ftp"
247 use nemesi || myconf="${myconf} --disable-nemesi"
248 use xscreensaver || myconf="${myconf} --disable-xss"
249
250 # libcdio support: prefer libcdio over cdparanoia
251 # don't check for cddb w/cdio
252 if use cdio; then
253 myconf="${myconf} --disable-cdparanoia"
254 else
255 myconf="${myconf} --disable-libcdio"
256 use cdparanoia || myconf="${myconf} --disable-cdparanoia"
257 use cddb || myconf="${myconf} --disable-cddb"
258 fi
259
260 # DVD support
261 # dvdread and libdvdcss are internal libs
262 # http://www.mplayerhq.hu/DOCS/HTML/en/dvd.html
263 # You can optionally use external dvdread support, but against
264 # upstream's suggestion. We don't.
265 if ! use dvd; then
266 myconf="${myconf} --disable-dvdnav --disable-dvdread"
267 use a52 || myconf="${myconf} --disable-liba52"
268 fi
269
270 if use encode; then
271 use aac || myconf="${myconf} --disable-faac --disable-faac-lavc"
272 use dv || myconf="${myconf} --disable-libdv"
273 use mp3 || myconf="${myconf} --disable-mp3lame --disable-mp3lame-lavc"
274 use x264 || myconf="${myconf} --disable-x264 --disable-x264-lavc"
275 use xvid || myconf="${myconf} --disable-xvid --disable-xvid-lavc"
276 else
277 myconf="${myconf} --disable-mencoder --disable-libdv --disable-x264 \
278 --disable-faac"
279 fi
280
281 # SRT (subtitles) requires freetype support
282 # freetype support requires iconv
283 # iconv optionally can use unicode
284 if ! use srt; then
285 myconf="${myconf} --disable-ass"
286 if ! use truetype; then
287 myconf="${myconf} --disable-freetype"
288 if ! use iconv; then
289 myconf="${myconf} --disable-iconv --charset=noconv"
290 fi
291 fi
292 fi
293 use iconv && use unicode && myconf="${myconf} --charset=UTF-8"
294
295 use lirc || myconf="${myconf} --disable-lirc --disable-lircc"
296 myconf="${myconf} $(use_enable joystick)"
297 use ipv6 || myconf="${myconf} --disable-inet6"
298 use rar || myconf="${myconf} --disable-unrarexec"
299 use rtc || myconf="${myconf} --disable-rtc"
300 use samba || myconf="${myconf} --disable-smb"
301
302 # DVB / Video4Linux / Radio support
303 if { use dvb || use v4l || use v4l2 || use pvr || use radio; }; then
304 use dvb || myconf="${myconf} --disable-dvb --disable-dvbhead"
305 use pvr || myconf="${myconf} --disable-pvr"
306 use v4l || myconf="${myconf} --disable-tv-v4l1"
307 use v4l2 || myconf="${myconf} --disable-tv-v4l2"
308 use teletext || myconf="${myconf} --disable-tv-teletext"
309 if use radio && { use dvb || use v4l || use v4l2; }; then
310 myconf="${myconf} --enable-radio $(use_enable encode radio-capture)"
311 else
312 myconf="${myconf} --disable-radio-v4l2 --disable-radio-bsdbt848"
313 fi
314 else
315 myconf="${myconf} --disable-tv --disable-tv-v4l1 --disable-tv-v4l2 \
316 --disable-radio --disable-radio-v4l2 --disable-radio-bsdbt848 \
317 --disable-dvb --disable-dvbhead --disable-tv-teletext \
318 --disable-v4l2 --disable-pvr"
319 fi
320
321 #########
322 # Codecs #
323 ########
324 for x in gif jpeg live mad musepack pnm speex tga theora xanim; do
325 use ${x} || myconf="${myconf} --disable-${x}"
326 done
327 use amrnb || myconf="${myconf} --disable-libamr_nb"
328 use amrwb || myconf="${myconf} --disable-libamr_wb"
329 use dts || myconf="${myconf} --disable-libdca"
330 ! use png && ! use gtk && myconf="${myconf} --disable-png"
331 use lzo || myconf="${myconf} --disable-liblzo"
332 use encode && use mp2 || myconf="${myconf} --disable-twolame \
333 --disable-toolame"
334 use mp3 || myconf="${myconf} --disable-mp3lib"
335 use vorbis || myconf="${myconf} --disable-libvorbis"
336 use xanim && myconf="${myconf} --xanimcodecsdir=/usr/lib/xanim/mods"
337 # Real codec support, only available on x86, amd64
338 if use real && use x86; then
339 myconf="${myconf} --realcodecsdir=/opt/RealPlayer/codecs"
340 elif use real && use amd64; then
341 myconf="${myconf} --realcodecsdir=/usr/$(get_libdir)/codecs"
342 else
343 myconf="${myconf} --disable-real"
344 fi
345 if ! use bindist && ! use real; then
346 myconf="${myconf} $(use_enable win32codecs win32dll)"
347 fi
348 # bug 213836
349 if ! use x86 || ! use win32codecs; then
350 use quicktime || myconf="${myconf} --disable-qtx"
351 fi
352
353 #############
354 # Video Output #
355 #############
356 for x in directfb ggi md5sum sdl xinerama; do
357 use ${x} || myconf="${myconf} --disable-${x}"
358 done
359 use aalib || myconf="${myconf} --disable-aa"
360 use dga || myconf="${myconf} --disable-dga1 --disable-dga2"
361 use fbcon || myconf="${myconf} --disable-fbdev"
362 use fbcon && use video_cards_s3virge && myconf="${myconf} --enable-s3fb"
363 use libcaca || myconf="${myconf} --disable-caca"
364 use opengl || myconf="${myconf} --disable-gl"
365 use video_cards_vesa || myconf="${myconf} --disable-vesa"
366 use vidix || myconf="${myconf} --disable-vidix \
367 --disable-vidix-pcidb"
368 use zoran || myconf="${myconf} --disable-zr"
369
370 # MPlayer incorrectly looks for DXR2/3 support, so forcibly enable
371 # if requested. See bug 223587
372 myconf="${myconf} $(use_enable dxr2) $(use_enable dxr3)"
373
374 # GTK gmplayer gui
375 myconf="${myconf} $(use_enable gtk gui)"
376
377 if use xv; then
378 if use xvmc; then
379 myconf="${myconf} --enable-xvmc --with-xvmclib=XvMCW"
380 else
381 myconf="${myconf} --disable-xvmc"
382 fi
383 else
384 myconf="${myconf} --disable-xv --disable-xvmc"
385 fi
386
387 if ! use kernel_linux && ! use video_cards_mga; then
388 myconf="${myconf} --disable-mga --disable-xmga"
389 fi
390
391 if use video_cards_tdfx; then
392 myconf="${myconf} $(use_enable video_cards_tdfx tdfxvid) \
393 $(use_enable fbcon tdfxfb)"
394 else
395 myconf="${myconf} --disable-3dfx --disable-tdfxvid --disable-tdfxfb"
396 fi
397
398 #############
399 # Audio Output #
400 #############
401 for x in alsa arts esd jack ladspa nas openal; do
402 use ${x} || myconf="${myconf} --disable-${x}"
403 done
404 use pulseaudio || myconf="${myconf} --disable-pulse"
405 if ! use radio; then
406 use oss || myconf="${myconf} --disable-ossaudio"
407 fi
408 #################
409 # Advanced Options #
410 #################
411 # Platform specific flags, hardcoded on amd64 (see below)
412 if use cpudetection || use bindist; then
413 myconf="${myconf} --enable-runtime-cpudetection"
414 fi
415
416 # Turning off CPU optimizations usually will break the build.
417 # However, this use flag, if enabled, will allow users to completely
418 # specify which ones to use. If disabled, mplayer will automatically
419 # enable all CPU optimizations that the host build supports.
420 if use custom-cpuopts; then
421 for x in 3dnow 3dnowext mmx mmxext sse sse2 ssse3; do
422 myconf="${myconf} $(use_enable $x)"
423 done
424 fi
425
426 use debug && myconf="${myconf} --enable-debug=3"
427
428 myconf="${myconf} $(use_enable altivec)"
429
430 if use custom-cflags; then
431 # let's play the filtration game! MPlayer hates on all!
432 strip-flags
433 # ugly optimizations cause MPlayer to cry on x86 systems!
434 if use x86 || use x86-fbsd ; then
435 replace-flags -O* -O2
436 filter-flags -fPIC -fPIE
437
438 use debug || append-flags -fomit-frame-pointer
439 fi
440 append-flags -D__STDC_LIMIT_MACROS
441 else
442 unset CFLAGS CXXFLAGS
443 fi
444
445 myconf="--cc=$(tc-getCC) \
446 --host-cc=$(tc-getBUILD_CC) \
447 --prefix=/usr \
448 --confdir=/etc/mplayer \
449 --datadir=/usr/share/mplayer \
450 --libdir=/usr/$(get_libdir) \
451 --enable-menu \
452 --enable-network \
453 ${myconf}"
454 #echo "CFLAGS=\"${CFLAGS}\" ./configure ${myconf}"
455 CFLAGS="${CFLAGS}" ./configure ${myconf} || die "configure died"
456
457 emake || die "Failed to build MPlayer!"
458 use doc && make -C DOCS/xml html-chunked
459 }
460
461 src_install() {
462
463 make prefix="${D}/usr" \
464 BINDIR="${D}/usr/bin" \
465 LIBDIR="${D}/usr/$(get_libdir)" \
466 CONFDIR="${D}/etc/mplayer" \
467 DATADIR="${D}/usr/share/mplayer" \
468 MANDIR="${D}/usr/share/man" \
469 install || die "Failed to install MPlayer!"
470
471 dodoc AUTHORS Changelog README etc/codecs.conf
472 # Install the documentation; DOCS is all mixed up not just html
473 if use doc ; then
474 find "${S}/DOCS" -type d | xargs -- chmod 0755
475 find "${S}/DOCS" -type f | xargs -- chmod 0644
476 cp -r "${S}/DOCS" "${D}/usr/share/doc/${PF}/" || die "cp docs died"
477 fi
478
479 # Copy misc tools to documentation path, as they're not installed directly
480 # and yes, we are nuking the +x bit.
481 find "${S}/TOOLS" -type d | xargs -- chmod 0755
482 find "${S}/TOOLS" -type f | xargs -- chmod 0644
483 cp -r "${S}/TOOLS" "${D}/usr/share/doc/${PF}/" || die "cp docs died"
484
485 # Install the default Skin and Gnome menu entry
486 if use gtk; then
487 dodir /usr/share/mplayer/skins
488 cp -r "${WORKDIR}/Blue" \
489 "${D}/usr/share/mplayer/skins/default" || die "cp skins died"
490
491 # Fix the symlink
492 rm -rf "${D}/usr/bin/gmplayer"
493 dosym mplayer /usr/bin/gmplayer
494 fi
495
496 if ! use srt && ! use truetype; then
497 dodir /usr/share/mplayer/fonts
498 local x=
499 # Do this generic, as the mplayer people like to change the structure
500 # of their zips ...
501 for x in $(find "${WORKDIR}/" -type d -name 'font-arial-*')
502 do
503 cp -pPR "${x}" "${D}/usr/share/mplayer/fonts"
504 done
505 # Fix the font symlink ...
506 rm -rf "${D}/usr/share/mplayer/font"
507 dosym fonts/font-arial-14-iso-8859-1 /usr/share/mplayer/font
508 fi
509
510 insinto /etc/mplayer
511 newins "${S}/etc/example.conf" mplayer.conf
512
513 if use srt || use truetype; then
514 cat >> "${D}/etc/mplayer/mplayer.conf" << EOT
515 fontconfig=1
516 subfont-osd-scale=4
517 subfont-text-scale=3
518 EOT
519 fi
520
521 dosym ../../../etc/mplayer/mplayer.conf /usr/share/mplayer/mplayer.conf
522
523 dobin "${D}/usr/share/doc/${PF}/TOOLS/midentify"
524
525 insinto /usr/share/mplayer
526 doins "${S}/etc/input.conf"
527 doins "${S}/etc/menu.conf"
528 }
529
530 pkg_preinst() {
531
532 if [[ -d ${ROOT}/usr/share/mplayer/Skin/default ]]
533 then
534 rm -rf "${ROOT}/usr/share/mplayer/Skin/default"
535 fi
536 }
537
538 pkg_postrm() {
539
540 # Cleanup stale symlinks
541 if [ -L "${ROOT}/usr/share/mplayer/font" -a \
542 ! -e "${ROOT}/usr/share/mplayer/font" ]
543 then
544 rm -f "${ROOT}/usr/share/mplayer/font"
545 fi
546
547 if [ -L "${ROOT}/usr/share/mplayer/subfont.ttf" -a \
548 ! -e "${ROOT}/usr/share/mplayer/subfont.ttf" ]
549 then
550 rm -f "${ROOT}/usr/share/mplayer/subfont.ttf"
551 fi
552 }

  ViewVC Help
Powered by ViewVC 1.1.20