/[gentoo-x86]/media-video/ffmpeg/ffmpeg-2.6.4.ebuild
Gentoo

Contents of /media-video/ffmpeg/ffmpeg-2.6.4.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Jul 30 09:59:35 2015 UTC (2 years, 11 months ago) by aballier
Branch: MAIN
CVS Tags: HEAD
bump the 2.6 branch

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 160F534A)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/media-video/ffmpeg/ffmpeg-2.6.3.ebuild,v 1.9 2015/07/23 20:14:08 pacho Exp $
4
5 EAPI="5"
6
7 # Subslot: libavutil major.libavcodec major.libavformat major
8 # Since FFmpeg ships several libraries, subslot is kind of limited here.
9 # Most consumers will use those three libraries, if a "less used" library
10 # changes its soname, consumers will have to be rebuilt the old way
11 # (preserve-libs).
12 # If, for example, a package does not link to libavformat and only libavformat
13 # changes its ABI then this package will be rebuilt needlessly. Hence, such a
14 # package is free _not_ to := depend on FFmpeg but I would strongly encourage
15 # doing so since such a case is unlikely.
16 FFMPEG_SUBSLOT=54.56.56
17
18 SCM=""
19 if [ "${PV#9999}" != "${PV}" ] ; then
20 SCM="git-2"
21 EGIT_REPO_URI="git://source.ffmpeg.org/ffmpeg.git"
22 fi
23
24 inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
25
26 DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec"
27 HOMEPAGE="http://ffmpeg.org/"
28 if [ "${PV#9999}" != "${PV}" ] ; then
29 SRC_URI=""
30 elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
31 SRC_URI="mirror://gentoo/${P}.tar.bz2"
32 else # Release
33 SRC_URI="http://ffmpeg.org/releases/${P/_/-}.tar.bz2"
34 fi
35 FFMPEG_REVISION="${PV#*_p}"
36
37 SLOT="0/${FFMPEG_SUBSLOT}"
38 LICENSE="
39 !gpl? ( LGPL-2.1 )
40 gpl? ( GPL-2 )
41 amr? (
42 gpl? ( GPL-3 )
43 !gpl? ( LGPL-3 )
44 )
45 encode? (
46 aac? (
47 gpl? ( GPL-3 )
48 !gpl? ( LGPL-3 )
49 )
50 amrenc? (
51 gpl? ( GPL-3 )
52 !gpl? ( LGPL-3 )
53 )
54 )
55 samba? ( GPL-3 )
56 "
57 if [ "${PV#9999}" = "${PV}" ] ; then
58 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
59 fi
60
61 # Options to use as use_enable in the foo[:bar] form.
62 # This will feed configure with $(use_enable foo bar)
63 # or $(use_enable foo foo) if no :bar is set.
64 # foo is added to IUSE.
65 FFMPEG_FLAG_MAP=(
66 +bzip2:bzlib cpudetection:runtime-cpudetect debug doc gnutls +gpl
67 +hardcoded-tables +iconv lzma +network openssl +postproc
68 samba:libsmbclient sdl:ffplay vaapi vdpau X:xlib xcb:libxcb
69 xcb:libxcb-shm xcb:libxcb-xfixes +zlib
70 # libavdevice options
71 cdio:libcdio iec61883:libiec61883 ieee1394:libdc1394 libcaca openal
72 opengl
73 # indevs
74 libv4l:libv4l2 pulseaudio:libpulse
75 # decoders
76 amr:libopencore-amrwb amr:libopencore-amrnb fdk:libfdk-aac
77 jpeg2k:libopenjpeg bluray:libbluray celt:libcelt gme:libgme gsm:libgsm
78 modplug:libmodplug opus:libopus quvi:libquvi rtmp:librtmp ssh:libssh
79 schroedinger:libschroedinger speex:libspeex vorbis:libvorbis vpx:libvpx
80 zvbi:libzvbi
81 # libavfilter options
82 bs2b:libbs2b flite:libflite frei0r fribidi:libfribidi fontconfig ladspa
83 libass truetype:libfreetype
84 # libswresample options
85 libsoxr
86 # Threads; we only support pthread for now but ffmpeg supports more
87 +threads:pthreads
88 )
89
90 # Same as above but for encoders, i.e. they do something only with USE=encode.
91 FFMPEG_ENCODER_FLAG_MAP=(
92 aac:libvo-aacenc amrenc:libvo-amrwbenc mp3:libmp3lame
93 aacplus:libaacplus faac:libfaac theora:libtheora twolame:libtwolame
94 wavpack:libwavpack webp:libwebp x264:libx264 x265:libx265 xvid:libxvid
95 )
96
97 IUSE="
98 alsa +encode examples jack oss pic static-libs test v4l
99 ${FFMPEG_FLAG_MAP[@]%:*}
100 ${FFMPEG_ENCODER_FLAG_MAP[@]%:*}
101 "
102
103 # Strings for CPU features in the useflag[:configure_option] form
104 # if :configure_option isn't set, it will use 'useflag' as configure option
105 ARM_CPU_FEATURES=( armv5te armv6 armv6t2 neon armvfp:vfp )
106 MIPS_CPU_FEATURES=( mipsdspr1 mipsdspr2 mipsfpu )
107 PPC_CPU_FEATURES=( altivec )
108 X86_CPU_FEATURES_RAW=( 3dnow:amd3dnow 3dnowext:amd3dnowext avx:avx avx2:avx2 fma3:fma3 fma4:fma4 mmx:mmx mmxext:mmxext sse:sse sse2:sse2 sse3:sse3 ssse3:ssse3 sse4_1:sse4 sse4_2:sse42 xop:xop )
109 X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
110 X86_CPU_REQUIRED_USE="
111 cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
112 cpu_flags_x86_fma4? ( cpu_flags_x86_avx )
113 cpu_flags_x86_fma3? ( cpu_flags_x86_avx )
114 cpu_flags_x86_xop? ( cpu_flags_x86_avx )
115 cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 )
116 cpu_flags_x86_sse4_2? ( cpu_flags_x86_sse4_1 )
117 cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 )
118 cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 )
119 cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 )
120 cpu_flags_x86_sse2? ( cpu_flags_x86_sse )
121 cpu_flags_x86_sse? ( cpu_flags_x86_mmxext )
122 cpu_flags_x86_mmxext? ( cpu_flags_x86_mmx )
123 cpu_flags_x86_3dnowext? ( cpu_flags_x86_3dnow )
124 cpu_flags_x86_3dnow? ( cpu_flags_x86_mmx )
125 "
126
127 IUSE="${IUSE}
128 ${ARM_CPU_FEATURES[@]%:*}
129 ${MIPS_CPU_FEATURES[@]%:*}
130 ${PPC_CPU_FEATURES[@]%:*}
131 ${X86_CPU_FEATURES[@]%:*}
132 "
133
134 CPU_REQUIRED_USE="
135 ${X86_CPU_REQUIRED_USE}
136 "
137
138 # "$(tc-arch):XXX" form where XXX_CPU_FEATURES are the cpu features that apply to
139 # $(tc-arch).
140 CPU_FEATURES_MAP="
141 arm:ARM
142 arm64:ARM
143 mips:MIPS
144 ppc:PPC
145 ppc64:PPC
146 x86:X86
147 amd64:X86
148 "
149
150 FFTOOLS=( aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart trasher )
151 IUSE="${IUSE} ${FFTOOLS[@]/#/+fftools_}"
152
153 RDEPEND="
154 alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
155 amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] )
156 bluray? ( >=media-libs/libbluray-0.3.0-r1[${MULTILIB_USEDEP}] )
157 bs2b? ( >=media-libs/libbs2b-3.1.0-r1[${MULTILIB_USEDEP}] )
158 bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
159 cdio? ( >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}] )
160 celt? ( >=media-libs/celt-0.11.1-r1[${MULTILIB_USEDEP}] )
161 encode? (
162 aac? ( >=media-libs/vo-aacenc-0.1.3[${MULTILIB_USEDEP}] )
163 aacplus? ( >=media-libs/libaacplus-2.0.2-r1[${MULTILIB_USEDEP}] )
164 amrenc? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] )
165 faac? ( >=media-libs/faac-1.28-r3[${MULTILIB_USEDEP}] )
166 mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
167 theora? (
168 >=media-libs/libtheora-1.1.1[encode,${MULTILIB_USEDEP}]
169 >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
170 )
171 twolame? ( >=media-sound/twolame-0.3.13-r1[${MULTILIB_USEDEP}] )
172 wavpack? ( >=media-sound/wavpack-4.60.1-r1[${MULTILIB_USEDEP}] )
173 webp? ( >=media-libs/libwebp-0.3.0[${MULTILIB_USEDEP}] )
174 x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )
175 x265? ( >=media-libs/x265-1.2:=[${MULTILIB_USEDEP}] )
176 xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] )
177 )
178 fdk? ( >=media-libs/fdk-aac-0.1.3:=[${MULTILIB_USEDEP}] )
179 flite? ( >=app-accessibility/flite-1.4-r4[${MULTILIB_USEDEP}] )
180 fontconfig? ( >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}] )
181 frei0r? ( media-plugins/frei0r-plugins )
182 fribidi? ( >=dev-libs/fribidi-0.19.6[${MULTILIB_USEDEP}] )
183 gme? ( >=media-libs/game-music-emu-0.6.0[${MULTILIB_USEDEP}] )
184 gnutls? ( >=net-libs/gnutls-2.12.23-r6[${MULTILIB_USEDEP}] )
185 gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] )
186 iconv? ( >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] )
187 iec61883? (
188 >=media-libs/libiec61883-1.2.0-r1[${MULTILIB_USEDEP}]
189 >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
190 >=sys-libs/libavc1394-0.5.4-r1[${MULTILIB_USEDEP}]
191 )
192 ieee1394? (
193 >=media-libs/libdc1394-2.2.1[${MULTILIB_USEDEP}]
194 >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
195 )
196 jack? ( >=media-sound/jack-audio-connection-kit-0.121.3-r1[${MULTILIB_USEDEP}] )
197 jpeg2k? ( >=media-libs/openjpeg-1.5.0:0[${MULTILIB_USEDEP}] )
198 libass? ( >=media-libs/libass-0.10.2[${MULTILIB_USEDEP}] )
199 libcaca? ( >=media-libs/libcaca-0.99_beta18-r1[${MULTILIB_USEDEP}] )
200 libsoxr? ( >=media-libs/soxr-0.1.0[${MULTILIB_USEDEP}] )
201 libv4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
202 lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
203 modplug? ( >=media-libs/libmodplug-0.8.8.4-r1[${MULTILIB_USEDEP}] )
204 openal? ( >=media-libs/openal-1.15.1[${MULTILIB_USEDEP}] )
205 opengl? ( >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] )
206 openssl? ( >=dev-libs/openssl-1.0.1h-r2[${MULTILIB_USEDEP}] )
207 opus? ( >=media-libs/opus-1.0.2-r2[${MULTILIB_USEDEP}] )
208 pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
209 quvi? ( media-libs/libquvi:0.4[${MULTILIB_USEDEP}] )
210 rtmp? ( >=media-video/rtmpdump-2.4_p20131018[${MULTILIB_USEDEP}] )
211 samba? ( >=net-fs/samba-3.6.23-r1[${MULTILIB_USEDEP}] )
212 schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
213 sdl? ( >=media-libs/libsdl-1.2.15-r4[sound,video,${MULTILIB_USEDEP}] )
214 speex? ( >=media-libs/speex-1.2_rc1-r1[${MULTILIB_USEDEP}] )
215 ssh? ( >=net-libs/libssh-0.5.5[${MULTILIB_USEDEP}] )
216 truetype? ( >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}] )
217 vaapi? ( >=x11-libs/libva-1.2.1-r1[${MULTILIB_USEDEP}] )
218 vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
219 vorbis? (
220 >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
221 >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
222 )
223 vpx? ( >=media-libs/libvpx-1.2.0_pre20130625[${MULTILIB_USEDEP}] )
224 X? (
225 >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
226 >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
227 !xcb? ( >=x11-libs/libXfixes-5.0.1[${MULTILIB_USEDEP}] )
228 >=x11-libs/libXv-1.0.10[${MULTILIB_USEDEP}]
229 )
230 xcb? ( >=x11-libs/libxcb-1.4[${MULTILIB_USEDEP}] )
231 zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
232 zvbi? ( >=media-libs/zvbi-0.2.35[${MULTILIB_USEDEP}] )
233 !media-video/qt-faststart
234 postproc? ( !media-libs/libpostproc )
235 "
236
237 DEPEND="${RDEPEND}
238 >=sys-devel/make-3.81
239 doc? ( app-text/texi2html )
240 fontconfig? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
241 gnutls? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
242 ieee1394? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
243 ladspa? ( >=media-libs/ladspa-sdk-1.13-r2[${MULTILIB_USEDEP}] )
244 libv4l? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
245 cpu_flags_x86_mmx? ( >=dev-lang/yasm-1.2 )
246 rtmp? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
247 schroedinger? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
248 test? ( net-misc/wget sys-devel/bc )
249 truetype? ( >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}] )
250 v4l? ( sys-kernel/linux-headers )
251 "
252
253 RDEPEND="${RDEPEND}
254 abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20140508-r3
255 !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
256
257 # Code requiring FFmpeg to be built under gpl license
258 GPL_REQUIRED_USE="
259 postproc? ( gpl )
260 frei0r? ( gpl )
261 cdio? ( gpl )
262 samba? ( gpl )
263 zvbi? ( gpl )
264 encode? (
265 x264? ( gpl )
266 x265? ( gpl )
267 xvid? ( gpl )
268 X? ( !xcb? ( gpl ) )
269 )
270 "
271 REQUIRED_USE="
272 libv4l? ( v4l )
273 fftools_cws2fws? ( zlib )
274 test? ( encode )
275 ${GPL_REQUIRED_USE}
276 ${CPU_REQUIRED_USE}"
277 RESTRICT="
278 encode? ( faac? ( bindist ) aacplus? ( bindist ) )
279 gpl? ( openssl? ( bindist ) fdk? ( bindist ) )
280 "
281
282 S=${WORKDIR}/${P/_/-}
283
284 MULTILIB_WRAPPED_HEADERS=(
285 /usr/include/libavutil/avconfig.h
286 )
287
288 src_prepare() {
289 if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
290 export revision=git-N-${FFMPEG_REVISION}
291 fi
292 epatch_user
293 }
294
295 multilib_src_configure() {
296 local myconf=( ${EXTRA_FFMPEG_CONF} )
297
298 local ffuse=( "${FFMPEG_FLAG_MAP[@]}" )
299 use openssl && use gpl && myconf+=( --enable-nonfree )
300 use samba && myconf+=( --enable-version3 )
301
302 # Encoders
303 if use encode ; then
304 ffuse+=( "${FFMPEG_ENCODER_FLAG_MAP[@]}" )
305
306 # Licensing.
307 if use aac || use amrenc ; then
308 myconf+=( --enable-version3 )
309 fi
310 if use aacplus || use faac ; then
311 myconf+=( --enable-nonfree )
312 fi
313 else
314 myconf+=( --disable-encoders )
315 fi
316
317 # Indevs
318 use v4l || myconf+=( --disable-indev=v4l2 --disable-outdev=v4l2 )
319 for i in alsa oss jack ; do
320 use ${i} || myconf+=( --disable-indev=${i} )
321 done
322 use xcb || ffuse+=( X:x11grab )
323
324 # Outdevs
325 for i in alsa oss sdl ; do
326 use ${i} || myconf+=( --disable-outdev=${i} )
327 done
328
329 # Decoders
330 use amr && myconf+=( --enable-version3 )
331 use fdk && use gpl && myconf+=( --enable-nonfree )
332
333 for i in "${ffuse[@]#+}" ; do
334 myconf+=( $(use_enable ${i%:*} ${i#*:}) )
335 done
336
337 # (temporarily) disable non-multilib deps
338 if ! multilib_is_native_abi; then
339 for i in frei0r ; do
340 myconf+=( --disable-${i} )
341 done
342 fi
343
344 # CPU features
345 for i in ${CPU_FEATURES_MAP} ; do
346 if [ "$(tc-arch)" = "${i%:*}" ] ; then
347 local var="${i#*:}_CPU_FEATURES[@]"
348 for j in ${!var} ; do
349 use ${j%:*} || myconf+=( --disable-${j#*:} )
350 done
351 fi
352 done
353
354 if use pic ; then
355 myconf+=( --enable-pic )
356 # disable asm code if PIC is required
357 # as the provided asm decidedly is not PIC for x86.
358 [[ ${ABI} == x86 ]] && myconf+=( --disable-asm )
359 fi
360 [[ ${ABI} == x32 ]] && myconf+=( --disable-asm ) #427004
361
362 # Try to get cpu type based on CFLAGS.
363 # Bug #172723
364 # We need to do this so that features of that CPU will be better used
365 # If they contain an unknown CPU it will not hurt since ffmpeg's configure
366 # will just ignore it.
367 for i in $(get-flag mcpu) $(get-flag mtune) $(get-flag march) ; do
368 [[ ${i} = native ]] && i="host" # bug #273421
369 myconf+=( --cpu=${i} )
370 break
371 done
372
373 # Mandatory configuration
374 myconf=(
375 --enable-avfilter
376 --enable-avresample
377 --disable-stripping
378 "${myconf[@]}"
379 )
380
381 # cross compile support
382 if tc-is-cross-compiler ; then
383 myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- )
384 case ${CHOST} in
385 *freebsd*)
386 myconf+=( --target-os=freebsd )
387 ;;
388 mingw32*)
389 myconf+=( --target-os=mingw32 )
390 ;;
391 *linux*)
392 myconf+=( --target-os=linux )
393 ;;
394 esac
395 fi
396
397 set -- "${S}/configure" \
398 --prefix="${EPREFIX}/usr" \
399 --libdir="${EPREFIX}/usr/$(get_libdir)" \
400 --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
401 --mandir="${EPREFIX}/usr/share/man" \
402 --enable-shared \
403 --cc="$(tc-getCC)" \
404 --cxx="$(tc-getCXX)" \
405 --ar="$(tc-getAR)" \
406 --optflags=" " \
407 $(use_enable static-libs static) \
408 "${myconf[@]}"
409 echo "${@}"
410 "${@}" || die
411 }
412
413 multilib_src_compile() {
414 emake V=1
415
416 if multilib_is_native_abi; then
417 for i in "${FFTOOLS[@]}" ; do
418 if use fftools_${i} ; then
419 emake V=1 tools/${i}
420 fi
421 done
422 fi
423 }
424
425 multilib_src_install() {
426 emake V=1 DESTDIR="${D}" install install-man
427
428 if multilib_is_native_abi; then
429 for i in "${FFTOOLS[@]}" ; do
430 if use fftools_${i} ; then
431 dobin tools/${i}
432 fi
433 done
434 fi
435 }
436
437 multilib_src_install_all() {
438 dodoc Changelog README.md CREDITS doc/*.txt doc/APIchanges
439 [ -f "RELEASE_NOTES" ] && dodoc "RELEASE_NOTES"
440 use doc && dohtml -r doc/*
441 if use examples ; then
442 dodoc -r doc/examples
443 docompress -x /usr/share/doc/${PF}/examples
444 fi
445 }
446
447 multilib_src_test() {
448 LD_LIBRARY_PATH="${BUILD_DIR}/libpostproc:${BUILD_DIR}/libswscale:${BUILD_DIR}/libswresample:${BUILD_DIR}/libavcodec:${BUILD_DIR}/libavdevice:${BUILD_DIR}/libavfilter:${BUILD_DIR}/libavformat:${BUILD_DIR}/libavutil:${BUILD_DIR}/libavresample" \
449 emake V=1 fate
450 }

  ViewVC Help
Powered by ViewVC 1.1.20