1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 ESVN_REPO_URI
="svn://svn.mplayerhq.hu/ffmpeg/trunk"
8 inherit eutils flag-o-matic multilib toolchain-funcs subversion
10 DESCRIPTION
="Complete solution to record, convert and stream audio and video"
11 HOMEPAGE
="http://ffmpeg.org/"
16 IUSE
="+3dnow +3dnowext +alsa altivec amr custom-cflags debug dirac doc ieee1394
17 +encode +faac +faad gsm ipv6 +mmx +mmxext +vorbis test theora +threads
18 +x264 +xvid network zlib sdl X +mp3 oss schroedinger +hardcoded-tables
19 bindist v4l v4l2 speex +ssse3 jpeg2k"
21 RDEPEND
="sdl? ( >=media-libs/libsdl-1.2.10 )
22 alsa? ( media-libs/alsa-lib )
24 faac? ( media-libs/faac )
25 mp3? ( media-sound/lame )
26 vorbis? ( media-libs/libvorbis media-libs/libogg )
27 theora? ( media-libs/libtheora media-libs/libogg )
28 x264? ( >=media-libs/x264-0.0.20081006 )
29 xvid? ( >=media-libs/xvid-1.1.0 ) )
30 faad? ( >=media-libs/faad2-2.6.1 )
31 zlib? ( sys-libs/zlib )
32 ieee1394? ( media-libs/libdc1394
34 dirac? ( media-video/dirac )
35 gsm? ( >=media-sound/gsm-1.0.12-r1 )
36 jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
37 schroedinger? ( media-libs/schroedinger )
38 speex? ( >=media-libs/speex-1.2_beta3 )
39 X? ( x11-libs/libX11 x11-libs/libXext )
40 amr? ( media-libs/amrnb media-libs/amrwb )"
44 mmx? ( dev-lang/yasm )
45 doc? ( app-text/texi2html )
46 test? ( net-misc/wget )
47 v4l? ( sys-kernel/linux-headers )
48 v4l2? ( sys-kernel/linux-headers )"
51 local myconf
="${EXTRA_ECONF}"
54 use debug || myconf
="${myconf} --disable-debug"
55 use zlib || myconf
="${myconf} --disable-zlib"
56 use sdl || myconf
="${myconf} --disable-ffplay"
59 use ipv6 || myconf
="${myconf} --disable-ipv6"
61 myconf
="${myconf} --disable-network"
64 use custom-cflags
&& myconf
="${myconf} --disable-optimizations"
69 use faac
&& myconf
="${myconf} --enable-libfaac"
70 use mp3
&& myconf
="${myconf} --enable-libmp3lame"
71 use vorbis
&& myconf
="${myconf} --enable-libvorbis"
72 use theora
&& myconf
="${myconf} --enable-libtheora"
73 use x264
&& myconf
="${myconf} --enable-libx264"
74 use xvid
&& myconf
="${myconf} --enable-libxvid"
76 myconf
="${myconf} --disable-encoders"
80 use ieee1394
&& myconf
="${myconf} --enable-libdc1394"
82 for i
in v4l v4l2 alsa oss
; do
83 use
$i || myconf
="${myconf} --disable-demuxer=$i"
86 for i
in alsa oss
; do
87 use
$i || myconf
="${myconf} --disable-muxer=$i"
89 use X
&& myconf
="${myconf} --enable-x11grab"
91 # Threads; we only support pthread for now but ffmpeg supports more
92 use threads
&& myconf
="${myconf} --enable-pthreads"
95 use faad
&& myconf
="${myconf} --enable-libfaad"
96 use dirac
&& myconf
="${myconf} --enable-libdirac"
97 use schroedinger
&& myconf
="${myconf} --enable-libschroedinger"
98 use speex
&& myconf
="${myconf} --enable-libspeex"
99 use jpeg2k
&& myconf
="${myconf} --enable-libopenjpeg"
101 myconf
="${myconf} --enable-libgsm"
102 # Crappy detection or our installation is weird, pick one (FIXME)
103 append-flags
-I/usr
/include
/gsm
107 use amr
&& ewarn
"libamr is nonfree and cannot be distributed; disabling amr support."
109 use amr
&& myconf
="${myconf} --enable-libamr-nb \
115 for i
in mmx ssse3 altivec
; do
116 use
$i || myconf
="${myconf} --disable-$i"
118 use mmxext || myconf
="${myconf} --disable-mmx2"
119 use
3dnow || myconf
="${myconf} --disable-amd3dnow"
120 use
3dnowext || myconf
="${myconf} --disable-amd3dnowext"
121 # disable mmx accelerated code if PIC is required
122 # as the provided asm decidedly is not PIC.
123 if gcc-specs-pie
; then
124 myconf
="${myconf} --disable-mmx --disable-mmx2"
127 # Try to get cpu type based on CFLAGS.
129 # We need to do this so that features of that CPU will be better used
130 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
131 # will just ignore it.
132 for i
in $
(get-flag march
) $
(get-flag mcpu
) $
(get-flag mtune
) ; do
133 myconf
="${myconf} --cpu=$i"
137 # Mandatory configuration
138 myconf
="${myconf} --enable-gpl --enable-postproc \
139 --enable-avfilter --enable-avfilter-lavf \
142 # cross compile support
143 tc-is-cross-compiler
&& myconf
="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel)"
146 use hardcoded-tables
&& myconf
="${myconf} --enable-hardcoded-tables"
148 # Specific workarounds for too-few-registers arch...
149 if [[ $
(tc-arch
) == "x86" ]]; then
150 filter-flags
-fforce-addr -momit-leaf-frame-pointer
151 append-flags
-fomit-frame-pointer
152 is-flag
-O? || append-flags
-O2
154 # no need to warn about debug if not using debug flag
156 ewarn
"Debug information will be almost useless as the frame pointer is omitted."
157 ewarn
"This makes debugging harder, so crashes that has no fixed behavior are"
158 ewarn
"difficult to fix. Please have that in mind."
166 --libdir=/usr
/$
(get_libdir
) \
167 --shlibdir=/usr
/$
(get_libdir
) \
168 --mandir=/usr
/share
/man \
169 --enable-static --enable-shared \
171 ${myconf} || die
"configure failed"
173 emake version.h || die
#252269
174 emake || die
"make failed"
178 emake DESTDIR
="${D}" install || die
"Install Failed"
180 dodoc Changelog README INSTALL
184 # Never die for now...
186 for t
in codectest libavtest seektest
; do
187 emake
${t} || ewarn
"Some tests in ${t} failed"