1 |
On 04:22 Wed 10 Oct , Steve Dibb (beandog) wrote: |
2 |
> 1.1 media-video/mplayer/mplayer-1.0_rc2.ebuild |
3 |
> |
4 |
> file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/mplayer/mplayer-1.0_rc2.ebuild?rev=1.1&view=markup |
5 |
> plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/media-video/mplayer/mplayer-1.0_rc2.ebuild?rev=1.1&content-type=text/plain |
6 |
|
7 |
> if use encode; then |
8 |
> use aac || myconf="${myconf} --disable-faac" |
9 |
> use dv || myconf="${myconf} --disable-libdv" |
10 |
> use x264 || myconf="${myconf} --disable-x264" |
11 |
> else |
12 |
> myconf="${myconf} --disable-mencoder --disable-libdv --disable-x264 \ |
13 |
> --disable-faac" |
14 |
> fi |
15 |
|
16 |
This could be: |
17 |
|
18 |
if use encode; then |
19 |
myconf="${myconf} |
20 |
--enable-mencoder |
21 |
$(use_enable aac faac) |
22 |
$(use_enable dv libdv) |
23 |
$(use_enable x264)" |
24 |
fi |
25 |
|
26 |
> use lirc || myconf="${myconf} --disable-lirc --disable-lircc" |
27 |
> myconf="${myconf} $(use_enable joystick)" |
28 |
> use ipv6 || myconf="${myconf} --disable-inet6" |
29 |
> use rar || myconf="${myconf} --disable-unrarlib" |
30 |
> use rtc || myconf="${myconf} --disable-rtc" |
31 |
> use samba || myconf="${myconf} --disable-smb" |
32 |
|
33 |
This could be more use_enable()'s. Does mplayer's build die if you pass |
34 |
a redundant --enable-foo or something? |
35 |
|
36 |
> # DVB / Video4Linux / Radio support |
37 |
> if { use dvb || use v4l || use v4l2 || use radio; }; then |
38 |
> use dvb || myconf="${myconf} --disable-dvb --disable-dvbhead" |
39 |
> use v4l || myconf="${myconf} --disable-tv-v4l1" |
40 |
> use v4l2 || myconf="${myconf} --disable-tv-v4l2" |
41 |
> use teletext || myconf="${myconf} --disable-tv-teletext" |
42 |
> use pvr || myconf="${myconf} --disable-pvr" |
43 |
> if use radio && { use dvb || use v4l || use v4l2; }; then |
44 |
> myconf="${myconf} --enable-radio $(use_enable encode radio-capture)" |
45 |
> else |
46 |
> myconf="${myconf} --disable-radio-v4l2 --disable-radio-bsdbt848" |
47 |
> fi |
48 |
> else |
49 |
> myconf="${myconf} --disable-tv --disable-tv-v4l1 --disable-tv-v4l2 \ |
50 |
> --disable-radio --disable-radio-v4l2 --disable-radio-bsdbt848 \ |
51 |
> --disable-dvb --disable-dvbhead --disable-tv-teletext \ |
52 |
> --disable-pvr" |
53 |
> fi |
54 |
|
55 |
Here's one other way to do this (leaving out myconf etc): |
56 |
|
57 |
$(use_enable dvb) |
58 |
$(use_enable dvb dvbhead) |
59 |
$(use_enable v4l tv-v4l1) |
60 |
$(use_enable v4l2 tv-v4l2) |
61 |
$(use_enable teletext tv-teletext) |
62 |
$(use_enable pvr) |
63 |
if use dvb || use v4l || use v4l2; then |
64 |
$(use_enable radio) |
65 |
$(use_enable radio radio-bsdbt848) |
66 |
$(use_enable radio radio-v4l2) |
67 |
# etc... |
68 |
fi |
69 |
|
70 |
> use aac || myconf="${myconf} --disable-faad-internal" |
71 |
> use amrnb || myconf="${myconf} --disable-libamr_nb" |
72 |
> use amrwb || myconf="${myconf} --disable-libamr_wb" |
73 |
> use dts || myconf="${myconf} --disable-libdca" |
74 |
> ! use png && ! use gtk && myconf="${myconf} --disable-png" |
75 |
> use lzo || myconf="${myconf} --disable-liblzo" |
76 |
> use encode && use mp2 || myconf="${myconf} --disable-twolame \ |
77 |
> --disable-toolame" |
78 |
> use mp3 || myconf="${myconf} --disable-mp3lib" |
79 |
> use quicktime || myconf="${myconf} --disable-qtx" |
80 |
> use vorbis || myconf="${myconf} --disable-libvorbis" |
81 |
> use xanim && myconf="${myconf} --xanimcodecsdir=/usr/lib/xanim/mods" |
82 |
|
83 |
Again, use_enable() would be cleaner in many cases. |
84 |
|
85 |
|
86 |
> use aalib || myconf="${myconf} --disable-aa" |
87 |
> use dga || myconf="${myconf} --disable-dga1 --disable-dga2" |
88 |
> use fbcon || myconf="${myconf} --disable-fbdev" |
89 |
> use fbcon && use video_cards_s3virge && myconf="${myconf} --enable-s3fb" |
90 |
> use libcaca || myconf="${myconf} --disable-caca" |
91 |
> use opengl || myconf="${myconf} --disable-gl" |
92 |
> use video_cards_vesa || myconf="${myconf} --disable-vesa" |
93 |
> use vidix || myconf="${myconf} --disable-vidix-internal \ |
94 |
> --disable-vidix-external" |
95 |
> use zoran || myconf="${myconf} --disable-zr" |
96 |
|
97 |
And again |
98 |
|
99 |
> if use xv; then |
100 |
> if use xvmc; then |
101 |
> myconf="${myconf} --enable-xvmc --with-xvmclib=XvMCW" |
102 |
> else |
103 |
> myconf="${myconf} --disable-xvmc" |
104 |
> fi |
105 |
> else |
106 |
> myconf="${myconf} --disable-xv --disable-xvmc" |
107 |
> fi |
108 |
|
109 |
Something along these lines might do: |
110 |
|
111 |
$(use_enable xv) |
112 |
$(use xv && $(use_enable xvmc)) |
113 |
$(use xv && $(use_with xvmc with-xvmclib XvMCW)) |
114 |
|
115 |
|
116 |
Would this kind of cleanup work? |
117 |
|
118 |
Thanks, |
119 |
Donnie |
120 |
-- |
121 |
gentoo-dev@g.o mailing list |