Gentoo Archives: gentoo-commits

From: "Tomas Chvatal (scarabeus)" <scarabeus@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in media-video/libav: libav-0.8.7.ebuild libav-9.6.ebuild ChangeLog libav-9.5.ebuild
Date: Mon, 20 May 2013 10:48:02
Message-Id: 20130520104757.3A37F2171D@flycatcher.gentoo.org
1 scarabeus 13/05/20 10:47:57
2
3 Modified: ChangeLog
4 Added: libav-0.8.7.ebuild libav-9.6.ebuild
5 Removed: libav-9.5.ebuild
6 Log:
7 Version bump to latest releases. Drop older masked version.
8
9 (Portage version: 2.2.0_alpha174/cvs/Linux x86_64, signed Manifest commit with key 8EEE3BE8)
10
11 Revision Changes Path
12 1.150 media-video/libav/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/ChangeLog?rev=1.150&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/ChangeLog?rev=1.150&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/ChangeLog?r1=1.149&r2=1.150
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/media-video/libav/ChangeLog,v
21 retrieving revision 1.149
22 retrieving revision 1.150
23 diff -u -r1.149 -r1.150
24 --- ChangeLog 22 Apr 2013 20:42:24 -0000 1.149
25 +++ ChangeLog 20 May 2013 10:47:56 -0000 1.150
26 @@ -1,6 +1,13 @@
27 # ChangeLog for media-video/libav
28 # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/media-video/libav/ChangeLog,v 1.149 2013/04/22 20:42:24 lu_zero Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/media-video/libav/ChangeLog,v 1.150 2013/05/20 10:47:56 scarabeus Exp $
31 +
32 +*libav-9.6 (20 May 2013)
33 +*libav-0.8.7 (20 May 2013)
34 +
35 + 20 May 2013; Tomáš Chvátal <scarabeus@g.o> +libav-0.8.7.ebuild,
36 + +libav-9.6.ebuild, -libav-9.5.ebuild:
37 + Version bump to latest releases. Drop older masked version.
38
39 *libav-9.5 (22 Apr 2013)
40
41
42
43
44 1.1 media-video/libav/libav-0.8.7.ebuild
45
46 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/libav-0.8.7.ebuild?rev=1.1&view=markup
47 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/libav-0.8.7.ebuild?rev=1.1&content-type=text/plain
48
49 Index: libav-0.8.7.ebuild
50 ===================================================================
51 # Copyright 1999-2013 Gentoo Foundation
52 # Distributed under the terms of the GNU General Public License v2
53 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-0.8.7.ebuild,v 1.1 2013/05/20 10:47:56 scarabeus Exp $
54
55 EAPI=5
56
57 if [[ ${PV} == *9999 ]] ; then
58 SCM="git-2"
59 EGIT_REPO_URI="git://git.libav.org/libav.git"
60 [[ ${PV%9999} != "" ]] && EGIT_BRANCH="release/${PV%.9999}"
61 fi
62
63 inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
64
65 DESCRIPTION="Complete solution to record, convert and stream audio and video."
66 HOMEPAGE="http://libav.org/"
67 if [[ ${PV} == *9999 ]] ; then
68 SRC_URI=""
69 elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot
70 SRC_URI="http://dev.gentoo.org/~lu_zero/libav/${P}.tar.xz"
71 else # Official release
72 SRC_URI="http://${PN}.org/releases/${P}.tar.xz"
73 fi
74
75 SRC_URI+=" test? ( http://dev.gentoo.org/~lu_zero/libav/fate-0.8.2.tar.xz )"
76
77 LICENSE="LGPL-2.1 gpl? ( GPL-3 )"
78 SLOT="0/0.8"
79 [[ ${PV} == *9999 ]] || KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64
80 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos
81 ~x64-solaris ~x86-solaris"
82 IUSE="+3dnow +3dnowext aac alsa altivec amr bindist +bzip2 cdio cpudetection
83 custom-cflags debug dirac doc +encode faac truetype frei0r +gpl gsm
84 +hardcoded-tables ieee1394 jack jpeg2k +mmx +mmxext mp3 network openssl
85 oss pic pulseaudio +qt-faststart rtmp schroedinger sdl speex ssl +ssse3
86 static-libs test theora threads v4l vaapi vdpau vorbis vpx X x264 xvid
87 +zlib"
88
89 CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext:mmx2
90 neon ssse3 vis"
91
92 for i in ${CPU_FEATURES}; do
93 IUSE+=" ${i%:*}"
94 done
95
96 RDEPEND="
97 !media-video/ffmpeg
98 alsa? ( media-libs/alsa-lib )
99 amr? ( media-libs/opencore-amr )
100 bzip2? ( app-arch/bzip2 )
101 cdio? (
102 || (
103 dev-libs/libcdio-paranoia
104 <dev-libs/libcdio-0.90[-minimal]
105 )
106 )
107 dirac? ( media-video/dirac )
108 encode? (
109 aac? ( media-libs/vo-aacenc )
110 amr? ( media-libs/vo-amrwbenc )
111 faac? ( media-libs/faac )
112 mp3? ( >=media-sound/lame-3.98.3 )
113 theora? ( >=media-libs/libtheora-1.1.1[encode] media-libs/libogg )
114 vorbis? ( media-libs/libvorbis media-libs/libogg )
115 x264? ( >=media-libs/x264-0.0.20111017 )
116 xvid? ( >=media-libs/xvid-1.1.0 )
117 )
118 truetype? ( media-libs/freetype:2 )
119 frei0r? ( media-plugins/frei0r-plugins )
120 gsm? ( >=media-sound/gsm-1.0.12-r1 )
121 ieee1394? ( media-libs/libdc1394 sys-libs/libraw1394 )
122 jack? ( media-sound/jack-audio-connection-kit )
123 jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
124 pulseaudio? ( media-sound/pulseaudio )
125 rtmp? ( >=media-video/rtmpdump-2.2f )
126 ssl? ( openssl? ( dev-libs/openssl )
127 !openssl? ( net-libs/gnutls ) )
128 sdl? ( >=media-libs/libsdl-1.2.13-r1[audio,video] )
129 schroedinger? ( media-libs/schroedinger )
130 speex? ( >=media-libs/speex-1.2_beta3 )
131 vaapi? ( x11-libs/libva )
132 vdpau? ( x11-libs/libvdpau )
133 vpx? ( >=media-libs/libvpx-0.9.6 )
134 X? ( x11-libs/libX11 x11-libs/libXext x11-libs/libXfixes )
135 zlib? ( sys-libs/zlib )
136 "
137
138 DEPEND="${RDEPEND}
139 >=sys-devel/make-3.81
140 dirac? ( virtual/pkgconfig )
141 doc? ( app-text/texi2html )
142 mmx? ( dev-lang/yasm )
143 rtmp? ( virtual/pkgconfig )
144 schroedinger? ( virtual/pkgconfig )
145 truetype? ( virtual/pkgconfig )
146 test? ( net-misc/wget )
147 v4l? ( sys-kernel/linux-headers )
148 "
149
150 # faac can't be binary distributed
151 # openssl support marked as nonfree
152 # faac and aac are concurent implementations
153 # amr and aac require at least lgpl3
154 # x264 requires gpl2
155 REQUIRED_USE="bindist? ( !faac !openssl )
156 rtmp? ( network )
157 amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl ) cdio? ( gpl )
158 test? ( encode )"
159
160 src_prepare() {
161 # if we have snapshot then we need to hardcode the version
162 if [[ ${PV%_p*} != ${PV} ]]; then
163 sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
164 fi
165 }
166
167 src_configure() {
168 local myconf="${EXTRA_LIBAV_CONF}"
169 local uses i
170
171 myconf+="
172 $(use_enable gpl)
173 $(use_enable gpl version3)
174 --enable-avfilter
175 "
176
177 # enabled by default
178 uses="debug doc network zlib"
179 for i in ${uses}; do
180 use ${i} || myconf+=" --disable-${i}"
181 done
182 use bzip2 || myconf+=" --disable-bzlib"
183 use sdl || myconf+=" --disable-avplay"
184
185 if use ssl; then
186 use openssl && myconf+=" --enable-openssl --enable-nonfree" \
187 || myconf+=" --enable-gnutls"
188 fi
189
190 use custom-cflags && myconf+=" --disable-optimizations"
191 use cpudetection && myconf+=" --enable-runtime-cpudetect"
192
193 #for i in h264_vdpau mpeg1_vdpau mpeg_vdpau vc1_vdpau wmv3_vdpau; do
194 # use video_cards_nvidia || myconf="${myconf} --disable-decoder=${i}"
195 # use vdpau || myconf="${myconf} --disable-decoder=${i}"
196 #done
197 use vdpau || myconf+=" --disable-vdpau"
198
199 use vaapi && myconf+=" --enable-vaapi"
200
201 # Encoders
202 if use encode; then
203 use mp3 && myconf+=" --enable-libmp3lame"
204 use amr && myconf+=" --enable-libvo-amrwbenc"
205 use faac && myconf+=" --enable-libfaac --enable-nonfree"
206 use aac && myconf+=" --enable-libvo-aacenc"
207 uses="theora vorbis x264 xvid"
208 for i in ${uses}; do
209 use ${i} && myconf+=" --enable-lib${i}"
210 done
211 else
212 myconf+=" --disable-encoders"
213 fi
214
215 # libavdevice options
216 use cdio && myconf+=" --enable-libcdio"
217 use ieee1394 && myconf+=" --enable-libdc1394"
218 use pulseaudio && myconf+=" --enable-libpulse"
219 # Indevs
220 # v4l1 is gone since linux-headers-2.6.38
221 myconf+=" --disable-indev=v4l"
222 use v4l || myconf+=" --disable-indev=v4l2"
223 for i in alsa oss jack; do
224 use ${i} || myconf+=" --disable-indev=${i}"
225 done
226 use X && myconf+=" --enable-x11grab"
227 # Outdevs
228 for i in alsa oss ; do
229 use ${i} || myconf+=" --disable-outdev=${i}"
230 done
231 # libavfilter options
232 use frei0r && myconf+=" --enable-frei0r"
233 use truetype && myconf+=" --enable-libfreetype"
234
235 # Threads; we only support pthread for now but ffmpeg supports more
236 use threads && myconf+=" --enable-pthreads"
237
238 # Decoders
239 use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb"
240 uses="gsm dirac rtmp schroedinger speex vpx"
241 for i in ${uses}; do
242 use ${i} && myconf+=" --enable-lib${i}"
243 done
244 use jpeg2k && myconf+=" --enable-libopenjpeg"
245
246 # CPU features
247 for i in ${CPU_FEATURES}; do
248 use ${i%:*} || myconf+=" --disable-${i#*:}"
249 done
250
251 # pass the right -mfpu as extra
252 use neon && myconf+=" --extra-cflags=-mfpu=neon"
253
254 # disable mmx accelerated code if PIC is required
255 # as the provided asm decidedly is not PIC for x86.
256 if use pic && use x86 ; then
257 myconf+=" --disable-mmx --disable-mmx2"
258 fi
259
260 # Option to force building pic
261 use pic && myconf+=" --enable-pic"
262
263 # Try to get cpu type based on CFLAGS.
264 # Bug #172723
265 # We need to do this so that features of that CPU will be better used
266 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
267 # will just ignore it.
268 for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
269 [ "${i}" = "native" ] && i="host" # bug #273421
270 [[ ${i} = *-sse3 ]] && i="${i%-sse3}" # bug 283968
271 myconf+=" --cpu=${i}"
272 break
273 done
274
275 # cross compile support
276 if tc-is-cross-compiler ; then
277 myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
278 case ${CHOST} in
279 *freebsd*)
280 myconf+=" --target-os=freebsd"
281 ;;
282 mingw32*)
283 myconf+=" --target-os=mingw32"
284 ;;
285 *linux*)
286 myconf+=" --target-os=linux"
287 ;;
288 esac
289 fi
290
291 # Misc stuff
292 use hardcoded-tables && myconf+=" --enable-hardcoded-tables"
293
294 # Specific workarounds for too-few-registers arch...
295 if [[ $(tc-arch) == "x86" ]]; then
296 filter-flags -fforce-addr -momit-leaf-frame-pointer
297 append-flags -fomit-frame-pointer
298 is-flag -O? || append-flags -O2
299 if use debug; then
300 # no need to warn about debug if not using debug flag
301 ewarn ""
302 ewarn "Debug information will be almost useless as the frame pointer is omitted."
303 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
304 ewarn "difficult to fix. Please have that in mind."
305 ewarn ""
306 fi
307 fi
308
309 cd "${S}"
310 ./configure \
311 --prefix="${EPREFIX}"/usr \
312 --libdir="${EPREFIX}"/usr/$(get_libdir) \
313 --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
314 --mandir="${EPREFIX}"/usr/share/man \
315 --enable-shared \
316 --cc="$(tc-getCC)" \
317 --ar="$(tc-getAR)" \
318 $(use_enable static-libs static) \
319 ${myconf} || die
320
321 MAKEOPTS+=" V=1"
322 }
323
324 src_compile() {
325 emake
326
327 if use qt-faststart; then
328 tc-export CC
329 emake tools/qt-faststart
330 fi
331 }
332
333 src_install() {
334 emake DESTDIR="${D}" install install-man
335
336 dodoc Changelog README INSTALL doc/*.txt
337 use doc && dodoc doc/*.html
338
339 use qt-faststart && dobin tools/qt-faststart
340
341 for i in $(usex sdl avplay "") $(usex network avserver "") avprobe; do
342 dosym ${i} /usr/bin/${i/av/ff}
343 done
344 }
345
346 pkg_postinst() {
347 elog "Please note that the programs formerly known as ffplay, ffserver"
348 elog "and ffprobe are now called avplay, avserver and avprobe."
349 elog
350 elog "ffmpeg had been replaced by the feature incompatible avconv thus"
351 elog "the legacy ffmpeg is provided for compatibility with older scripts"
352 elog "but will be removed in the next version"
353 }
354
355 src_test() {
356 LD_LIBRARY_PATH="${S}/libavcore:${S}/libswscale:${S}/libavcodec:${S}/libavdevice:${S}/libavfilter:${S}/libavformat:${S}/libavutil" \
357 emake fate SAMPLES="${WORKDIR}/fate"
358 }
359
360
361
362 1.1 media-video/libav/libav-9.6.ebuild
363
364 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/libav-9.6.ebuild?rev=1.1&view=markup
365 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/media-video/libav/libav-9.6.ebuild?rev=1.1&content-type=text/plain
366
367 Index: libav-9.6.ebuild
368 ===================================================================
369 # Copyright 1999-2013 Gentoo Foundation
370 # Distributed under the terms of the GNU General Public License v2
371 # $Header: /var/cvsroot/gentoo-x86/media-video/libav/libav-9.6.ebuild,v 1.1 2013/05/20 10:47:56 scarabeus Exp $
372
373 EAPI=5
374
375 if [[ ${PV} == *9999 ]] ; then
376 SCM="git-2"
377 EGIT_REPO_URI="git://git.libav.org/libav.git"
378 [[ ${PV%9999} != "" ]] && EGIT_BRANCH="release/${PV%.9999}"
379 fi
380
381 inherit eutils flag-o-matic multilib toolchain-funcs ${SCM}
382
383 DESCRIPTION="Complete solution to record, convert and stream audio and video."
384 HOMEPAGE="http://libav.org/"
385 if [[ ${PV} == *9999 ]] ; then
386 SRC_URI=""
387 elif [[ ${PV%_p*} != ${PV} ]] ; then # Gentoo snapshot
388 SRC_URI="http://dev.gentoo.org/~lu_zero/libav/${P}.tar.xz"
389 else # Official release
390 SRC_URI="http://${PN}.org/releases/${P}.tar.xz"
391 fi
392
393 SRC_URI+=" test? ( http://dev.gentoo.org/~lu_zero/libav/fate-9.tar.xz )"
394
395 LICENSE="LGPL-2.1 gpl? ( GPL-3 )"
396 SLOT="0/9"
397
398 # Don't move KEYWORDS on the previous line or ekeyword won't work # 399061
399 [[ ${PV} == *9999 ]] || \
400 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
401
402 IUSE="aac alsa amr bindist +bzip2 cdio cpudetection custom-cflags debug doc
403 +encode faac fdk frei0r +gpl gsm +hardcoded-tables ieee1394 jack jpeg2k mp3
404 network openssl opus oss pic pulseaudio rtmp schroedinger sdl speex ssl
405 static-libs test theora threads tools truetype v4l vaapi vdpau vorbis vpx X
406 x264 xvid +zlib"
407
408 # String for CPU features in the useflag[:configure_option] form
409 # if :configure_option isn't set, it will use 'useflag' as configure option
410 CPU_FEATURES="3dnow:amd3dnow 3dnowext:amd3dnowext altivec avx mmx mmxext neon ssse3 vis"
411 for i in ${CPU_FEATURES} ; do
412 IUSE+=" ${i%:*}"
413 done
414
415 TOOLS="aviocat graph2dot ismindex pktdumper qt-faststart trasher"
416
417 RDEPEND="
418 !media-video/ffmpeg
419 alsa? ( media-libs/alsa-lib )
420 amr? ( media-libs/opencore-amr )
421 bzip2? ( app-arch/bzip2 )
422 cdio? (
423 || (
424 dev-libs/libcdio-paranoia
425 <dev-libs/libcdio-0.90[-minimal]
426 )
427 )
428 encode? (
429 aac? ( media-libs/vo-aacenc )
430 amr? ( media-libs/vo-amrwbenc )
431 faac? ( media-libs/faac )
432 fdk? ( media-libs/fdk-aac )
433 mp3? ( >=media-sound/lame-3.98.3 )
434 theora? (
435 >=media-libs/libtheora-1.1.1[encode]
436 media-libs/libogg
437 )
438 vorbis? ( media-libs/libvorbis media-libs/libogg )
439 x264? ( >=media-libs/x264-0.0.20111017 )
440 xvid? ( >=media-libs/xvid-1.1.0 )
441 )
442 frei0r? ( media-plugins/frei0r-plugins )
443 gsm? ( >=media-sound/gsm-1.0.12-r1 )
444 ieee1394? (
445 media-libs/libdc1394
446 sys-libs/libraw1394
447 )
448 jack? ( media-sound/jack-audio-connection-kit )
449 jpeg2k? ( >=media-libs/openjpeg-1.3-r2 )
450 opus? ( media-libs/opus )
451 pulseaudio? ( media-sound/pulseaudio )
452 rtmp? ( >=media-video/rtmpdump-2.2f )
453 ssl? (
454 openssl? ( dev-libs/openssl )
455 !openssl? ( net-libs/gnutls )
456 )
457 sdl? ( >=media-libs/libsdl-1.2.13-r1[audio,video] )
458 schroedinger? ( media-libs/schroedinger )
459 speex? ( >=media-libs/speex-1.2_beta3 )
460 truetype? ( media-libs/freetype:2 )
461 vaapi? ( x11-libs/libva )
462 vdpau? ( x11-libs/libvdpau )
463 vpx? ( >=media-libs/libvpx-0.9.6 )
464 X? (
465 x11-libs/libX11
466 x11-libs/libXext
467 x11-libs/libXfixes
468 )
469 zlib? ( sys-libs/zlib )
470 "
471
472 DEPEND="${RDEPEND}
473 >=sys-devel/make-3.81
474 doc? ( app-text/texi2html )
475 ieee1394? ( virtual/pkgconfig )
476 mmx? ( dev-lang/yasm )
477 rtmp? ( virtual/pkgconfig )
478 schroedinger? ( virtual/pkgconfig )
479 ssl? ( virtual/pkgconfig )
480 test? ( sys-devel/bc )
481 truetype? ( virtual/pkgconfig )
482 v4l? ( sys-kernel/linux-headers )
483 "
484
485 # faac can't be binary distributed
486 # openssl support marked as nonfree
487 # faac and aac are concurent implementations
488 # amr and aac require at least lgpl3
489 # x264 requires gpl2
490 REQUIRED_USE="bindist? ( !faac !openssl !fdk )
491 rtmp? ( network )
492 amr? ( gpl ) aac? ( gpl ) x264? ( gpl ) X? ( gpl ) cdio? ( gpl )
493 test? ( encode zlib )
494 "
495
496 src_prepare() {
497 # if we have snapshot then we need to hardcode the version
498 if [[ ${PV%_p*} != ${PV} ]]; then
499 sed -i -e "s/UNKNOWN/DATE-${PV#*_pre}/" "${S}/version.sh" || die
500 fi
501 }
502
503 src_configure() {
504 local myconf="${EXTRA_LIBAV_CONF}"
505 local uses i
506
507 use zlib && TOOLS+=" cws2fws"
508
509 myconf+="
510 $(use_enable gpl)
511 $(use_enable gpl version3)
512 --enable-avfilter
513 "
514
515 # enabled by default
516 uses="debug doc network zlib"
517 for i in ${uses}; do
518 use ${i} || myconf+=" --disable-${i}"
519 done
520 use bzip2 || myconf+=" --disable-bzlib"
521 use sdl || myconf+=" --disable-avplay"
522
523 if use ssl; then
524 use openssl && myconf+=" --enable-openssl --enable-nonfree" \
525 || myconf+=" --enable-gnutls"
526 fi
527
528 use custom-cflags && myconf+=" --disable-optimizations"
529 use cpudetection && myconf+=" --enable-runtime-cpudetect"
530
531 use vdpau || myconf+=" --disable-vdpau"
532
533 use vaapi && myconf+=" --enable-vaapi"
534
535 # Encoders
536 if use encode; then
537 use faac && myconf+=" --enable-nonfree"
538 use fdk && myconf+=" --enable-nonfree --enable-libfdk-aac"
539 use mp3 && myconf+=" --enable-libmp3lame"
540 use amr && myconf+=" --enable-libvo-amrwbenc"
541 use aac && myconf+=" --enable-libvo-aacenc"
542 uses="faac theora vorbis x264 xvid"
543 for i in ${uses}; do
544 use ${i} && myconf+=" --enable-lib${i}"
545 done
546 else
547 myconf+=" --disable-encoders"
548 fi
549
550 # libavdevice options
551 use cdio && myconf+=" --enable-libcdio"
552 use ieee1394 && myconf+=" --enable-libdc1394"
553 use pulseaudio && myconf+=" --enable-libpulse"
554
555 # Indevs
556 # v4l1 is gone since linux-headers-2.6.38
557 myconf+=" --disable-indev=v4l"
558 use v4l || myconf+=" --disable-indev=v4l2"
559 for i in alsa oss jack; do
560 use ${i} || myconf+=" --disable-indev=${i}"
561 done
562 use X && myconf+=" --enable-x11grab"
563 # Outdevs
564 for i in alsa oss ; do
565 use ${i} || myconf+=" --disable-outdev=${i}"
566 done
567 # libavfilter options
568 use frei0r && myconf+=" --enable-frei0r"
569 use truetype && myconf+=" --enable-libfreetype"
570
571 # Threads; we only support pthread for now
572 use threads && myconf+=" --enable-pthreads"
573
574 # Decoders
575 use amr && myconf+=" --enable-libopencore-amrwb --enable-libopencore-amrnb"
576 uses="gsm opus rtmp schroedinger speex vpx"
577 for i in ${uses}; do
578 use ${i} && myconf+=" --enable-lib${i}"
579 done
580 use jpeg2k && myconf+=" --enable-libopenjpeg"
581
582 # CPU features
583 for i in ${CPU_FEATURES}; do
584 use ${i%:*} || myconf+=" --disable-${i#*:}"
585 done
586
587 # pass the right -mfpu as extra
588 use neon && myconf+=" --extra-cflags=-mfpu=neon"
589
590 # disable mmx accelerated code if PIC is required
591 # as the provided asm decidedly is not PIC for x86.
592 if use pic && use x86 ; then
593 myconf+=" --disable-mmx --disable-mmxext"
594 fi
595
596 # Option to force building pic
597 use pic && myconf+=" --enable-pic"
598
599 # Try to get cpu type based on CFLAGS.
600 # Bug #172723
601 # We need to do this so that features of that CPU will be better used
602 # If they contain an unknown CPU it will not hurt since configure
603 # will just ignore it.
604 for i in $(get-flag march) $(get-flag mcpu) $(get-flag mtune) ; do
605 [[ "${i}" == "native" ]] && i="host" # bug #273421
606 myconf+=" --cpu=${i}"
607 break
608 done
609
610 # cross compile support
611 if tc-is-cross-compiler ; then
612 myconf+=" --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}-"
613 case ${CHOST} in
614 *freebsd*)
615 myconf+=" --target-os=freebsd"
616 ;;
617 mingw32*)
618 myconf+=" --target-os=mingw32"
619 ;;
620 *linux*)
621 myconf+=" --target-os=linux"
622 ;;
623 esac
624 fi
625
626 # Misc stuff
627 use hardcoded-tables && myconf+=" --enable-hardcoded-tables"
628
629 # Specific workarounds for too-few-registers arch...
630 if [[ $(tc-arch) == "x86" ]]; then
631 filter-flags -fforce-addr -momit-leaf-frame-pointer
632 append-flags -fomit-frame-pointer
633 is-flag -O? || append-flags -O2
634 if use debug; then
635 # no need to warn about debug if not using debug flag
636 ewarn ""
637 ewarn "Debug information will be almost useless as the frame pointer is omitted."
638 ewarn "This makes debugging harder, so crashes that has no fixed behavior are"
639 ewarn "difficult to fix. Please have that in mind."
640 ewarn ""
641 fi
642 fi
643
644 cd "${S}"
645 ./configure \
646 --prefix="${EPREFIX}"/usr \
647 --libdir="${EPREFIX}"/usr/$(get_libdir) \
648 --shlibdir="${EPREFIX}"/usr/$(get_libdir) \
649 --mandir="${EPREFIX}"/usr/share/man \
650 --enable-shared \
651 --cc="$(tc-getCC)" \
652 --ar="$(tc-getAR)" \
653 --optflags="${CFLAGS}" \
654 --extra-cflags="${CFLAGS}" \
655 $(use_enable static-libs static) \
656 ${myconf} || die
657
658 MAKEOPTS+=" V=1"
659 }
660
661 src_compile() {
662 local i
663
664 emake
665
666 if use tools; then
667 tc-export CC
668
669 for i in ${TOOLS}; do
670 emake tools/${i}
671 done
672 fi
673 }
674
675 src_install() {
676 local i
677
678 emake DESTDIR="${D}" install install-man
679
680 dodoc Changelog README INSTALL
681 dodoc doc/*.txt
682 use doc && dodoc doc/*.html
683
684 if use tools; then
685 for i in ${TOOLS}; do
686 dobin tools/${i}
687 done
688 fi
689 }
690
691 src_test() {
692 echo ${WORKDIR}/fate
693 LD_LIBRARY_PATH="${S}/libswscale:${S}/libavcodec:${S}/libavdevice:${S}/libavfilter:${S}/libavformat:${S}/libavresample:${S}/libavutil" \
694 emake -j1 fate SAMPLES="${WORKDIR}/fate"
695 }