Gentoo Archives: gentoo-commits

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