Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-video/ffmpeg/
Date: Wed, 03 Jan 2018 09:04:54
Message-Id: 1514970277.4291816c4a45c57eff570c72acc0aaf88167d4a2.aballier@gentoo
1 commit: 4291816c4a45c57eff570c72acc0aaf88167d4a2
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Tue Jan 2 05:38:12 2018 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Wed Jan 3 09:04:37 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4291816c
7
8 media-video/ffmpeg: bump 3.3 branch to 3.3.6
9
10 Package-Manager: Portage-2.3.19, Repoman-2.3.6
11
12 media-video/ffmpeg/Manifest | 1 +
13 media-video/ffmpeg/ffmpeg-3.3.6.ebuild | 510 +++++++++++++++++++++++++++++++++
14 2 files changed, 511 insertions(+)
15
16 diff --git a/media-video/ffmpeg/Manifest b/media-video/ffmpeg/Manifest
17 index 4940e24b21e..2fe741533d9 100644
18 --- a/media-video/ffmpeg/Manifest
19 +++ b/media-video/ffmpeg/Manifest
20 @@ -3,5 +3,6 @@ DIST ffmpeg-3.2.7.tar.bz2 9622391 BLAKE2B 7d6f094ca0bd5e2cab02e051acc8e554873bca
21 DIST ffmpeg-3.3.3.tar.bz2 9940959 BLAKE2B 0f12aedca08df05478b6bae8b6a0e5dca85cc2bb2a462713533e73964e709f07b84164bba81d29f2f739b81b4d5dbb86abb17ee8d7fccfb7f57305e3cbc35be7 SHA512 1cc63bf73356f4e618c0d3572a216bdf5689f10deff56b4262f6d740b0bee5a4b3eac234f45fca3d4d2da77903a507b4fba725b76d2d2070f31b6dae9e7a2dab
22 DIST ffmpeg-3.3.4.tar.bz2 9944256 BLAKE2B 72d42a16396882b30641fb057bb597f8e98ecfa482a087ece48189acba8a80a72e931e70ad961db8c01c93a556f619ebdecb39bae9d4559cc504d0f7eabf15a7 SHA512 d2257a71f9ae7856390b807d70bf643d4360fe4f2ad7c76af3ac5332cda353a1a543cdcdea0c510dbb6141f7a3a36ffbf26ae87b0ffc9ce4b3b7641814a40e3a
23 DIST ffmpeg-3.3.5.tar.bz2 9945243 BLAKE2B 0fb9aad3d35f6173085e5a790e84c3a45c2051b656e9fb12b13af372778861121d6595e1f929144c32c77861d101fdb2a67c4411907147bd5534ce09d0fae3b9 SHA512 b97eb61f1c8f8ee95d79c6c28b37a0a99ad7752605714bfe8827366d319aed8bcaf2403cefb856604e8d61bca54573838c2ea0d38fa89ab453ccdd46b104725a
24 +DIST ffmpeg-3.3.6.tar.bz2 9943322 BLAKE2B 2526fdf9580045131426e554a9bf44fdc6567c12213ea4d5b78aa27f14513f14e07f38b8380183686fa1a62440fe4108eaecddca96f4dec3c74c410b1f90ee03 SHA512 1305760fa981bcb43c8fcb5dd1bf7dd8d3f405a124975f062062b741d49e12386e4d3eec3de6a032fc93cd7f6086d939275a669a9997ffa400f70c20f7eb3d23
25 DIST ffmpeg-3.4.1.tar.bz2 10177055 BLAKE2B b92f5a5d03770a52d1b3c2f20f0327acd17bff1dcc59ce3193f23695544838768addd807d38459c433172e9ad7410617cf1f30f3b2027a6558231138cac0233f SHA512 e509995eac0d54ebb7c0896303d1060ca1425841811df1b2bd61c9e41363cc50c91144bd3a7cf47e0d618591368763d054c3270b7a0a4b0e794c49bbdc59c4c5
26 DIST ffmpeg-3.4.tar.bz2 10171702 BLAKE2B 72af48359db365cf366c618e861571849f038a06da1da1ed0b232e02e423bb906e2b2b99a80aa56c276713344e37811bffdeff861d1c4745d6d28eb6d6fcbff5 SHA512 43a8825140efdd41e2dd53fb0475adeb74e003842690cbc189aea0f1af696eec675951db30f9742d063f4e31ae6883256bdceaf2cc73d1dab0d144f72a0741e0
27
28 diff --git a/media-video/ffmpeg/ffmpeg-3.3.6.ebuild b/media-video/ffmpeg/ffmpeg-3.3.6.ebuild
29 new file mode 100644
30 index 00000000000..26152a97df4
31 --- /dev/null
32 +++ b/media-video/ffmpeg/ffmpeg-3.3.6.ebuild
33 @@ -0,0 +1,510 @@
34 +# Copyright 1999-2018 Gentoo Foundation
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=6
38 +
39 +# Subslot: libavutil major.libavcodec major.libavformat major
40 +# Since FFmpeg ships several libraries, subslot is kind of limited here.
41 +# Most consumers will use those three libraries, if a "less used" library
42 +# changes its soname, consumers will have to be rebuilt the old way
43 +# (preserve-libs).
44 +# If, for example, a package does not link to libavformat and only libavformat
45 +# changes its ABI then this package will be rebuilt needlessly. Hence, such a
46 +# package is free _not_ to := depend on FFmpeg but I would strongly encourage
47 +# doing so since such a case is unlikely.
48 +FFMPEG_SUBSLOT=55.57.57
49 +
50 +SCM=""
51 +if [ "${PV#9999}" != "${PV}" ] ; then
52 + SCM="git-r3"
53 + EGIT_REPO_URI="git://source.ffmpeg.org/ffmpeg.git"
54 +fi
55 +
56 +inherit eutils flag-o-matic multilib multilib-minimal toolchain-funcs ${SCM}
57 +
58 +DESCRIPTION="Complete solution to record, convert and stream audio and video. Includes libavcodec"
59 +HOMEPAGE="http://ffmpeg.org/"
60 +if [ "${PV#9999}" != "${PV}" ] ; then
61 + SRC_URI=""
62 +elif [ "${PV%_p*}" != "${PV}" ] ; then # Snapshot
63 + SRC_URI="mirror://gentoo/${P}.tar.bz2"
64 +else # Release
65 + SRC_URI="http://ffmpeg.org/releases/${P/_/-}.tar.bz2"
66 +fi
67 +FFMPEG_REVISION="${PV#*_p}"
68 +
69 +SLOT="0/${FFMPEG_SUBSLOT}"
70 +LICENSE="
71 + !gpl? ( LGPL-2.1 )
72 + gpl? ( GPL-2 )
73 + amr? (
74 + gpl? ( GPL-3 )
75 + !gpl? ( LGPL-3 )
76 + )
77 + gmp? (
78 + gpl? ( GPL-3 )
79 + !gpl? ( LGPL-3 )
80 + )
81 + encode? (
82 + amrenc? (
83 + gpl? ( GPL-3 )
84 + !gpl? ( LGPL-3 )
85 + )
86 + )
87 + samba? ( GPL-3 )
88 +"
89 +if [ "${PV#9999}" = "${PV}" ] ; then
90 + KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
91 +fi
92 +
93 +# Options to use as use_enable in the foo[:bar] form.
94 +# This will feed configure with $(use_enable foo bar)
95 +# or $(use_enable foo foo) if no :bar is set.
96 +# foo is added to IUSE.
97 +FFMPEG_FLAG_MAP=(
98 + +bzip2:bzlib cpudetection:runtime-cpudetect debug gcrypt gnutls gmp
99 + +gpl +hardcoded-tables +iconv lzma +network openssl +postproc
100 + samba:libsmbclient sdl:ffplay sdl:sdl2 vaapi vdpau X:xlib xcb:libxcb
101 + xcb:libxcb-shm xcb:libxcb-xfixes +zlib
102 + # libavdevice options
103 + cdio:libcdio iec61883:libiec61883 ieee1394:libdc1394 libcaca openal
104 + opengl
105 + # indevs
106 + libv4l:libv4l2 pulseaudio:libpulse
107 + # decoders
108 + amr:libopencore-amrwb amr:libopencore-amrnb fdk:libfdk-aac
109 + jpeg2k:libopenjpeg bluray:libbluray celt:libcelt gme:libgme gsm:libgsm
110 + mmal modplug:libmodplug opus:libopus libilbc librtmp ssh:libssh
111 + schroedinger:libschroedinger speex:libspeex vorbis:libvorbis vpx:libvpx
112 + zvbi:libzvbi
113 + # libavfilter options
114 + bs2b:libbs2b chromaprint flite:libflite frei0r
115 + fribidi:libfribidi fontconfig ladspa libass truetype:libfreetype
116 + rubberband:librubberband sofalizer:netcdf zeromq:libzmq zimg:libzimg
117 + # libswresample options
118 + libsoxr
119 + # Threads; we only support pthread for now but ffmpeg supports more
120 + +threads:pthreads
121 +)
122 +
123 +# Same as above but for encoders, i.e. they do something only with USE=encode.
124 +FFMPEG_ENCODER_FLAG_MAP=(
125 + amrenc:libvo-amrwbenc mp3:libmp3lame
126 + kvazaar:libkvazaar nvenc:nvenc
127 + openh264:libopenh264 snappy:libsnappy theora:libtheora twolame:libtwolame
128 + wavpack:libwavpack webp:libwebp x264:libx264 x265:libx265 xvid:libxvid
129 +)
130 +
131 +IUSE="
132 + alsa chromium doc +encode jack oss pic static-libs test v4l
133 + ${FFMPEG_FLAG_MAP[@]%:*}
134 + ${FFMPEG_ENCODER_FLAG_MAP[@]%:*}
135 +"
136 +
137 +# Strings for CPU features in the useflag[:configure_option] form
138 +# if :configure_option isn't set, it will use 'useflag' as configure option
139 +ARM_CPU_FEATURES=(
140 + cpu_flags_arm_thumb:armv5te
141 + cpu_flags_arm_v6:armv6
142 + cpu_flags_arm_thumb2:armv6t2
143 + cpu_flags_arm_neon:neon
144 + cpu_flags_arm_vfp:vfp
145 + cpu_flags_arm_vfpv3:vfpv3
146 + cpu_flags_arm_v8:armv8
147 +)
148 +ARM_CPU_REQUIRED_USE="
149 + arm64? ( cpu_flags_arm_v8 )
150 + cpu_flags_arm_v8? ( cpu_flags_arm_vfpv3 cpu_flags_arm_neon )
151 + cpu_flags_arm_neon? ( cpu_flags_arm_thumb2 cpu_flags_arm_vfp )
152 + cpu_flags_arm_vfpv3? ( cpu_flags_arm_vfp )
153 + cpu_flags_arm_thumb2? ( cpu_flags_arm_v6 )
154 + cpu_flags_arm_v6? ( cpu_flags_arm_thumb )
155 +"
156 +MIPS_CPU_FEATURES=( mipsdspr1:mipsdsp mipsdspr2 mipsfpu )
157 +PPC_CPU_FEATURES=( altivec )
158 +X86_CPU_FEATURES_RAW=( 3dnow:amd3dnow 3dnowext:amd3dnowext aes:aesni 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 )
159 +X86_CPU_FEATURES=( ${X86_CPU_FEATURES_RAW[@]/#/cpu_flags_x86_} )
160 +X86_CPU_REQUIRED_USE="
161 + cpu_flags_x86_avx2? ( cpu_flags_x86_avx )
162 + cpu_flags_x86_fma4? ( cpu_flags_x86_avx )
163 + cpu_flags_x86_fma3? ( cpu_flags_x86_avx )
164 + cpu_flags_x86_xop? ( cpu_flags_x86_avx )
165 + cpu_flags_x86_avx? ( cpu_flags_x86_sse4_2 )
166 + cpu_flags_x86_aes? ( cpu_flags_x86_sse4_2 )
167 + cpu_flags_x86_sse4_2? ( cpu_flags_x86_sse4_1 )
168 + cpu_flags_x86_sse4_1? ( cpu_flags_x86_ssse3 )
169 + cpu_flags_x86_ssse3? ( cpu_flags_x86_sse3 )
170 + cpu_flags_x86_sse3? ( cpu_flags_x86_sse2 )
171 + cpu_flags_x86_sse2? ( cpu_flags_x86_sse )
172 + cpu_flags_x86_sse? ( cpu_flags_x86_mmxext )
173 + cpu_flags_x86_mmxext? ( cpu_flags_x86_mmx )
174 + cpu_flags_x86_3dnowext? ( cpu_flags_x86_3dnow )
175 + cpu_flags_x86_3dnow? ( cpu_flags_x86_mmx )
176 +"
177 +
178 +IUSE="${IUSE}
179 + ${ARM_CPU_FEATURES[@]%:*}
180 + ${MIPS_CPU_FEATURES[@]%:*}
181 + ${PPC_CPU_FEATURES[@]%:*}
182 + ${X86_CPU_FEATURES[@]%:*}
183 +"
184 +
185 +CPU_REQUIRED_USE="
186 + ${ARM_CPU_REQUIRED_USE}
187 + ${X86_CPU_REQUIRED_USE}
188 +"
189 +
190 +# "$(tc-arch):XXX" form where XXX_CPU_FEATURES are the cpu features that apply to
191 +# $(tc-arch).
192 +CPU_FEATURES_MAP="
193 + arm:ARM
194 + arm64:ARM
195 + mips:MIPS
196 + ppc:PPC
197 + ppc64:PPC
198 + x86:X86
199 + amd64:X86
200 +"
201 +
202 +FFTOOLS=( aviocat cws2fws ffescape ffeval ffhash fourcc2pixfmt graph2dot ismindex pktdumper qt-faststart sidxindex trasher )
203 +IUSE="${IUSE} ${FFTOOLS[@]/#/+fftools_}"
204 +
205 +RDEPEND="
206 + alsa? ( >=media-libs/alsa-lib-1.0.27.2[${MULTILIB_USEDEP}] )
207 + amr? ( >=media-libs/opencore-amr-0.1.3-r1[${MULTILIB_USEDEP}] )
208 + bluray? ( >=media-libs/libbluray-0.3.0-r1:=[${MULTILIB_USEDEP}] )
209 + bs2b? ( >=media-libs/libbs2b-3.1.0-r1[${MULTILIB_USEDEP}] )
210 + bzip2? ( >=app-arch/bzip2-1.0.6-r4[${MULTILIB_USEDEP}] )
211 + cdio? ( >=dev-libs/libcdio-paranoia-0.90_p1-r1[${MULTILIB_USEDEP}] )
212 + celt? ( >=media-libs/celt-0.11.1-r1[${MULTILIB_USEDEP}] )
213 + chromaprint? ( >=media-libs/chromaprint-1.2-r1[${MULTILIB_USEDEP}] )
214 + encode? (
215 + amrenc? ( >=media-libs/vo-amrwbenc-0.1.2-r1[${MULTILIB_USEDEP}] )
216 + kvazaar? ( media-libs/kvazaar[${MULTILIB_USEDEP}] )
217 + mp3? ( >=media-sound/lame-3.99.5-r1[${MULTILIB_USEDEP}] )
218 + nvenc? ( media-video/nvidia_video_sdk )
219 + openh264? ( >=media-libs/openh264-1.4.0-r1[${MULTILIB_USEDEP}] )
220 + snappy? ( >=app-arch/snappy-1.1.2-r1:=[${MULTILIB_USEDEP}] )
221 + theora? (
222 + >=media-libs/libtheora-1.1.1[encode,${MULTILIB_USEDEP}]
223 + >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
224 + )
225 + twolame? ( >=media-sound/twolame-0.3.13-r1[${MULTILIB_USEDEP}] )
226 + wavpack? ( >=media-sound/wavpack-4.60.1-r1[${MULTILIB_USEDEP}] )
227 + webp? ( >=media-libs/libwebp-0.3.0:=[${MULTILIB_USEDEP}] )
228 + x264? ( >=media-libs/x264-0.0.20130506:=[${MULTILIB_USEDEP}] )
229 + x265? ( >=media-libs/x265-1.6:=[${MULTILIB_USEDEP}] )
230 + xvid? ( >=media-libs/xvid-1.3.2-r1[${MULTILIB_USEDEP}] )
231 + )
232 + fdk? ( >=media-libs/fdk-aac-0.1.3:=[${MULTILIB_USEDEP}] )
233 + flite? ( >=app-accessibility/flite-1.4-r4[${MULTILIB_USEDEP}] )
234 + fontconfig? ( >=media-libs/fontconfig-2.10.92[${MULTILIB_USEDEP}] )
235 + frei0r? ( media-plugins/frei0r-plugins )
236 + fribidi? ( >=dev-libs/fribidi-0.19.6[${MULTILIB_USEDEP}] )
237 + gcrypt? ( >=dev-libs/libgcrypt-1.6:0=[${MULTILIB_USEDEP}] )
238 + gme? ( >=media-libs/game-music-emu-0.6.0[${MULTILIB_USEDEP}] )
239 + gmp? ( >=dev-libs/gmp-6:0=[${MULTILIB_USEDEP}] )
240 + gnutls? ( >=net-libs/gnutls-2.12.23-r6:=[${MULTILIB_USEDEP}] )
241 + gsm? ( >=media-sound/gsm-1.0.13-r1[${MULTILIB_USEDEP}] )
242 + iconv? ( >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}] )
243 + iec61883? (
244 + >=media-libs/libiec61883-1.2.0-r1[${MULTILIB_USEDEP}]
245 + >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
246 + >=sys-libs/libavc1394-0.5.4-r1[${MULTILIB_USEDEP}]
247 + )
248 + ieee1394? (
249 + >=media-libs/libdc1394-2.2.1[${MULTILIB_USEDEP}]
250 + >=sys-libs/libraw1394-2.1.0-r1[${MULTILIB_USEDEP}]
251 + )
252 + jack? ( virtual/jack[${MULTILIB_USEDEP}] )
253 + jpeg2k? ( >=media-libs/openjpeg-2:2[${MULTILIB_USEDEP}] )
254 + libass? ( >=media-libs/libass-0.10.2:=[${MULTILIB_USEDEP}] )
255 + libcaca? ( >=media-libs/libcaca-0.99_beta18-r1[${MULTILIB_USEDEP}] )
256 + libilbc? ( >=media-libs/libilbc-2[${MULTILIB_USEDEP}] )
257 + libsoxr? ( >=media-libs/soxr-0.1.0[${MULTILIB_USEDEP}] )
258 + libv4l? ( >=media-libs/libv4l-0.9.5[${MULTILIB_USEDEP}] )
259 + lzma? ( >=app-arch/xz-utils-5.0.5-r1[${MULTILIB_USEDEP}] )
260 + mmal? ( media-libs/raspberrypi-userland )
261 + modplug? ( >=media-libs/libmodplug-0.8.8.4-r1[${MULTILIB_USEDEP}] )
262 + openal? ( >=media-libs/openal-1.15.1[${MULTILIB_USEDEP}] )
263 + opengl? ( >=virtual/opengl-7.0-r1[${MULTILIB_USEDEP}] )
264 + openssl? ( >=dev-libs/openssl-1.0.1h-r2:0[${MULTILIB_USEDEP}] )
265 + opus? ( >=media-libs/opus-1.0.2-r2[${MULTILIB_USEDEP}] )
266 + pulseaudio? ( >=media-sound/pulseaudio-2.1-r1[${MULTILIB_USEDEP}] )
267 + librtmp? ( >=media-video/rtmpdump-2.4_p20131018[${MULTILIB_USEDEP}] )
268 + rubberband? ( >=media-libs/rubberband-1.8.1-r1[${MULTILIB_USEDEP}] )
269 + samba? ( >=net-fs/samba-3.6.23-r1[${MULTILIB_USEDEP}] )
270 + schroedinger? ( >=media-libs/schroedinger-1.0.11-r1[${MULTILIB_USEDEP}] )
271 + sdl? ( media-libs/libsdl2[sound,video,${MULTILIB_USEDEP}] )
272 + sofalizer? (
273 + >=sci-libs/netcdf-4.3.2-r1[hdf5]
274 + >=sci-libs/hdf5-1.8.18[hl]
275 + )
276 + speex? ( >=media-libs/speex-1.2_rc1-r1[${MULTILIB_USEDEP}] )
277 + ssh? ( >=net-libs/libssh-0.5.5[${MULTILIB_USEDEP}] )
278 + truetype? ( >=media-libs/freetype-2.5.0.1:2[${MULTILIB_USEDEP}] )
279 + vaapi? ( >=x11-libs/libva-1.2.1-r1[${MULTILIB_USEDEP}] )
280 + vdpau? ( >=x11-libs/libvdpau-0.7[${MULTILIB_USEDEP}] )
281 + vorbis? (
282 + >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
283 + >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}]
284 + )
285 + vpx? ( >=media-libs/libvpx-1.4.0:=[${MULTILIB_USEDEP}] )
286 + X? (
287 + >=x11-libs/libX11-1.6.2[${MULTILIB_USEDEP}]
288 + >=x11-libs/libXext-1.3.2[${MULTILIB_USEDEP}]
289 + >=x11-libs/libXv-1.0.10[${MULTILIB_USEDEP}]
290 + )
291 + xcb? ( >=x11-libs/libxcb-1.4[${MULTILIB_USEDEP}] )
292 + zeromq? ( >=net-libs/zeromq-4.1.6 )
293 + zimg? ( >=media-libs/zimg-2.4:=[${MULTILIB_USEDEP}] )
294 + zlib? ( >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}] )
295 + zvbi? ( >=media-libs/zvbi-0.2.35[${MULTILIB_USEDEP}] )
296 + !media-video/qt-faststart
297 + postproc? ( !media-libs/libpostproc )
298 +"
299 +
300 +DEPEND="${RDEPEND}
301 + >=sys-devel/make-3.81
302 + doc? ( sys-apps/texinfo )
303 + >=virtual/pkgconfig-0-r1[${MULTILIB_USEDEP}]
304 + ladspa? ( >=media-libs/ladspa-sdk-1.13-r2[${MULTILIB_USEDEP}] )
305 + cpu_flags_x86_mmx? ( >=dev-lang/yasm-1.2 )
306 + test? ( net-misc/wget sys-devel/bc )
307 + v4l? ( sys-kernel/linux-headers )
308 +"
309 +
310 +RDEPEND="${RDEPEND}
311 + abi_x86_32? ( !<=app-emulation/emul-linux-x86-medialibs-20140508-r3
312 + !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
313 +
314 +# Code requiring FFmpeg to be built under gpl license
315 +GPL_REQUIRED_USE="
316 + postproc? ( gpl )
317 + frei0r? ( gpl )
318 + cdio? ( gpl )
319 + samba? ( gpl )
320 + encode? (
321 + x264? ( gpl )
322 + x265? ( gpl )
323 + xvid? ( gpl )
324 + X? ( !xcb? ( gpl ) )
325 + )
326 +"
327 +REQUIRED_USE="
328 + libv4l? ( v4l )
329 + fftools_cws2fws? ( zlib )
330 + test? ( encode )
331 + ${GPL_REQUIRED_USE}
332 + ${CPU_REQUIRED_USE}"
333 +RESTRICT="
334 + gpl? ( openssl? ( bindist ) fdk? ( bindist ) )
335 +"
336 +
337 +S=${WORKDIR}/${P/_/-}
338 +
339 +MULTILIB_WRAPPED_HEADERS=(
340 + /usr/include/libavutil/avconfig.h
341 +)
342 +
343 +PATCHES=(
344 + "${FILESDIR}"/openjpeg22.patch
345 + "${FILESDIR}"/openjpeg23.patch
346 + "${FILESDIR}"/chromium.patch
347 +)
348 +
349 +src_prepare() {
350 + if [[ "${PV%_p*}" != "${PV}" ]] ; then # Snapshot
351 + export revision=git-N-${FFMPEG_REVISION}
352 + fi
353 + default
354 + echo 'include $(SRC_PATH)/ffbuild/libffmpeg.mak' >> Makefile || die
355 +}
356 +
357 +multilib_src_configure() {
358 + local myconf=( ${EXTRA_FFMPEG_CONF} )
359 +
360 + local ffuse=( "${FFMPEG_FLAG_MAP[@]}" )
361 + use openssl && use gpl && myconf+=( --enable-nonfree )
362 + use samba && myconf+=( --enable-version3 )
363 +
364 + # Encoders
365 + if use encode ; then
366 + ffuse+=( "${FFMPEG_ENCODER_FLAG_MAP[@]}" )
367 +
368 + # Licensing.
369 + if use amrenc ; then
370 + myconf+=( --enable-version3 )
371 + fi
372 + else
373 + myconf+=( --disable-encoders )
374 + fi
375 +
376 + # Indevs
377 + use v4l || myconf+=( --disable-indev=v4l2 --disable-outdev=v4l2 )
378 + for i in alsa oss jack ; do
379 + use ${i} || myconf+=( --disable-indev=${i} )
380 + done
381 +
382 + # Outdevs
383 + for i in alsa oss sdl ; do
384 + use ${i} || myconf+=( --disable-outdev=${i} )
385 + done
386 +
387 + # Decoders
388 + use amr && myconf+=( --enable-version3 )
389 + use gmp && myconf+=( --enable-version3 )
390 + use fdk && use gpl && myconf+=( --enable-nonfree )
391 +
392 + for i in "${ffuse[@]#+}" ; do
393 + myconf+=( $(use_enable ${i%:*} ${i#*:}) )
394 + done
395 +
396 + # (temporarily) disable non-multilib deps
397 + if ! multilib_is_native_abi; then
398 + for i in frei0r netcdf libzmq ; do
399 + myconf+=( --disable-${i} )
400 + done
401 + fi
402 +
403 + # CPU features
404 + for i in ${CPU_FEATURES_MAP} ; do
405 + if [ "$(tc-arch)" = "${i%:*}" ] ; then
406 + local var="${i#*:}_CPU_FEATURES[@]"
407 + for j in ${!var} ; do
408 + use ${j%:*} || myconf+=( --disable-${j#*:} )
409 + done
410 + fi
411 + done
412 +
413 + if use pic ; then
414 + myconf+=( --enable-pic )
415 + # disable asm code if PIC is required
416 + # as the provided asm decidedly is not PIC for x86.
417 + [[ ${ABI} == x86 ]] && myconf+=( --disable-asm )
418 + fi
419 + [[ ${ABI} == x32 ]] && myconf+=( --disable-asm ) #427004
420 +
421 + # Try to get cpu type based on CFLAGS.
422 + # Bug #172723
423 + # We need to do this so that features of that CPU will be better used
424 + # If they contain an unknown CPU it will not hurt since ffmpeg's configure
425 + # will just ignore it.
426 + for i in $(get-flag mcpu) $(get-flag march) ; do
427 + [[ ${i} = native ]] && i="host" # bug #273421
428 + myconf+=( --cpu=${i} )
429 + break
430 + done
431 +
432 + # LTO support, bug #566282
433 + is-flagq "-flto*" && myconf+=( "--enable-lto" )
434 +
435 + # Mandatory configuration
436 + myconf=(
437 + --enable-avfilter
438 + --enable-avresample
439 + --disable-stripping
440 + "${myconf[@]}"
441 + )
442 +
443 + # cross compile support
444 + if tc-is-cross-compiler ; then
445 + myconf+=( --enable-cross-compile --arch=$(tc-arch-kernel) --cross-prefix=${CHOST}- --host-cc="$(tc-getBUILD_CC)" )
446 + case ${CHOST} in
447 + *freebsd*)
448 + myconf+=( --target-os=freebsd )
449 + ;;
450 + *mingw32*)
451 + myconf+=( --target-os=mingw32 )
452 + ;;
453 + *linux*)
454 + myconf+=( --target-os=linux )
455 + ;;
456 + esac
457 + fi
458 +
459 + # doc
460 + myconf+=(
461 + $(multilib_native_use_enable doc)
462 + $(multilib_native_use_enable doc htmlpages)
463 + $(multilib_native_enable manpages)
464 + )
465 +
466 + set -- "${S}/configure" \
467 + --prefix="${EPREFIX}/usr" \
468 + --libdir="${EPREFIX}/usr/$(get_libdir)" \
469 + --shlibdir="${EPREFIX}/usr/$(get_libdir)" \
470 + --docdir="${EPREFIX}/usr/share/doc/${PF}/html" \
471 + --mandir="${EPREFIX}/usr/share/man" \
472 + --enable-shared \
473 + --cc="$(tc-getCC)" \
474 + --cxx="$(tc-getCXX)" \
475 + --ar="$(tc-getAR)" \
476 + --optflags="${CFLAGS}" \
477 + $(use_enable static-libs static) \
478 + "${myconf[@]}"
479 + echo "${@}"
480 + "${@}" || die
481 +
482 + if multilib_is_native_abi && use chromium; then
483 + einfo "Configuring for Chromium"
484 + mkdir -p ../chromium || die
485 + pushd ../chromium >/dev/null || die
486 + set -- "${@}" \
487 + --disable-shared \
488 + --enable-static \
489 + --enable-pic \
490 + --extra-cflags="-DFF_API_CONVERGENCE_DURATION=0"
491 + echo "${@}"
492 + "${@}" || die
493 + popd >/dev/null || die
494 + fi
495 +}
496 +
497 +multilib_src_compile() {
498 + emake V=1
499 +
500 + if multilib_is_native_abi; then
501 + for i in "${FFTOOLS[@]}" ; do
502 + if use fftools_${i} ; then
503 + emake V=1 tools/${i}$(get_exeext)
504 + fi
505 + done
506 +
507 + if use chromium; then
508 + einfo "Compiling for Chromium"
509 + pushd ../chromium >/dev/null || die
510 + emake V=1 libffmpeg
511 + popd >/dev/null || die
512 + fi
513 + fi
514 +}
515 +
516 +multilib_src_install() {
517 + emake V=1 DESTDIR="${D}" install install-doc
518 +
519 + if multilib_is_native_abi; then
520 + for i in "${FFTOOLS[@]}" ; do
521 + if use fftools_${i} ; then
522 + dobin tools/${i}$(get_exeext)
523 + fi
524 + done
525 +
526 + if use chromium; then
527 + einfo "Installing for Chromium"
528 + pushd ../chromium >/dev/null || die
529 + emake V=1 DESTDIR="${D}" install-libffmpeg
530 + popd >/dev/null || die
531 + fi
532 + fi
533 +}
534 +
535 +multilib_src_install_all() {
536 + dodoc Changelog README.md CREDITS doc/*.txt doc/APIchanges
537 + [ -f "RELEASE_NOTES" ] && dodoc "RELEASE_NOTES"
538 +}
539 +
540 +multilib_src_test() {
541 + 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" \
542 + emake V=1 fate
543 +}