QA fixes
[otih-overlay.git] / media-video / ffmpeg / ffmpeg-20099999-r1.ebuild
blob863973c6522e5612eaffdcddc223ea80ac257201
1 # ChangeLog for media-video/ffmpeg
2 # Copyright 2006-2009 Otih Overlay; distributed under the GPL version 2
4 EAPI=1
5 ESVN_REPO_URI="svn://svn.mplayerhq.hu/ffmpeg/trunk"
7 inherit eutils flag-o-matic multilib toolchain-funcs subversion
9 DESCRIPTION="Complete solution to record, convert and stream audio and video"
10 HOMEPAGE="http://ffmpeg.org/"
12 LICENSE="GPL-2"
13 SLOT="0"
14 KEYWORDS=""
15 IUSE="+3dnow +3dnowext +alsa altivec amr custom-cflags debug dirac doc ieee1394
16 +encode +faac +faad gsm ipv6 +mmx +mmxext +vorbis test theora +threads
17 +x264 +xvid network zlib sdl X +mp3 oss schroedinger +hardcoded-tables
18 bindist v4l v4l2 speex +ssse3 jpeg2k"
20 RDEPEND="sdl? ( >=media-libs/libsdl-1.2.10 )
21 alsa? ( media-libs/alsa-lib )
22 encode? (
23 faac? ( media-libs/faac )
24 mp3? ( media-sound/lame )
25 vorbis? ( media-libs/libvorbis media-libs/libogg )
26 theora? ( media-libs/libtheora media-libs/libogg )
27 x264? ( >=media-libs/x264-0.0.20081006 )
28 xvid? ( >=media-libs/xvid-1.1.0 ) )
29 faad? ( >=media-libs/faad2-2.6.1 )
30 zlib? ( sys-libs/zlib )
31 ieee1394? ( media-libs/libdc1394
32 sys-libs/libraw1394 )
33 dirac? ( media-video/dirac )
34 gsm? ( >=media-sound/gsm-1.0.12-r1 )
35 jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
36 schroedinger? ( media-libs/schroedinger )
37 speex? ( >=media-libs/speex-1.2_beta3 )
38 X? ( x11-libs/libX11 x11-libs/libXext )
39 amr? ( media-libs/amrnb media-libs/amrwb )"
41 DEPEND="${RDEPEND}
42 >=sys-devel/make-3.81
43 mmx? ( dev-lang/yasm )
44 doc? ( app-text/texi2html )
45 test? ( net-misc/wget )
46 v4l? ( sys-kernel/linux-headers )
47 v4l2? ( sys-kernel/linux-headers )"
49 src_compile() {
50 local myconf="${EXTRA_ECONF}"
52 # enabled by default
53 use debug || myconf="${myconf} --disable-debug"
54 use zlib || myconf="${myconf} --disable-zlib"
55 use sdl || myconf="${myconf} --disable-ffplay"
57 if use network; then
58 use ipv6 || myconf="${myconf} --disable-ipv6"
59 else
60 myconf="${myconf} --disable-network"
63 use custom-cflags && myconf="${myconf} --disable-optimizations"
65 # enabled by default
66 if use encode
67 then
68 use faac && myconf="${myconf} --enable-libfaac"
69 use mp3 && myconf="${myconf} --enable-libmp3lame"
70 use vorbis && myconf="${myconf} --enable-libvorbis"
71 use theora && myconf="${myconf} --enable-libtheora"
72 use x264 && myconf="${myconf} --enable-libx264"
73 use xvid && myconf="${myconf} --enable-libxvid"
74 else
75 myconf="${myconf} --disable-encoders"
78 # libavdevice options
79 use ieee1394 && myconf="${myconf} --enable-libdc1394"
80 # Demuxers
81 for i in v4l v4l2 alsa oss ; do
82 use $i || myconf="${myconf} --disable-demuxer=$i"
83 done
84 # Muxers
85 for i in alsa oss ; do
86 use $i || myconf="${myconf} --disable-muxer=$i"
87 done
88 use X && myconf="${myconf} --enable-x11grab"
90 # Threads; we only support pthread for now but ffmpeg supports more
91 use threads && myconf="${myconf} --enable-pthreads"
93 # Decoders
94 use faad && myconf="${myconf} --enable-libfaad"
95 use dirac && myconf="${myconf} --enable-libdirac"
96 use schroedinger && myconf="${myconf} --enable-libschroedinger"
97 use speex && myconf="${myconf} --enable-libspeex"
98 use jpeg2k && myconf="${myconf} --enable-libopenjpeg"
99 if use gsm; then
100 myconf="${myconf} --enable-libgsm"
101 # Crappy detection or our installation is weird, pick one (FIXME)
102 append-flags -I/usr/include/gsm
104 if use bindist
105 then
106 use amr && ewarn "libamr is nonfree and cannot be distributed; disabling amr support."
107 else
108 use amr && myconf="${myconf} --enable-libamr-nb \
109 --enable-libamr-wb \
110 --enable-nonfree"
113 # CPU features
114 for i in mmx ssse3 altivec ; do
115 use $i || myconf="${myconf} --disable-$i"
116 done
117 use mmxext || myconf="${myconf} --disable-mmx2"
118 use 3dnow || myconf="${myconf} --disable-amd3dnow"
119 use 3dnowext || myconf="${myconf} --disable-amd3dnowext"
120 # disable mmx accelerated code if PIC is required
121 # as the provided asm decidedly is not PIC.
122 if gcc-specs-pie ; then
123 myconf="${myconf} --disable-mmx --disable-mmx2"
126 # Try to get cpu type based on CFLAGS.
127 # Bug #172723
128 # We need to do this so that features of that CPU will be better used
129 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
130 # will just ignore it.
131 for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
132 myconf="${myconf} --cpu=$i"
133 break
134 done
136 # Mandatory configuration
137 myconf="${myconf} --enable-gpl --enable-postproc \
138 --enable-avfilter --enable-avfilter-lavf \
139 --disable-stripping"
141 # cross compile support
142 tc-is-cross-compiler && myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel)"
144 # Misc stuff
145 use hardcoded-tables && myconf="${myconf} --enable-hardcoded-tables"
147 # Specific workarounds for too-few-registers arch...
148 if [[ $(tc-arch) == "x86" ]]; then
149 filter-flags -fforce-addr -momit-leaf-frame-pointer
150 append-flags -fomit-frame-pointer
151 is-flag -O? || append-flags -O2
152 if (use debug); then
153 # no need to warn about debug if not using debug flag
154 ewarn ""
155 ewarn "Debug information will be almost useless as the frame pointer is omitted."
156 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
157 ewarn "difficult to fix. Please have that in mind."
158 ewarn ""
162 cd "${S}"
163 ./configure \
164 --prefix=/usr \
165 --libdir=/usr/$(get_libdir) \
166 --shlibdir=/usr/$(get_libdir) \
167 --mandir=/usr/share/man \
168 --enable-static --enable-shared \
169 --cc="$(tc-getCC)" \
170 ${myconf} || die "configure failed"
172 emake version.h || die #252269
173 emake || die "make failed"
176 src_install() {
177 emake DESTDIR="${D}" install || die "Install Failed"
179 dodoc Changelog README INSTALL
180 dodoc doc/*
183 # Never die for now...
184 src_test() {
185 for t in codectest libavtest seektest ; do
186 emake ${t} || ewarn "Some tests in ${t} failed"
187 done