Gentoo Archives: gentoo-commits

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