Lines 1-11
Link Here
|
1 |
# Copyright 1999-2010 Gentoo Foundation |
1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-0.6.ebuild,v 1.1 2010/06/16 10:10:54 aballier Exp $ |
3 |
# $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-9999-r1.ebuild,v 1.37 2010/06/12 21:54:13 spatz Exp $ |
|
|
4 |
|
5 |
EAPI="2" |
4 |
|
6 |
|
5 |
EAPI=2 |
|
|
6 |
SCM="" |
7 |
SCM="" |
7 |
if [ "${PV#9999}" != "${PV}" ] ; then |
8 |
if [[ ${PV} == *9999* ]]; then |
8 |
SCM=subversion |
9 |
SCM="subversion" |
9 |
ESVN_REPO_URI="svn://svn.ffmpeg.org/ffmpeg/trunk" |
10 |
ESVN_REPO_URI="svn://svn.ffmpeg.org/ffmpeg/trunk" |
10 |
fi |
11 |
fi |
11 |
|
12 |
|
Lines 13-19
inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
Link Here
|
13 |
|
14 |
|
14 |
DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec." |
15 |
DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec." |
15 |
HOMEPAGE="http://ffmpeg.org/" |
16 |
HOMEPAGE="http://ffmpeg.org/" |
16 |
if [ "${PV#9999}" != "${PV}" ] ; then |
17 |
if [[ ${PV} == *9999* ]]; then |
17 |
SRC_URI="" |
18 |
SRC_URI="" |
18 |
elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot |
19 |
elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot |
19 |
SRC_URI="mirror://gentoo/${P}.tar.bz2" |
20 |
SRC_URI="mirror://gentoo/${P}.tar.bz2" |
Lines 29-92
if [[ ${PV} == *9999* ]]; then
Link Here
|
29 |
else |
30 |
else |
30 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" |
31 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" |
31 |
fi |
32 |
fi |
32 |
IUSE="+3dnow +3dnowext alsa altivec cpudetection custom-cflags debug dirac |
33 |
IUSE="+3dnow +3dnowext alsa altivec amr bindist +bzip2 cpudetection custom-cflags |
33 |
doc ieee1394 +encode faac faad gsm jack +mmx +mmxext vorbis test |
34 |
debug dirac doc +encode faac faad gsm +hardcoded-tables ieee1394 jack jpeg2k |
34 |
theora threads x264 xvid network zlib sdl X mp3 amr |
35 |
+mmx +mmxext mp3 network oss pic rtmp schroedinger sdl speex +ssse3 static-libs test theora |
35 |
oss pic rtmp schroedinger +hardcoded-tables bindist v4l v4l2 |
36 |
threads +tools v4l v4l2 vaapi vdpau vorbis vpx X x264 xvid +zlib" |
36 |
speex +ssse3 jpeg2k vaapi vdpau vpx" |
|
|
37 |
|
37 |
|
38 |
VIDEO_CARDS="nvidia" |
38 |
VIDEO_CARDS="nvidia" |
39 |
|
39 |
|
40 |
for x in ${VIDEO_CARDS}; do |
40 |
for x in ${VIDEO_CARDS}; do |
41 |
IUSE="${IUSE} video_cards_${x}" |
41 |
IUSE+=" video_cards_${x}" |
42 |
done |
42 |
done |
43 |
|
43 |
|
44 |
RDEPEND="sdl? ( >=media-libs/libsdl-1.2.10 ) |
44 |
RDEPEND=" |
45 |
alsa? ( media-libs/alsa-lib ) |
45 |
alsa? ( media-libs/alsa-lib ) |
|
|
46 |
amr? ( media-libs/opencore-amr ) |
47 |
bzip2? ( app-arch/bzip2 ) |
48 |
dirac? ( media-video/dirac ) |
46 |
encode? ( |
49 |
encode? ( |
47 |
faac? ( media-libs/faac ) |
50 |
faac? ( media-libs/faac ) |
48 |
mp3? ( media-sound/lame ) |
51 |
mp3? ( media-sound/lame ) |
49 |
vorbis? ( media-libs/libvorbis media-libs/libogg ) |
52 |
theora? ( |
50 |
theora? ( >=media-libs/libtheora-1.1.1[encode] media-libs/libogg ) |
53 |
>=media-libs/libtheora-1.1.1[encode] |
|
|
54 |
media-libs/libogg |
55 |
) |
56 |
vorbis? ( |
57 |
media-libs/libvorbis |
58 |
media-libs/libogg |
59 |
) |
51 |
x264? ( >=media-libs/x264-0.0.20100605 ) |
60 |
x264? ( >=media-libs/x264-0.0.20100605 ) |
52 |
xvid? ( >=media-libs/xvid-1.1.0 ) ) |
61 |
xvid? ( >=media-libs/xvid-1.1.0 ) |
|
|
62 |
) |
53 |
faad? ( >=media-libs/faad2-2.6.1 ) |
63 |
faad? ( >=media-libs/faad2-2.6.1 ) |
54 |
zlib? ( sys-libs/zlib ) |
|
|
55 |
ieee1394? ( media-libs/libdc1394 |
56 |
sys-libs/libraw1394 ) |
57 |
dirac? ( media-video/dirac ) |
58 |
gsm? ( >=media-sound/gsm-1.0.12-r1 ) |
64 |
gsm? ( >=media-sound/gsm-1.0.12-r1 ) |
|
|
65 |
ieee1394? ( |
66 |
media-libs/libdc1394 |
67 |
sys-libs/libraw1394 |
68 |
) |
69 |
jack? ( media-sound/jack-audio-connection-kit ) |
59 |
jpeg2k? ( >=media-libs/openjpeg-1.3-r2 ) |
70 |
jpeg2k? ( >=media-libs/openjpeg-1.3-r2 ) |
60 |
amr? ( media-libs/opencore-amr ) |
|
|
61 |
rtmp? ( media-video/rtmpdump ) |
71 |
rtmp? ( media-video/rtmpdump ) |
62 |
schroedinger? ( media-libs/schroedinger ) |
72 |
schroedinger? ( media-libs/schroedinger ) |
63 |
speex? ( >=media-libs/speex-1.2_beta3 ) |
73 |
speex? ( >=media-libs/speex-1.2_beta3 ) |
64 |
jack? ( media-sound/jack-audio-connection-kit ) |
|
|
65 |
X? ( x11-libs/libX11 x11-libs/libXext ) |
66 |
vaapi? ( x11-libs/libva ) |
67 |
vpx? ( media-libs/libvpx ) |
74 |
vpx? ( media-libs/libvpx ) |
68 |
video_cards_nvidia? ( |
75 |
X? ( |
69 |
vdpau? ( x11-libs/libvdpau ) |
76 |
x11-libs/libX11 |
70 |
)" |
77 |
x11-libs/libXext |
|
|
78 |
tools? ( sdl? ( >=media-libs/libsdl-1.2.10[audio,alsa?,oss?,video,X] ) ) |
79 |
vaapi? ( x11-libs/libva[video_cards_nvidia?] ) |
80 |
video_cards_nvidia? ( |
81 |
vdpau? ( x11-libs/libvdpau ) |
82 |
) |
83 |
) |
84 |
zlib? ( sys-libs/zlib ) |
85 |
" |
71 |
|
86 |
|
72 |
DEPEND="${RDEPEND} |
87 |
DEPEND="${RDEPEND} |
73 |
>=sys-devel/make-3.81 |
88 |
>=sys-devel/make-3.81 |
74 |
dirac? ( dev-util/pkgconfig ) |
89 |
dirac? ( dev-util/pkgconfig ) |
|
|
90 |
doc? ( app-text/texi2html ) |
91 |
mmx? ( dev-lang/yasm ) |
75 |
rtmp? ( dev-util/pkgconfig ) |
92 |
rtmp? ( dev-util/pkgconfig ) |
76 |
schroedinger? ( dev-util/pkgconfig ) |
93 |
schroedinger? ( dev-util/pkgconfig ) |
77 |
mmx? ( dev-lang/yasm ) |
|
|
78 |
doc? ( app-text/texi2html ) |
79 |
test? ( net-misc/wget ) |
94 |
test? ( net-misc/wget ) |
80 |
v4l? ( sys-kernel/linux-headers ) |
95 |
v4l? ( sys-kernel/linux-headers ) |
81 |
v4l2? ( sys-kernel/linux-headers )" |
96 |
v4l2? ( sys-kernel/linux-headers ) |
|
|
97 |
" |
82 |
|
98 |
|
83 |
src_prepare() { |
99 |
src_prepare() { |
84 |
if [[ ${PV} = *9999* ]]; then |
100 |
if [[ ${PV} = *9999* ]]; then |
85 |
# Set SVN version manually |
101 |
# Set SVN version manually |
86 |
subversion_wc_info |
102 |
subversion_wc_info |
87 |
sed -i s/UNKNOWN/SVN-r${ESVN_WC_REVISION}/ "${S}/version.sh" |
103 |
sed -i -e "s/UNKNOWN/SVN-r${ESVN_WC_REVISION}/" "${S}/version.sh" || die |
88 |
elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot |
104 |
elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot |
89 |
sed -i s/UNKNOWN/SVN-r${FFMPEG_REVISION}/ "${S}/version.sh" |
105 |
sed -i -e "s/UNKNOWN/SVN-r${FFMPEG_REVISION}/" "${S}/version.sh" || die |
90 |
fi |
106 |
fi |
91 |
} |
107 |
} |
92 |
|
108 |
|
Lines 94-172
src_configure() {
Link Here
|
94 |
local myconf="${EXTRA_FFMPEG_CONF}" |
110 |
local myconf="${EXTRA_FFMPEG_CONF}" |
95 |
|
111 |
|
96 |
# enabled by default |
112 |
# enabled by default |
97 |
use debug || myconf="${myconf} --disable-debug" |
113 |
for i in debug doc zlib network vaapi vdpau; do |
98 |
use zlib || myconf="${myconf} --disable-zlib" |
114 |
use ${i} || myconf+=" --disable-${i}" |
99 |
use sdl || myconf="${myconf} --disable-ffplay" |
115 |
done |
100 |
use network || myconf="${myconf} --disable-network" |
116 |
use bzip2 || myconf+=" --disable-bzlib" |
|
|
117 |
use sdl || myconf+=" --disable-ffplay" |
118 |
use static-libs || myconf+=" --disable-static" |
119 |
use tools || myconf+=" |
120 |
--disable-ffmpeg |
121 |
--disable-ffplay |
122 |
--disable-ffprobe |
123 |
--disable-ffserver |
124 |
" |
125 |
|
126 |
#for i in h264_vdpau mpeg1_vdpau mpeg_vdpau vc1_vdpau wmv3_vdpau; do |
127 |
# use video_cards_nvidia || myconf+=" --disable-decoder=${i}" |
128 |
# use vdpau || myconf+=" --disable-decoder=${i}" |
129 |
#done |
130 |
use video_cards_nvidia || myconf+=" --disable-vdpau" |
101 |
|
131 |
|
102 |
use custom-cflags && myconf="${myconf} --disable-optimizations" |
132 |
use custom-cflags && myconf+=" --disable-optimizations" |
103 |
use cpudetection && myconf="${myconf} --enable-runtime-cpudetect" |
133 |
use cpudetection && myconf+=" --enable-runtime-cpudetect" |
104 |
|
134 |
|
105 |
# enabled by default |
135 |
# enabled by default |
106 |
if use encode |
136 |
if use encode |
107 |
then |
137 |
then |
108 |
use mp3 && myconf="${myconf} --enable-libmp3lame" |
138 |
use mp3 && myconf+=" --enable-libmp3lame" |
109 |
use vorbis && myconf="${myconf} --enable-libvorbis" |
139 |
for i in vorbis theora x264 xvid; do |
110 |
use theora && myconf="${myconf} --enable-libtheora" |
140 |
use ${i} && myconf+=" --enable-lib${i}" |
111 |
use x264 && myconf="${myconf} --enable-libx264" |
141 |
done |
112 |
use xvid && myconf="${myconf} --enable-libxvid" |
|
|
113 |
if use bindist |
142 |
if use bindist |
114 |
then |
143 |
then |
115 |
use faac && ewarn "faac is nonfree and cannot be distributed; |
144 |
use faac && ewarn "faac is nonfree and cannot be distributed; |
116 |
disabling faac support." |
145 |
disabling faac support." |
117 |
else |
146 |
else |
118 |
use faac && myconf="${myconf} --enable-libfaac --enable-nonfree" |
147 |
use faac && myconf+=" --enable-libfaac --enable-nonfree" |
119 |
fi |
148 |
fi |
120 |
else |
149 |
else |
121 |
myconf="${myconf} --disable-encoders" |
150 |
myconf+=" --disable-encoders" |
122 |
fi |
151 |
fi |
123 |
|
152 |
|
124 |
# libavdevice options |
153 |
# libavdevice options |
125 |
use ieee1394 && myconf="${myconf} --enable-libdc1394" |
154 |
use ieee1394 && myconf+=" --enable-libdc1394" |
126 |
# Indevs |
155 |
# Indevs |
127 |
for i in v4l v4l2 alsa oss jack ; do |
156 |
for i in v4l v4l2 alsa oss jack ; do |
128 |
use $i || myconf="${myconf} --disable-indev=$i" |
157 |
use ${i} || myconf+=" --disable-indev=${i}" |
129 |
done |
158 |
done |
130 |
# Outdevs |
159 |
# Outdevs |
131 |
for i in alsa oss ; do |
160 |
for i in alsa oss ; do |
132 |
use $i || myconf="${myconf} --disable-outdev=$i" |
161 |
use ${i} || myconf+=" --disable-outdev=${i}" |
133 |
done |
162 |
done |
134 |
use X && myconf="${myconf} --enable-x11grab" |
163 |
use X && myconf+=" --enable-x11grab" |
135 |
|
164 |
|
136 |
# Threads; we only support pthread for now but ffmpeg supports more |
165 |
# Threads; we only support pthread for now but ffmpeg supports more |
137 |
use threads && myconf="${myconf} --enable-pthreads" |
166 |
use threads && myconf+=" --enable-pthreads" |
138 |
|
167 |
|
139 |
# Decoders |
168 |
# Decoders |
140 |
use amr && myconf="${myconf} --enable-libopencore-amrwb |
169 |
use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb" |
141 |
--enable-libopencore-amrnb" |
|
|
142 |
for i in gsm faad dirac rtmp schroedinger speex vpx; do |
170 |
for i in gsm faad dirac rtmp schroedinger speex vpx; do |
143 |
use $i && myconf="${myconf} --enable-lib$i" |
171 |
use ${i} && myconf+=" --enable-lib${i}" |
144 |
done |
172 |
done |
145 |
use jpeg2k && myconf="${myconf} --enable-libopenjpeg" |
173 |
use jpeg2k && myconf+=" --enable-libopenjpeg" |
146 |
|
|
|
147 |
#for i in h264_vdpau mpeg1_vdpau mpeg_vdpau vc1_vdpau wmv3_vdpau; do |
148 |
# use video_cards_nvidia || myconf="${myconf} --disable-decoder=$i" |
149 |
# use vdpau || myconf="${myconf} --disable-decoder=$i" |
150 |
#done |
151 |
use video_cards_nvidia || myconf="${myconf} --disable-vdpau" |
152 |
use vdpau || myconf="${myconf} --disable-vdpau" |
153 |
use vaapi || myconf="${myconf} --disable-vaapi" |
154 |
|
174 |
|
155 |
# CPU features |
175 |
# CPU features |
156 |
for i in mmx ssse3 altivec ; do |
176 |
for i in mmx ssse3 altivec ; do |
157 |
use $i || myconf="${myconf} --disable-$i" |
177 |
use ${i} || myconf+=" --disable-${i}" |
158 |
done |
178 |
done |
159 |
use mmxext || myconf="${myconf} --disable-mmx2" |
179 |
use mmxext || myconf+=" --disable-mmx2" |
160 |
use 3dnow || myconf="${myconf} --disable-amd3dnow" |
180 |
use 3dnow || myconf+=" --disable-amd3dnow" |
161 |
use 3dnowext || myconf="${myconf} --disable-amd3dnowext" |
181 |
use 3dnowext || myconf+=" --disable-amd3dnowext" |
162 |
# disable mmx accelerated code if PIC is required |
182 |
# disable mmx accelerated code if PIC is required |
163 |
# as the provided asm decidedly is not PIC. |
183 |
# as the provided asm decidedly is not PIC. |
164 |
if gcc-specs-pie ; then |
184 |
if gcc-specs-pie ; then |
165 |
myconf="${myconf} --disable-mmx --disable-mmx2" |
185 |
myconf+=" --disable-mmx --disable-mmx2" |
166 |
fi |
186 |
fi |
167 |
|
187 |
|
168 |
# Option to force building pic |
188 |
# Option to force building pic |
169 |
use pic && myconf="${myconf} --enable-pic" |
189 |
use pic && myconf+=" --enable-pic" |
170 |
|
190 |
|
171 |
# Try to get cpu type based on CFLAGS. |
191 |
# Try to get cpu type based on CFLAGS. |
172 |
# Bug #172723 |
192 |
# Bug #172723 |
Lines 176-209
src_configure() {
Link Here
|
176 |
for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do |
196 |
for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do |
177 |
[ "${i}" = "native" ] && i="host" # bug #273421 |
197 |
[ "${i}" = "native" ] && i="host" # bug #273421 |
178 |
[[ ${i} = *-sse3 ]] && i="${i%-sse3}" # bug 283968 |
198 |
[[ ${i} = *-sse3 ]] && i="${i%-sse3}" # bug 283968 |
179 |
myconf="${myconf} --cpu=$i" |
199 |
myconf+=" --cpu=${i}" |
180 |
break |
200 |
break |
181 |
done |
201 |
done |
182 |
|
202 |
|
183 |
# Mandatory configuration |
203 |
# Mandatory configuration |
184 |
myconf="${myconf} --enable-gpl --enable-version3 --enable-postproc \ |
204 |
myconf+=" |
185 |
--enable-avfilter --enable-avfilter-lavf \ |
205 |
--enable-gpl |
186 |
--disable-stripping" |
206 |
--enable-version3 |
|
|
207 |
--enable-postproc |
208 |
--enable-avfilter |
209 |
--enable-avfilter-lavf |
210 |
--disable-stripping |
211 |
" |
187 |
|
212 |
|
188 |
# cross compile support |
213 |
# cross compile support |
189 |
if tc-is-cross-compiler ; then |
214 |
if tc-is-cross-compiler ; then |
190 |
myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-" |
215 |
myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-" |
191 |
case ${CHOST} in |
216 |
case ${CHOST} in |
192 |
*freebsd*) |
217 |
*freebsd*) |
193 |
myconf="${myconf} --target-os=freebsd" |
218 |
myconf+=" --target-os=freebsd" |
194 |
;; |
219 |
;; |
195 |
mingw32*) |
220 |
mingw32*) |
196 |
myconf="${myconf} --target-os=mingw32" |
221 |
myconf+=" --target-os=mingw32" |
197 |
;; |
222 |
;; |
198 |
*linux*) |
223 |
*linux*) |
199 |
myconf="${myconf} --target-os=linux" |
224 |
myconf+=" --target-os=linux" |
200 |
;; |
225 |
;; |
201 |
esac |
226 |
esac |
202 |
fi |
227 |
fi |
203 |
|
228 |
|
204 |
# Misc stuff |
229 |
# Misc stuff |
205 |
use hardcoded-tables && myconf="${myconf} --enable-hardcoded-tables" |
230 |
use hardcoded-tables && myconf+=" --enable-hardcoded-tables" |
206 |
use doc || myconf="${myconf} --disable-doc" |
|
|
207 |
|
231 |
|
208 |
# Specific workarounds for too-few-registers arch... |
232 |
# Specific workarounds for too-few-registers arch... |
209 |
if [[ $(tc-arch) == "x86" ]]; then |
233 |
if [[ $(tc-arch) == "x86" ]]; then |
Lines 220-234
src_configure() {
Link Here
|
220 |
fi |
244 |
fi |
221 |
fi |
245 |
fi |
222 |
|
246 |
|
223 |
cd "${S}" |
247 |
myconf+=" |
224 |
./configure \ |
248 |
--prefix=/usr |
225 |
--prefix=/usr \ |
249 |
--libdir=/usr/$(get_libdir) |
226 |
--libdir=/usr/$(get_libdir) \ |
250 |
--shlibdir=/usr/$(get_libdir) |
227 |
--shlibdir=/usr/$(get_libdir) \ |
251 |
--mandir=/usr/share/man |
228 |
--mandir=/usr/share/man \ |
252 |
--enable-shared |
229 |
--enable-static --enable-shared \ |
253 |
--cc=$(tc-getCC) |
230 |
--cc="$(tc-getCC)" \ |
254 |
" |
231 |
${myconf} || die "configure failed" |
255 |
./configure ${myconf} || die "configure failed" |
232 |
} |
256 |
} |
233 |
|
257 |
|
234 |
src_compile() { |
258 |
src_compile() { |
Lines 237-243
src_compile() {
Link Here
|
237 |
} |
261 |
} |
238 |
|
262 |
|
239 |
src_install() { |
263 |
src_install() { |
240 |
emake DESTDIR="${D}" install install-man || die "Install Failed" |
264 |
use tools && Tman+="install-man" || Tman="" |
|
|
265 |
emake DESTDIR="${D}" install ${Tman} || die "emake install failed" |
266 |
|
267 |
# until fixed upstream |
268 |
if use tools && { use !encode || use !x264; } ; then |
269 |
rm -f "${D}"/usr/share/ffmpeg/libx264*.ffpreset |
270 |
rmdir "${D}"/usr/share/ffmpeg |
271 |
fi |
241 |
|
272 |
|
242 |
dodoc Changelog README INSTALL |
273 |
dodoc Changelog README INSTALL |
243 |
dodoc doc/* |
274 |
dodoc doc/* |