/[gentoo-x86]/media-video/libav/libav-0.8.2-r2.ebuild
Gentoo

Contents of /media-video/libav/libav-0.8.2-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue May 22 16:52:18 2012 UTC (2 years, 2 months ago) by flameeyes
Branch: MAIN
Changes since 1.3: +1 -3 lines
Drop PDEPEND over libpostproc, since the packages using it should depend on it directly.

(Portage version: 2.2.0_alpha107/cvs/Linux x86_64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-0.8.2-r2.ebuild,v 1.3 2012/05/18 00:24:37 ssuominen Exp $
4
5 EAPI=4
6
7 if [[ ${PV} == *9999 ]] ; then
8 SCM="git-2"
9 EGIT_REPO_URI="git://git.libav.org/libav.git"
10 [[ ${PV%9999} != "" ]] && EGIT_BRANCH="release/${PV%.9999}"
11 fi
12
13 inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
14
15 DESCRIPTION="Complete solution to record, convert and stream audio and video."
16 HOMEPAGE="http://libav.org/"
17 if [[ ${PV} == *9999 ]] ; then
18 SRC_URI=""
19 elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot
20 SRC_URI="http://dev.gentoo.org/~lu_zero/libav/${P}.tar.xz"
21 else # Official release
22 SRC_URI="http://${PN}.org/releases/${P}.tar.xz"
23 fi
24
25 SRC_URI+=" test? ( http://dev.gentoo.org/~lu_zero/libav/fate-${PV}.tar.xz )"
26
27 LICENSE="LGPL-2.1 gpl? ( GPL-3 )"
28 SLOT="0"
29 [[ ${PV} == *9999 ]] || KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64
30 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos
31 ~x64-solaris ~x86-solaris"
32 IUSE="+3dnow +3dnowext aac alsa altivec amr bindist +bzip2 cdio cpudetection
33 custom-cflags debug dirac doc +encode faac truetype frei0r +gpl gsm
34 +hardcoded-tables ieee1394 jack jpeg2k +mmx +mmxext mp3 network openssl
35 oss pic pulseaudio +qt-faststart rtmp schroedinger sdl speex ssl +ssse3
36 static-libs test theora threads v4l vaapi vdpau vorbis vpx X x264 xvid
37 +zlib"
38
39 CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext:mmx2
40 neon ssse3 vis"
41
42 for i in ${CPU_FEATURES}; do
43 IUSE+=" ${i%:*}"
44 done
45
46 RDEPEND="
47 !media-video/ffmpeg
48 alsa? ( media-libs/alsa-lib )
49 amr? ( media-libs/opencore-amr )
50 bzip2? ( app-arch/bzip2 )
51 cdio? ( dev-libs/libcdio )
52 dirac? ( media-video/dirac )
53 encode? (
54 aac? ( media-libs/vo-aacenc )
55 amr? ( media-libs/vo-amrwbenc )
56 faac? ( media-libs/faac )
57 mp3? ( >=media-sound/lame-3.98.3 )
58 theora? ( >=media-libs/libtheora-1.1.1[encode] media-libs/libogg )
59 vorbis? ( media-libs/libvorbis media-libs/libogg )
60 x264? ( >=media-libs/x264-0.0.20111017 )
61 xvid? ( >=media-libs/xvid-1.1.0 )
62 )
63 truetype? ( media-libs/freetype:2 )
64 frei0r? ( media-plugins/frei0r-plugins )
65 gsm? ( >=media-sound/gsm-1.0.12-r1 )
66 ieee1394? ( media-libs/libdc1394 sys-libs/libraw1394 )
67 jack? ( media-sound/jack-audio-connection-kit )
68 jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
69 pulseaudio? ( media-sound/pulseaudio )
70 rtmp? ( >=media-video/rtmpdump-2.2f )
71 ssl? ( openssl? ( dev-libs/openssl )
72 !openssl? ( net-libs/gnutls ) )
73 sdl? ( >=media-libs/libsdl-1.2.13-r1[audio,video] )
74 schroedinger? ( media-libs/schroedinger )
75 speex? ( >=media-libs/speex-1.2_beta3 )
76 vaapi? ( x11-libs/libva )
77 vdpau? ( x11-libs/libvdpau )
78 vpx? ( >=media-libs/libvpx-0.9.6 )
79 X? ( x11-libs/libX11 x11-libs/libXext x11-libs/libXfixes )
80 zlib? ( sys-libs/zlib )
81 "
82
83 DEPEND="${RDEPEND}
84 >=sys-devel/make-3.81
85 dirac? ( virtual/pkgconfig )
86 doc? ( app-text/texi2html )
87 mmx? ( dev-lang/yasm )
88 rtmp? ( virtual/pkgconfig )
89 schroedinger? ( virtual/pkgconfig )
90 truetype? ( virtual/pkgconfig )
91 test? ( net-misc/wget )
92 v4l? ( sys-kernel/linux-headers )
93 "
94
95 # faac can't be binary distributed
96 # openssl support marked as nonfree
97 # faac and aac are concurent implementations
98 # amr and aac require at least lgpl3
99 # x264 requires gpl2
100 REQUIRED_USE="bindist? ( !faac !openssl )
101 rtmp? ( network )
102 amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl )
103 test? ( encode )"
104
105 src_prepare() {
106 # if we have snapshot then we need to hardcode the version
107 if [[ ${PV%_p*} != ${PV} ]]; then
108 sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
109 fi
110 }
111
112 src_configure() {
113 local myconf="${EXTRA_LIBAV_CONF}"
114 local uses i
115
116 myconf+="
117 $(use_enable gpl)
118 $(use_enable gpl version3)
119 --enable-avfilter
120 "
121
122 # enabled by default
123 uses="debug doc network zlib"
124 for i in ${uses}; do
125 use ${i} || myconf+=" --disable-${i}"
126 done
127 use bzip2 || myconf+=" --disable-bzlib"
128 use sdl || myconf+=" --disable-avplay"
129
130 if use ssl; then
131 use openssl && myconf+=" --enable-openssl --enable-nonfree" \
132 || myconf+=" --enable-gnutls"
133 fi
134
135 use custom-cflags && myconf+=" --disable-optimizations"
136 use cpudetection && myconf+=" --enable-runtime-cpudetect"
137
138 #for i in h264_vdpau mpeg1_vdpau mpeg_vdpau vc1_vdpau wmv3_vdpau; do
139 # use video_cards_nvidia || myconf="${myconf} --disable-decoder=${i}"
140 # use vdpau || myconf="${myconf} --disable-decoder=${i}"
141 #done
142 use vdpau || myconf+=" --disable-vdpau"
143
144 use vaapi && myconf+=" --enable-vaapi"
145
146 # Encoders
147 if use encode; then
148 use mp3 && myconf+=" --enable-libmp3lame"
149 use amr && myconf+=" --enable-libvo-amrwbenc"
150 use faac && myconf+=" --enable-libfaac --enable-nonfree"
151 use aac && myconf+=" --enable-libvo-aacenc"
152 uses="theora vorbis x264 xvid"
153 for i in ${uses}; do
154 use ${i} && myconf+=" --enable-lib${i}"
155 done
156 else
157 myconf+=" --disable-encoders"
158 fi
159
160 # libavdevice options
161 use cdio && myconf+=" --enable-libcdio"
162 use ieee1394 && myconf+=" --enable-libdc1394"
163 use pulseaudio && myconf+=" --enable-libpulse"
164 # Indevs
165 # v4l1 is gone since linux-headers-2.6.38
166 myconf+=" --disable-indev=v4l"
167 use v4l || myconf+=" --disable-indev=v4l2"
168 for i in alsa oss jack; do
169 use ${i} || myconf+=" --disable-indev=${i}"
170 done
171 use X && myconf+=" --enable-x11grab"
172 # Outdevs
173 for i in alsa oss ; do
174 use ${i} || myconf+=" --disable-outdev=${i}"
175 done
176 # libavfilter options
177 use frei0r && myconf+=" --enable-frei0r"
178 use truetype && myconf+=" --enable-libfreetype"
179
180 # Threads; we only support pthread for now but ffmpeg supports more
181 use threads && myconf+=" --enable-pthreads"
182
183 # Decoders
184 use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb"
185 uses="gsm dirac rtmp schroedinger speex vpx"
186 for i in ${uses}; do
187 use ${i} && myconf+=" --enable-lib${i}"
188 done
189 use jpeg2k && myconf+=" --enable-libopenjpeg"
190
191 # CPU features
192 for i in ${CPU_FEATURES}; do
193 use ${i%:*} || myconf+=" --disable-${i#*:}"
194 done
195
196 # pass the right -mfpu as extra
197 use neon && myconf+=" --extra-cflags=-mfpu=neon"
198
199 # disable mmx accelerated code if PIC is required
200 # as the provided asm decidedly is not PIC for x86.
201 if use pic && use x86 ; then
202 myconf+=" --disable-mmx --disable-mmx2"
203 fi
204
205 # Option to force building pic
206 use pic && myconf+=" --enable-pic"
207
208 # Try to get cpu type based on CFLAGS.
209 # Bug #172723
210 # We need to do this so that features of that CPU will be better used
211 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
212 # will just ignore it.
213 for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
214 [ "${i}" = "native" ] && i="host" # bug #273421
215 [[ ${i} = *-sse3 ]] && i="${i%-sse3}" # bug 283968
216 myconf+=" --cpu=${i}"
217 break
218 done
219
220 # cross compile support
221 if tc-is-cross-compiler ; then
222 myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
223 case ${CHOST} in
224 *freebsd*)
225 myconf+=" --target-os=freebsd"
226 ;;
227 mingw32*)
228 myconf+=" --target-os=mingw32"
229 ;;
230 *linux*)
231 myconf+=" --target-os=linux"
232 ;;
233 esac
234 fi
235
236 # Misc stuff
237 use hardcoded-tables && myconf+=" --enable-hardcoded-tables"
238
239 # Specific workarounds for too-few-registers arch...
240 if [[ $(tc-arch) == "x86" ]]; then
241 filter-flags -fforce-addr -momit-leaf-frame-pointer
242 append-flags -fomit-frame-pointer
243 is-flag -O? || append-flags -O2
244 if use debug; then
245 # no need to warn about debug if not using debug flag
246 ewarn ""
247 ewarn "Debug information will be almost useless as the frame pointer is omitted."
248 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
249 ewarn "difficult to fix. Please have that in mind."
250 ewarn ""
251 fi
252 fi
253
254 cd "${S}"
255 ./configure \
256 --prefix="${EPREFIX}"/usr \
257 --libdir="${EPREFIX}"/usr/$(get_libdir) \
258 --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
259 --mandir="${EPREFIX}"/usr/share/man \
260 --enable-shared \
261 --cc="$(tc-getCC)" \
262 --ar="$(tc-getAR)" \
263 $(use_enable static-libs static) \
264 ${myconf} || die
265 }
266
267 src_compile() {
268 emake
269
270 if use qt-faststart; then
271 tc-export CC
272 emake tools/qt-faststart
273 fi
274 }
275
276 src_install() {
277 emake DESTDIR="${D}" install install-man
278
279 dodoc Changelog README INSTALL
280 dodoc doc/*.txt
281 use doc && dodoc doc/*.html
282
283 if use qt-faststart; then
284 dobin tools/qt-faststart
285 fi
286
287 for i in $(usex sdl avplay "") $(usex network avserver "") avprobe; do
288 dosym ${i} /usr/bin/${i/av/ff}
289 done
290 }
291
292 pkg_postinst() {
293 elog "Please note that the programs formerly known as ffplay, ffserver"
294 elog "and ffprobe are now called avplay, avserver and avprobe."
295 elog
296 elog "ffmpeg had been replaced by the feature incompatible avconv thus"
297 elog "the legacy ffmpeg is provided for compatibility with older scripts"
298 }
299
300 src_test() {
301 LD_LIBRARY_PATH="${S}/libavcore:${S}/libswscale:${S}/libavcodec:${S}/libavdevice:${S}/libavfilter:${S}/libavformat:${S}/libavutil" \
302 emake fate SAMPLES="${WORKDIR}/fate"
303 }

  ViewVC Help
Powered by ViewVC 1.1.20