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