x11-drivers/nvidia-drivers-190.42: fix to work with x11-base/xorg-server-1.7.1
[otih-overlay.git] / media-video / ffmpeg / ffmpeg-20099999-r1.ebuild
blob8514bd2892eda10f46cc17ae26580455e40c8449
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
5 EAPI=1
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/"
13 LICENSE="GPL-2"
14 SLOT="0"
15 KEYWORDS=""
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 )
23 encode? (
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
33 sys-libs/libraw1394 )
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 )"
42 DEPEND="${RDEPEND}
43 >=sys-devel/make-3.81
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 )"
50 src_compile() {
51 local myconf="${EXTRA_ECONF}"
53 # enabled by default
54 use debug || myconf="${myconf} --disable-debug"
55 use zlib || myconf="${myconf} --disable-zlib"
56 use sdl || myconf="${myconf} --disable-ffplay"
58 if use network; then
59 use ipv6 || myconf="${myconf} --disable-ipv6"
60 else
61 myconf="${myconf} --disable-network"
64 use custom-cflags && myconf="${myconf} --disable-optimizations"
66 # enabled by default
67 if use encode
68 then
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 if use faac; then
108 ewarn "FAAC is considered nonfree by ffmpeg developers and the resulting"
109 ewarn "ffmpeg binary can therefore not be freely redistributed."
110 ewarn "Disabling faac support."
112 else
113 use amr && myconf="${myconf} --enable-libamr-nb \
114 --enable-libamr-wb \
115 --enable-nonfree"
116 use faac && myconf="${myconf} --enable-libfaac --enable-nonfree"
119 # CPU features
120 for i in mmx ssse3 altivec ; do
121 use $i || myconf="${myconf} --disable-$i"
122 done
123 use mmxext || myconf="${myconf} --disable-mmx2"
124 use 3dnow || myconf="${myconf} --disable-amd3dnow"
125 use 3dnowext || myconf="${myconf} --disable-amd3dnowext"
126 # disable mmx accelerated code if PIC is required
127 # as the provided asm decidedly is not PIC.
128 if gcc-specs-pie ; then
129 myconf="${myconf} --disable-mmx --disable-mmx2"
132 # Try to get cpu type based on CFLAGS.
133 # Bug #172723
134 # We need to do this so that features of that CPU will be better used
135 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
136 # will just ignore it.
137 for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
138 myconf="${myconf} --cpu=$i"
139 break
140 done
142 # Mandatory configuration
143 myconf="${myconf} --enable-gpl --enable-postproc \
144 --enable-avfilter --enable-avfilter-lavf \
145 --disable-stripping"
147 # cross compile support
148 tc-is-cross-compiler && myconf="${myconf} --enable-cross-compile --arch=$(tc-arch-kernel)"
150 # Misc stuff
151 use hardcoded-tables && myconf="${myconf} --enable-hardcoded-tables"
153 # Specific workarounds for too-few-registers arch...
154 if [[ $(tc-arch) == "x86" ]]; then
155 filter-flags -fforce-addr -momit-leaf-frame-pointer
156 append-flags -fomit-frame-pointer
157 is-flag -O? || append-flags -O2
158 if (use debug); then
159 # no need to warn about debug if not using debug flag
160 ewarn ""
161 ewarn "Debug information will be almost useless as the frame pointer is omitted."
162 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
163 ewarn "difficult to fix. Please have that in mind."
164 ewarn ""
168 cd "${S}"
169 ./configure \
170 --prefix=/usr \
171 --libdir=/usr/$(get_libdir) \
172 --shlibdir=/usr/$(get_libdir) \
173 --mandir=/usr/share/man \
174 --enable-static --enable-shared \
175 --cc="$(tc-getCC)" \
176 ${myconf} || die "configure failed"
178 emake version.h || die #252269
179 emake || die "make failed"
182 src_install() {
183 emake DESTDIR="${D}" install || die "Install Failed"
185 dodoc Changelog README INSTALL
186 dodoc doc/*
189 # Never die for now...
190 src_test() {
191 for t in codectest libavtest seektest ; do
192 emake ${t} || ewarn "Some tests in ${t} failed"
193 done