media-video/ffmpeg: drop vulnerable 4.4.7, 6.1.5, 7.1.4, 8.1, 8.1.1

Bug: https://bugs.gentoo.org/978041
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
This commit is contained in:
Ionen Wolkens
2026-06-25 21:32:51 -04:00
parent 258acf6253
commit c2ed06cc81
6 changed files with 0 additions and 2987 deletions
-10
View File
@@ -1,24 +1,14 @@
DIST ffmpeg-4.4-patchset-3.tar.xz 8960 BLAKE2B 30ba0829392abba2c0bcf2ac57c42dc739f4dec610cbf2be51ea8e54646c02dc66d1527c613a547600c735843197c266a68153550b3478c21d0fd69c94e22911 SHA512 deabfa31356ec8d3c2ec4f88d9a482238e4491f229017e64b2a0c72e3d5b81ecd72e020a2d527dcd51257d94ad6d6d6bd178b5beedc79f012f414ae170a138b4
DIST ffmpeg-4.4.7.tar.xz 9587420 BLAKE2B 759d4c6df5dd54e5bfa033163e3d6d59626d1fa73d8b8abb962036440d4190c50ddbab353d9a2ace947098fb9f134991ddc238dcf89d8b0387cb9807bc269ea8 SHA512 5f72f8199353a40f384c10e86801f1e2db27be008d4f6463c754da3daa244bbbafc5dedb7472f299f1c3ddb9c44bc4dd5d979a8de7f952da91b36e12bcdfffd9
DIST ffmpeg-4.4.7.tar.xz.asc 520 BLAKE2B edcbb47516779c353ee3d5560c87e5d44a233bbce45584bcb67caa4378581d98c9080eba820c45671549be7dc88dc39c5843a950f94f4ff9478387907b536751 SHA512 00a6398af5b10b173991994cdeb6cd6fac26269a60ff8d218199907c549748013e73d7685386b5a7b3514607d6d46ea93b6eb9cc2f830066e411ec75fde8c19e
DIST ffmpeg-4.4.8.tar.xz 9596292 BLAKE2B fc68a73363c058900765302bba755b22bdff9a0c7752fc87fed4bd363d6d2d6337ba0dc7fa212fcd27226f23221ed718c625148c07a2166c5287c572870d93df SHA512 8733d0b0489f07d10f2a5d16af3cd186b2ccb023a5939b8c034f26d77191cff2bda749b6fe6521906b94eaa753d84a63f2c72248062e50ff3502fb81b1dca5e6
DIST ffmpeg-4.4.8.tar.xz.asc 520 BLAKE2B 6df194a7b518f865ef73888f3886cad3880ff0f4d532fc1f2baa6c3680c119609e3c259c3fb5a6c641ea24d4138ddbc408d32e5388958cd7747a93745c962299 SHA512 949849bffc2ccb8a3af4b3c146dae7acb0b8b08e4d4ba545be9ee6243b2a6b1fd7fa34066f20eba41038381b3fc659f3e2bbda2e8b803a372781e5b479905f33
DIST ffmpeg-6.1-patchset-4.tar.xz 10132 BLAKE2B be96252aff302b3c46adeac712ba7cd9e90b1b49a8131d5e84d8e8150fab001e0bd041f20a7d0cca9485bfeb857d8bcd11b440de9257d922a8989c4817d7a3cc SHA512 c17801becaba719712807eb529e201905e0ec4be2d643d0165f2ed90ef244ad940fbaaa6d69592e68587dabd683e554f95e9dd11f324efed0c600384b505b3a3
DIST ffmpeg-6.1.5.tar.xz 10489924 BLAKE2B b12f7531a9600a44efa1f1b4f46fb9675c01fb7bb5756947ac8da34bae13aeca7060c5b0160ce541c3c2768c5a77e00a2c69634ad148425798c571925a117d07 SHA512 e05fbf5ae80cefbf11da50bc53120e956a500b447bd998716daac890dc68c5d9ebd712cb69eb16f156845924ef89bd27f10b8a14decef9a9bd91f7231778e764
DIST ffmpeg-6.1.5.tar.xz.asc 520 BLAKE2B f6c4f15f12d86fe032e32bd323dfeabdaf9e5761ba38585aafc9ceaf0c8ed1b2312c126f60628401d5a33bb1eb34193432c81671d92706ddbf8035aeaf45ef86 SHA512 f097f5efb31157011a364137b71da649704908f530385a0e1e44addab3b97aac3df04d5769a7545bb4e5b9151ce22f267056c85ad3f71ed18f6a64dd29663205
DIST ffmpeg-6.1.6.tar.xz 10497884 BLAKE2B 4271a7c40d14890dd58a7057f973753affc9d7218dbdeacb393c581c945088539ccd1146ad53b36265b1592d5746fba361434d7254f9e1abc88cbe6640504a15 SHA512 3fdc98fb582d8ffc537848277e603917920d300a91b095a87190f89d8a6ba6f0d3e6a76172393662a38a26a58b42da0bd4843c2bd3d990ebf136b7b7084d5864
DIST ffmpeg-6.1.6.tar.xz.asc 520 BLAKE2B 554a236fa239ffefe7374320a1eda4f7ecceb0ac3faedf5241f17ad8b538c8f4e8b0f6f405815013888fbfb5fa693c31acbb91e8cba7ef4ac7ec4a1094593f0d SHA512 2efb4b7705e5694eb545637ef3318dabcbb8cf9a88c8e0fb301a3c8e9a02401f8f8e7ffc2a1297eeb775c38f96b6845fb04b1005caddef0eed75aceb338d8222
DIST ffmpeg-7.1-patchset-4.tar.xz 792 BLAKE2B 3941bfc8385fdc883b50e8a71d38d90016863834de566849af78b575b81724433311b115c19f8ce886e36154c9d1c1f37466ac8a4198aea03d874aa5ffad9963 SHA512 26bfcc321ad27e55cc9b60c5c30052b7918804636a4a1e709956f19eb19d5de30499d084436b5f36209cf0d72e70cbc5594ffff63028b9c93655c5058e099987
DIST ffmpeg-7.1.4.tar.xz 11043436 BLAKE2B eb8e5a0d58c1e6b9cc8c27cf6283370565343d856c7f1732138ce16fc67c7f11418f5bc01291408184f5afffa93c4630937056be5e785d6a88702eaa6775762e SHA512 f78122efff098fc75d0213021bfc5ddbf94dd993970cab846bd9e0dfa72564beeae5a65616e4394f1591e28472409ea404f1390fee2780ebddc39ba69a97f9a9
DIST ffmpeg-7.1.4.tar.xz.asc 520 BLAKE2B 4c3ec711db8a51dc62fc43d89bfee956dd6c4e2e7269b10fea6d49972389debe65afed96a02d6c3227d59390e9ad4ec7141509ba2931ee09dd606b9336939ed9 SHA512 0dace0354707c46c61658034f1581fc01a61501e66fc4fea3f856dbd036fa0a5d66378e97d39b0c0a900e092094c55161a4d74be1f4a7f6fbf1c2a8c2e4cbf2d
DIST ffmpeg-7.1.5.tar.xz 11050340 BLAKE2B 71ac16f0b47396fe99b50fffb7ed78a9d817c4adc83442e7e445cb92c550ba5b15bdbe8ca8d3d6393f88b569f62f647b353697b01ab192b21e4abd8464b8f7ad SHA512 c0649ef9edd4176b90459e92b636be18077ca898f24fe1a8dc60f3c5fd58cf718db9720bbe804c6f6894453e21c0625d706ea37d3523fcb40d61779763d7d965
DIST ffmpeg-7.1.5.tar.xz.asc 520 BLAKE2B 191c78ed098576b6ad0e32cda7a4ad6ce8a10555938c2cdc7d5c382e30778e9ed408d83af8e45e06f8e85bdadab11b50448f0475fc9dd0fd1ee4c6678e317568 SHA512 d441d8a25c7d6de06e5a78d7a4ea72c75dfd31de73ea899939ed1599212acf042710a8ed1e34d3d77b6c75b904f2f95bac03875ce55b04b2951e5b67b72882a4
DIST ffmpeg-8.1.1.tar.xz 11709440 BLAKE2B 275f853672f5d8e84bed0cd98b272b576355ebb3d31ad0538ef40200cf319ac03bd10d18f67b29e8549910e7e089aef7bad1c9537ae025eae5c13fc3c4bdb6c9 SHA512 f7873208d99cccfcf7b6aa3fe8e740e0f90f0ac55352f5eed93f994d51b5839700907811ac6cb160d09b4dacc6b174609bb7ed7fe902b3be3d787d86fe1b17bd
DIST ffmpeg-8.1.1.tar.xz.asc 520 BLAKE2B 3eb4b79c6718eb46bc3c303e8e81eaa43abaf9412206e23176ce30c0a466abe55f984b571117e5569ef09fc4c70c3fe780ae68e8517ba0bd53e04dda9fc6491c SHA512 d8013c91ee0937e2f4a8d3faf4bfafdd112ff3fece3abb84b567c20214b1b5fdcc3fd621c28f0906e5bcbd43fe4b4290f1d53f3d670fa4549e7a9fe15ec76fe6
DIST ffmpeg-8.1.2.tar.xz 11710924 BLAKE2B b37849fd89cdbc336700227c804d7642e0d2e4024359d15f4c3659cd41465145946b362fb61e0dc0141730f1d0352e2a2bf33d513213b2b3b68978be766b5914 SHA512 b3adc16fe426217bb607da01c4137cee0a9788fc08e077874336db185d2b7287746a7dc94cf0181ea92cd8afcdb06094ee9456e2986112354f84538cb9a5ed0b
DIST ffmpeg-8.1.2.tar.xz.asc 520 BLAKE2B d9a3ad0773cfba32c13d0ac29c88d0c3ebf53ccacc6a6c539f9b4f030181964acbedc8f7b846601e62d1c1bdefc34a31293970097f6d793438426c686da3bed9 SHA512 11d47bb4e7cb6ed388647d5ed7ba4f740b279e3d5bbe2caf97ffe486a62bb05ce0c1c3bf8c020c34818db935a967d18ac27071630e3357ddf1c549741eadd6a5
DIST ffmpeg-8.1.tar.xz 11702216 BLAKE2B 3710f8d3d60f89e404e837d238d089bdd7fd3be9404014aa1f3d4dd8983f10c7fefd7f4b27996fb8cb664f54aa3417da67f4ea02c896fe1026383198c45f5b26 SHA512 9deb30b93c27873564ec094693e72ff552f63a09af3175f9118672b88299a4e9495502aa0fb2dfbcd45857ba255f24b829bdd3c3c17d0f1eee75423302a9af8c
DIST ffmpeg-8.1.tar.xz.asc 520 BLAKE2B 5bbf0a315c5d8db98b6e1ffd98bc51577b0dd315091d77f48f4580498dfebd080de0b497e907cbdc687cdd6bdf48b426e29d84f35f6aff79083357146965b080 SHA512 f147c7a410c076ac9eeb74572bc04f1bb8fb2021ed92d13064e7c74ecc56226915e2e27e7be6cd287eca9aaaab5aca6d119470a24131ceda4309c9dbc0585603
DIST ffmpeg-rpi-6.1-r3.patch 800738 BLAKE2B b7e449ee5eec8b50a3b3bba233c5269f3b6845dbd18a619b844c841a97345ce24c7a5d7f4da05b08e3cb49668426b9044f3d3553d9c2ef3a50aec7199bfa3c09 SHA512 aeaf12afabf5f2192fb0b6ef47397d8477b109e49cee8c02a890d1656a27b1985c62c719ef72966d8c97b0709918233b65ea2e0ef988771507e4be137fcd9158
DIST ffmpeg-rpi-7.1.1.patch 847869 BLAKE2B efc3fef1810034b40eee1f637499171529fc6027c4fc0ef66da587c704a7742b454903aa060b21305e1d9a714eb31d96cd93f93d7cadb5815a0de22ac040b9e1 SHA512 a3f9013aec9b17e0fc1689d946e57e251a88eac3f9e7856d46fe9614fea29211feaf106d32a31f97c0e8c83c1685ca454c31f9bcb5dafb669a0933d683e581c8
DIST ffmpeg-soc-8.1.patch 702636 BLAKE2B 425247f9f41d13d706a9f7de00c14ad5606987e10a01c320c0b6a9091e0f340d0c34230b1a945c53c8bddc472105a6a6dbd96421e11f855f9427d1c4f7342028 SHA512 f24ae85846d98b1bdcde0d80916236c83497042edd6eb6c7b7f650c4fe787a04b6aa56cee89afa1f115501dd65edf2b120e4997b02d5f8e8a4a46edfd5ead387
-521
View File
@@ -1,521 +0,0 @@
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs
FFMPEG_SUBSLOT=56.58.58 # avutil.avcodec.avformat SONAME
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
https://git.ffmpeg.org/ffmpeg.git
https://github.com/FFmpeg/FFmpeg.git
)
else
inherit verify-sig
SRC_URI="
https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz
verify-sig? ( https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz.asc )
https://distfiles.gentoo.org/pub/dev/ionen@gentoo.org/ffmpeg-$(ver_cut 1-2)-patchset-3.tar.xz
"
S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} for ffmpeg-compat
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
fi
DESCRIPTION="Complete solution to record/convert/stream audio and video"
HOMEPAGE="
https://ffmpeg.org/
https://code.ffmpeg.org/FFmpeg/FFmpeg/
"
[[ ${PN} == *-compat ]] && FFMPEG_UNSLOTTED= || FFMPEG_UNSLOTTED=1
FFMPEG_IUSE_MAP=(
# [+]flag[:[^][!]opt1,...][@<v3|nonfree>]], ^ = native-only, ! = override
# remember to keep LICENSE, REQUIRED_USE, and RESTRICT in sync
X:libxcb,libxcb-shape,libxcb-shm,libxcb-xfixes,xlib
alsa
amrenc:libvo-amrwbenc@v3
amr:libopencore-amrnb,libopencore-amrwb@v3
appkit
bluray:libbluray
bs2b:libbs2b
bzip2:bzlib
cdio:libcdio
chromaprint
codec2:libcodec2
cuda-clang:cuda-llvm
+dav1d:libdav1d
${FFMPEG_UNSLOTTED:+doc:^htmlpages}
+drm:libdrm
fdk:libfdk-aac@nonfree
flite:libflite
+fontconfig:libfontconfig
frei0r
fribidi:libfribidi
gcrypt
gme:libgme
gmp:@v3
+gnutls # unused if USE=openssl, default for bug #905113,#917627
+gpl
gsm:libgsm
iec61883:libiec61883
ieee1394:libdc1394
jack:libjack
jpeg2k:libopenjpeg
kvazaar:libkvazaar
ladspa
lame:libmp3lame
libaom
libaribb24:@v3 # reminder: req use on gpl unneeded if >=1.0.4 (not in tree)
+libass
libcaca
libilbc
librtmp:librtmp
libsoxr
lv2
lzma
modplug:libmodplug
nvenc:cuvid,ffnvcodec,nvdec,nvenc
ocr:libtesseract
openal
opencl
opengl
openh264:libopenh264
openmpt:libopenmpt
openssl:openssl,!gnutls@v3ifgpl # still LGPL2.1+ if USE=-gpl
opus:libopus
+postproc # exposed as a USE for clarity with the GPL requirement
pulseaudio:libpulse
rabbitmq:^librabbitmq # no multilib
rav1e:^librav1e # no multilib
rubberband:librubberband
samba:libsmbclient@v3 # GPL-3+ only
sdl:sdl2
snappy:libsnappy
sndio
speex:libspeex
srt:libsrt
ssh:libssh
svg:librsvg
svt-av1:libsvtav1
theora:libtheora
+truetype:libfreetype
twolame:libtwolame
v4l:libv4l2
vaapi
vdpau
vidstab:libvidstab
vorbis:libvorbis
vpx:libvpx
vulkan
webp:libwebp
x264:libx264
x265:libx265
+xml:libxml2
xvid:libxvid
zeromq:^libzmq # no multilib
zimg:libzimg
+zlib
zvbi:libzvbi
)
# all-rights is used to express the GPL incompatibility (RESTRICT=bindist)
LICENSE="
gpl? (
GPL-2+
amr? ( GPL-3+ ) amrenc? ( GPL-3+ ) libaribb24? ( GPL-3+ )
gmp? ( GPL-3+ ) openssl? ( GPL-3+ )
fdk? ( all-rights-reserved )
)
!gpl? (
LGPL-2.1+
amr? ( LGPL-3+ ) amrenc? ( LGPL-3+ ) libaribb24? ( LGPL-3+ )
gmp? ( LGPL-3+ )
)
samba? ( GPL-3+ )
"
[[ ${FFMPEG_UNSLOTTED} ]] && : 0 || : "$(ver_cut 1)"
SLOT="${_}/${FFMPEG_SUBSLOT}"
IUSE="${FFMPEG_IUSE_MAP[*]%:*}"
REQUIRED_USE="
fribidi? ( truetype )
gmp? ( !librtmp )
libaribb24? ( gpl ) cdio? ( gpl ) frei0r? ( gpl ) postproc? ( gpl )
rubberband? ( gpl ) samba? ( gpl ) vidstab? ( gpl ) x264? ( gpl )
x265? ( gpl ) xvid? ( gpl )
"
RESTRICT="gpl? ( fdk? ( bindist ) )"
# dlopen: vulkan-loader
RDEPEND="
virtual/libiconv[${MULTILIB_USEDEP}]
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/libxcb:=[${MULTILIB_USEDEP}]
)
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
amr? ( media-libs/opencore-amr[${MULTILIB_USEDEP}] )
amrenc? ( media-libs/vo-amrwbenc[${MULTILIB_USEDEP}] )
bluray? ( media-libs/libbluray:=[${MULTILIB_USEDEP}] )
bs2b? ( media-libs/libbs2b[${MULTILIB_USEDEP}] )
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
cdio? ( dev-libs/libcdio-paranoia:=[${MULTILIB_USEDEP}] )
chromaprint? ( media-libs/chromaprint:=[${MULTILIB_USEDEP}] )
codec2? ( media-libs/codec2:=[${MULTILIB_USEDEP}] )
dav1d? ( media-libs/dav1d:=[${MULTILIB_USEDEP}] )
drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
fdk? ( media-libs/fdk-aac:=[${MULTILIB_USEDEP}] )
flite? ( app-accessibility/flite[${MULTILIB_USEDEP}] )
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
frei0r? ( media-plugins/frei0r-plugins[${MULTILIB_USEDEP}] )
fribidi? ( dev-libs/fribidi[${MULTILIB_USEDEP}] )
gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
gmp? ( dev-libs/gmp:=[${MULTILIB_USEDEP}] )
gnutls? ( !openssl? (
net-libs/gnutls:=[${MULTILIB_USEDEP}]
) )
gsm? ( media-sound/gsm[${MULTILIB_USEDEP}] )
iec61883? (
media-libs/libiec61883[${MULTILIB_USEDEP}]
sys-libs/libavc1394[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
ieee1394? (
media-libs/libdc1394:2=[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
jack? ( virtual/jack[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
kvazaar? ( media-libs/kvazaar:=[${MULTILIB_USEDEP}] )
lame? ( media-sound/lame[${MULTILIB_USEDEP}] )
libaom? ( media-libs/libaom:=[${MULTILIB_USEDEP}] )
libaribb24? ( media-libs/aribb24[${MULTILIB_USEDEP}] )
libass? ( media-libs/libass:=[${MULTILIB_USEDEP}] )
libcaca? ( media-libs/libcaca[${MULTILIB_USEDEP}] )
libilbc? ( media-libs/libilbc:=[${MULTILIB_USEDEP}] )
librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] )
lv2? (
media-libs/lilv[${MULTILIB_USEDEP}]
media-libs/lv2[${MULTILIB_USEDEP}]
)
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
modplug? ( media-libs/libmodplug[${MULTILIB_USEDEP}] )
ocr? ( app-text/tesseract:=[${MULTILIB_USEDEP}] )
openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
opengl? ( media-libs/libglvnd[X,${MULTILIB_USEDEP}] )
openh264? ( media-libs/openh264:=[${MULTILIB_USEDEP}] )
openmpt? ( media-libs/libopenmpt[${MULTILIB_USEDEP}] )
openssl? ( >=dev-libs/openssl-3:=[${MULTILIB_USEDEP}] )
opus? ( media-libs/opus[${MULTILIB_USEDEP}] )
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
rabbitmq? ( net-libs/rabbitmq-c:= )
rav1e? ( >=media-video/rav1e-0.4:=[capi] )
rubberband? ( media-libs/rubberband:=[${MULTILIB_USEDEP}] )
samba? ( net-fs/samba:=[client,${MULTILIB_USEDEP}] )
sdl? ( media-libs/libsdl2[sound(+),video(+),${MULTILIB_USEDEP}] )
snappy? ( app-arch/snappy:=[${MULTILIB_USEDEP}] )
sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
speex? ( media-libs/speex[${MULTILIB_USEDEP}] )
srt? ( net-libs/srt:=[${MULTILIB_USEDEP}] )
ssh? ( net-libs/libssh:=[sftp,${MULTILIB_USEDEP}] )
svg? (
dev-libs/glib:2[${MULTILIB_USEDEP}]
>=gnome-base/librsvg-2.52:2[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
)
svt-av1? ( >=media-libs/svt-av1-0.8.4:=[${MULTILIB_USEDEP}] )
theora? ( media-libs/libtheora:=[encode,${MULTILIB_USEDEP}] )
truetype? ( media-libs/freetype:2[${MULTILIB_USEDEP}] )
twolame? ( media-sound/twolame[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( media-libs/libva:=[X?,${MULTILIB_USEDEP}] )
vdpau? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libvdpau[${MULTILIB_USEDEP}]
)
vidstab? ( media-libs/vidstab[${MULTILIB_USEDEP}] )
vorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
vpx? ( media-libs/libvpx:=[${MULTILIB_USEDEP}] )
vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
x264? ( media-libs/x264:=[${MULTILIB_USEDEP}] )
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )
xml? ( dev-libs/libxml2:=[${MULTILIB_USEDEP}] )
xvid? ( media-libs/xvid[${MULTILIB_USEDEP}] )
zeromq? ( net-libs/zeromq:= )
zimg? ( media-libs/zimg[${MULTILIB_USEDEP}] )
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
zvbi? ( media-libs/zvbi[${MULTILIB_USEDEP}] )
"
DEPEND="
${RDEPEND}
X? ( x11-base/xorg-proto )
kernel_linux? ( >=sys-kernel/linux-headers-6 )
ladspa? ( media-libs/ladspa-sdk )
nvenc? ( media-libs/nv-codec-headers )
opencl? ( dev-util/opencl-headers )
vulkan? ( dev-util/vulkan-headers )
"
BDEPEND="
app-alternatives/awk
virtual/pkgconfig
amd64? (
|| (
dev-lang/nasm
dev-lang/yasm
)
)
cuda-clang? ( llvm-core/clang:*[llvm_targets_NVPTX] )
${FFMPEG_UNSLOTTED:+"
dev-lang/perl
doc? ( sys-apps/texinfo )
"}
"
[[ ${PV} != 9999 ]] &&
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-ffmpeg )"
DOCS=( CREDITS Changelog README.md doc/APIchanges )
[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/libavutil/avconfig.h
)
PATCHES=(
"${WORKDIR}"/patches
)
pkg_pretend() {
# TODO: drop this after a few months
if has_version "${CATEGORY}/${PN}[mp3]" && use !lame; then #952971
ewarn "${PN}'s 'mp3' USE was renamed to 'lame', please enable it"
ewarn "if wish to keep the ability to encode using media-sound/lame."
ewarn "This is *not* needed if only want mp3 playback."
fi
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] || return
if use chromaprint && has_version 'media-libs/chromaprint[tools]'; then
ewarn "media-libs/chromaprint is installed with USE=tools which links to"
ewarn "ffmpeg, and USE=chromaprint is enabled on ffmpeg which links to"
ewarn "chromaprint (circular). This may cause issues when updating ffmpeg."
ewarn
ewarn "If get a build failure with 'ERROR: chromaprint not found' or so,"
ewarn "first rebuild chromaprint with USE=-tools, then rebuild ffmpeg, and"
ewarn "then finally rebuild chromaprint with USE=tools again (bug #862996)."
fi
[[ ${EXTRA_FFMPEG_CONF} ]] && # drop this eventually
die "EXTRA_FFMPEG_CONF is set in the environment, please use EXTRA_ECONF instead"
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
use verify-sig &&
verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \
"${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc
default
fi
}
src_prepare() {
default
# respect user preferences
sed -i '/cflags -fdiagnostics-color/d' configure || die
# handle here to avoid repeating for each ABI below (bug #923491)
filter-lto
use elibc_musl && append-cppflags -D__musl__ #940733
}
multilib_src_configure() {
local conf=( "${S}"/configure ) # not autotools-based
local prefix=${EPREFIX}/usr
if [[ ! ${FFMPEG_UNSLOTTED} ]]; then
prefix+=/lib/ffmpeg${SLOT%/*}
# could get SONAME clashes, so prefer rpath over LDPATH
conf+=(
--enable-rpath
--disable-doc
)
fi
conf+=(
--prefix="${prefix}"
--libdir="${prefix}"/$(get_libdir)
--shlibdir="${prefix}"/$(get_libdir)
--mandir="${prefix}"/share/man
--docdir="${EPREFIX}"/usr/share/doc/${PF}/html
--ar="$(tc-getAR)"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--nm="$(tc-getNM)"
--pkg-config="$(tc-getPKG_CONFIG)"
--ranlib="$(tc-getRANLIB)"
--disable-stripping
# overrides users' -g/-O, let *FLAGS handle these
--disable-debug
--disable-optimizations
--optflags=' '
# not worth supporting on this version, use ffmpeg-6+
--disable-lto
# basic defaults that should not really need a USE
--enable-iconv
--enable-pic
--enable-shared
--disable-static
$(multilib_native_enable manpages) # needs pod2man
--disable-podpages
--disable-txtpages
# disabled primarily due to being unpackaged
--disable-decklink
--disable-libdavs2
--disable-libklvanc
--disable-libmysofa
--disable-libopenvino
--disable-libshine
--disable-libtls
--disable-libuavs3d
--disable-libxavs
--disable-libxavs2
--disable-pocketsphinx
--disable-rkmpp
--disable-vapoursynth
# disabled for other or additional reasons
--disable-amf # may or may not be broken, use ffmpeg-6+ (bug #910271)
--disable-cuda-nvcc # prefer cuda-llvm for less issues
--disable-libcelt # obsolete (bug #664158)
--disable-libglslang # use ffmpeg-6+ with USE=shaderc instead
--disable-liblensfun # https://trac.ffmpeg.org/ticket/9112 (abandoned?)
--disable-libmfx # use ffmpeg-6+ with USE=qsv instead
--disable-libnpp # use ffmpeg-6+, ebuild support was only added there
--disable-libopencv # leaving for later due to circular opencv[ffmpeg]
--disable-librist # currently only supported in >=ffmpeg-8 ebuilds
--disable-libtensorflow # causes headaches, and is gone
--disable-libvmaf # use ffmpeg-8+ instead, needs old vmaf (bug #968554)
--disable-mbedtls # messy with slots, tests underlinking issues
--disable-mmal # unsupported
--disable-omx # unsupported (bug #653386)
--disable-omx-rpi # ^
# to avoid obscure issues like bug #915384 and simplify the ebuild,
# not passing the following (use EXTRA_ECONF if really must):
# --cpu: adds -march=<exact> after the user's more adapted
# =native, its logic also does not account for -mno-*
# --disable/enable-<cpufeature>: safer to detect at runtime
)
# broken on x32 (bug #427004), and not PIC safe on x86 (bug #916067)
[[ ${ABI} == @(x32|x86) ]] && conf+=( --disable-asm )
# disable due to asm-related failures on ppc (bug #951464, ppc64be)
# https://trac.ffmpeg.org/ticket/9604 (ppc64el)
# https://trac.ffmpeg.org/ticket/10955 (ppc64el)
# (review re-enabling if resolved, or if debian allows it again)
use ppc || use ppc64 && conf+=( --disable-asm )
if tc-is-cross-compiler; then
conf+=(
--enable-cross-compile
--arch="$(tc-arch-kernel)"
--cross-prefix="${CHOST}-"
--host-cc="$(tc-getBUILD_CC)"
)
case ${CHOST} in
*mingw32*) conf+=( --target-os=mingw32 );;
*linux*) conf+=( --target-os=linux );;
esac
elif use arm; then
# TODO?: could *always* pass tc-arch-kernel, albeit that function
# is meant for the kernel and just mostly matches by accident
conf+=( --arch=arm ) #969514
fi
# skipping tests is handled at configure-time
local skip_tests=()
# zlib-ng is not bitexact w/ zlib producing mismatching md5sum (bug #965737)
has_version 'sys-libs/zlib-ng[compat]' &&
skip_tests+=(
lavf-{apng{,.png},gray16be.png,png,rgb48be.png}
mov-mp4-frag-flush
vsynth{1,2,3}-{flashsv,mpng,zlib}
)
(( ${#skip_tests[@]} )) &&
conf+=( --ignore-tests=$(IFS=,; echo "${skip_tests[*]}") )
# import options from FFMPEG_IUSE_MAP
local flag license mod v
local -A optmap=() licensemap=()
for v in "${FFMPEG_IUSE_MAP[@]}"; do
[[ ${v} =~ \+?([^:]+):?([^@]*)@?(.*) ]] || die "${v}"
flag=${BASH_REMATCH[1]}
license=${BASH_REMATCH[3]}
v=${BASH_REMATCH[2]:-${flag}}
for v in ${v//,/ }; do
mod=${v::1}
v=${v#[\!\^]}
if [[ ${mod} == '!' ]]; then
if use ${flag}; then
optmap[${v}]=--disable-${v}
unset licensemap[${v}]
fi
elif [[ ! -v optmap[${v}] ]]; then
if [[ ${mod} == '^' ]]; then
optmap[${v}]=$(multilib_native_use_enable ${flag} ${v})
else
optmap[${v}]=$(use_enable ${flag} ${v})
fi
use ${flag} && licensemap[${v}]=${license}
fi
done
done
for license in "${licensemap[@]}"; do
case ${license} in
v3ifgpl) use gpl || continue ;&
v3) optmap[v3]=--enable-version3 ;;
nonfree) use gpl && optmap[nonfree]=--enable-nonfree ;;
esac
done
conf+=(
"${optmap[@]}"
${EXTRA_ECONF}
)
einfo "${conf[*]}"
"${conf[@]}" || die "configure failed, see ${BUILD_DIR}/ffbuild/config.log"
}
multilib_src_compile() {
emake V=1
}
multilib_src_test() {
local -x LD_LIBRARY_PATH=$(printf %s: "${BUILD_DIR}"/lib*)${LD_LIBRARY_PATH}
emake V=1 -k fate
}
multilib_src_install() {
emake V=1 DESTDIR="${D}" install
}
-582
View File
@@ -1,582 +0,0 @@
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs
FFMPEG_SOC_PATCH=ffmpeg-rpi-6.1-r3.patch
FFMPEG_SUBSLOT=58.60.60 # avutil.avcodec.avformat SONAME
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
https://git.ffmpeg.org/ffmpeg.git
https://github.com/FFmpeg/FFmpeg.git
)
else
inherit verify-sig
SRC_URI="
https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz
verify-sig? ( https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz.asc )
${FFMPEG_SOC_PATCH:+"
soc? ( https://dev.gentoo.org/~chewi/distfiles/${FFMPEG_SOC_PATCH} )
"}
https://distfiles.gentoo.org/pub/dev/ionen@gentoo.org/ffmpeg-$(ver_cut 1-2)-patchset-4.tar.xz
"
S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} for ffmpeg-compat
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
fi
DESCRIPTION="Complete solution to record/convert/stream audio and video"
HOMEPAGE="
https://ffmpeg.org/
https://code.ffmpeg.org/FFmpeg/FFmpeg/
"
[[ ${PN} == *-compat ]] && FFMPEG_UNSLOTTED= || FFMPEG_UNSLOTTED=1
FFMPEG_IUSE_MAP=(
# [+]flag[:[^][!]opt1,...][@<v3|nonfree>]], ^ = native-only, ! = override
# remember to keep LICENSE, REQUIRED_USE, and RESTRICT in sync
X:libxcb,libxcb-shape,libxcb-shm,libxcb-xfixes,xlib
alsa
amf
amrenc:libvo-amrwbenc@v3
amr:libopencore-amrnb,libopencore-amrwb@v3
appkit
bluray:libbluray
bs2b:libbs2b
bzip2:bzlib
cdio:libcdio
chromaprint
codec2:libcodec2
cuda-clang:cuda-llvm
+dav1d:libdav1d
${FFMPEG_UNSLOTTED:+doc:^htmlpages}
+drm:libdrm
fdk:libfdk-aac@nonfree
flite:libflite
+fontconfig:libfontconfig
frei0r
fribidi:libfribidi
gcrypt
gme:libgme
gmp:@v3
+gnutls # unused if USE=openssl, default for bug #905113,#917627
+gpl
gsm:libgsm
iec61883:libiec61883
ieee1394:libdc1394
jack:libjack
jpeg2k:libopenjpeg
jpegxl:libjxl
kvazaar:libkvazaar
ladspa
lame:libmp3lame
lcms:lcms2
libaom
libaribb24:@v3 # reminder: req use on gpl unneeded if >=1.0.4 (not in tree)
+libass
libcaca
libilbc
libplacebo
librtmp:librtmp
libsoxr
lv2
lzma
modplug:libmodplug
nvenc:cuvid,ffnvcodec,nvdec,nvenc
ocr:libtesseract
openal
opencl
opengl
openh264:libopenh264
openmpt:libopenmpt
openssl:openssl,!gnutls@v3ifgpl # still LGPL2.1+ if USE=-gpl
opus:libopus
+postproc # exposed as a USE for clarity with the GPL requirement
pulseaudio:libpulse
qsv:libvpl
rabbitmq:^librabbitmq # no multilib
rav1e:^librav1e # no multilib
rubberband:librubberband
samba:libsmbclient@v3 # GPL-3+ only
sdl:sdl2
shaderc:libshaderc
snappy:libsnappy
sndio
speex:libspeex
srt:libsrt
ssh:libssh
svg:librsvg
svt-av1:libsvtav1
theora:libtheora
+truetype:libfreetype,libharfbuzz
twolame:libtwolame
v4l:libv4l2
vaapi
vdpau
vidstab:libvidstab
vorbis:libvorbis
vpx:libvpx
vulkan
webp:libwebp
x264:libx264
x265:libx265
+xml:libxml2
xvid:libxvid
zeromq:^libzmq # no multilib
zimg:libzimg
+zlib
zvbi:libzvbi
)
# all-rights is used to express the GPL incompatibility (RESTRICT=bindist)
LICENSE="
gpl? (
GPL-2+
amr? ( GPL-3+ ) amrenc? ( GPL-3+ ) libaribb24? ( GPL-3+ )
gmp? ( GPL-3+ ) openssl? ( GPL-3+ )
fdk? ( all-rights-reserved )
)
!gpl? (
LGPL-2.1+
amr? ( LGPL-3+ ) amrenc? ( LGPL-3+ ) libaribb24? ( LGPL-3+ )
gmp? ( LGPL-3+ )
)
samba? ( GPL-3+ )
"
[[ ${FFMPEG_UNSLOTTED} ]] && : 0 || : "$(ver_cut 1)"
SLOT="${_}/${FFMPEG_SUBSLOT}"
IUSE="
${FFMPEG_IUSE_MAP[*]%:*}
${FFMPEG_UNSLOTTED:+chromium}
${FFMPEG_SOC_PATCH:+soc}
"
REQUIRED_USE="
cuda-clang? ( nvenc )
fribidi? ( truetype )
gmp? ( !librtmp )
libplacebo? ( vulkan )
shaderc? ( vulkan )
libaribb24? ( gpl ) cdio? ( gpl ) frei0r? ( gpl ) postproc? ( gpl )
rubberband? ( gpl ) samba? ( gpl ) vidstab? ( gpl ) x264? ( gpl )
x265? ( gpl ) xvid? ( gpl )
${FFMPEG_UNSLOTTED:+chromium? ( opus )}
${FFMPEG_SOC_PATCH:+soc? ( drm )}
"
RESTRICT="gpl? ( fdk? ( bindist ) )"
# dlopen: amdgpu-pro-amf, vulkan-loader
COMMON_DEPEND="
virtual/libiconv[${MULTILIB_USEDEP}]
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/libxcb:=[${MULTILIB_USEDEP}]
)
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
amr? ( media-libs/opencore-amr[${MULTILIB_USEDEP}] )
amrenc? ( media-libs/vo-amrwbenc[${MULTILIB_USEDEP}] )
bluray? ( media-libs/libbluray:=[${MULTILIB_USEDEP}] )
bs2b? ( media-libs/libbs2b[${MULTILIB_USEDEP}] )
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
cdio? ( dev-libs/libcdio-paranoia:=[${MULTILIB_USEDEP}] )
chromaprint? ( media-libs/chromaprint:=[${MULTILIB_USEDEP}] )
codec2? ( media-libs/codec2:=[${MULTILIB_USEDEP}] )
dav1d? ( media-libs/dav1d:=[${MULTILIB_USEDEP}] )
drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
fdk? ( media-libs/fdk-aac:=[${MULTILIB_USEDEP}] )
flite? ( app-accessibility/flite[${MULTILIB_USEDEP}] )
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
frei0r? ( media-plugins/frei0r-plugins[${MULTILIB_USEDEP}] )
fribidi? ( dev-libs/fribidi[${MULTILIB_USEDEP}] )
gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
gmp? ( dev-libs/gmp:=[${MULTILIB_USEDEP}] )
gnutls? ( !openssl? (
net-libs/gnutls:=[${MULTILIB_USEDEP}]
) )
gsm? ( media-sound/gsm[${MULTILIB_USEDEP}] )
iec61883? (
media-libs/libiec61883[${MULTILIB_USEDEP}]
sys-libs/libavc1394[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
ieee1394? (
media-libs/libdc1394:2=[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
jack? ( virtual/jack[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
jpegxl? ( media-libs/libjxl:=[${MULTILIB_USEDEP}] )
kvazaar? ( media-libs/kvazaar:=[${MULTILIB_USEDEP}] )
lame? ( media-sound/lame[${MULTILIB_USEDEP}] )
lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] )
libaom? ( media-libs/libaom:=[${MULTILIB_USEDEP}] )
libaribb24? ( media-libs/aribb24[${MULTILIB_USEDEP}] )
libass? ( media-libs/libass:=[${MULTILIB_USEDEP}] )
libcaca? ( media-libs/libcaca[${MULTILIB_USEDEP}] )
libilbc? ( media-libs/libilbc:=[${MULTILIB_USEDEP}] )
libplacebo? ( media-libs/libplacebo:=[vulkan,${MULTILIB_USEDEP}] )
librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] )
lv2? (
media-libs/lilv[${MULTILIB_USEDEP}]
media-libs/lv2[${MULTILIB_USEDEP}]
)
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
modplug? ( media-libs/libmodplug[${MULTILIB_USEDEP}] )
ocr? ( app-text/tesseract:=[${MULTILIB_USEDEP}] )
openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
opengl? ( media-libs/libglvnd[X,${MULTILIB_USEDEP}] )
openh264? ( media-libs/openh264:=[${MULTILIB_USEDEP}] )
openmpt? ( media-libs/libopenmpt[${MULTILIB_USEDEP}] )
openssl? ( >=dev-libs/openssl-3:=[${MULTILIB_USEDEP}] )
opus? ( media-libs/opus[${MULTILIB_USEDEP}] )
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
qsv? ( media-libs/libvpl:=[${MULTILIB_USEDEP}] )
rabbitmq? ( net-libs/rabbitmq-c:= )
rav1e? ( >=media-video/rav1e-0.5:=[capi] )
rubberband? ( media-libs/rubberband:=[${MULTILIB_USEDEP}] )
samba? ( net-fs/samba:=[client,${MULTILIB_USEDEP}] )
sdl? (
media-libs/libsdl2[sound(+),video(+),${MULTILIB_USEDEP}]
libplacebo? ( media-libs/libsdl2[vulkan] )
)
shaderc? ( media-libs/shaderc[${MULTILIB_USEDEP}] )
snappy? ( app-arch/snappy:=[${MULTILIB_USEDEP}] )
sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
speex? ( media-libs/speex[${MULTILIB_USEDEP}] )
srt? ( net-libs/srt:=[${MULTILIB_USEDEP}] )
ssh? ( net-libs/libssh:=[sftp,${MULTILIB_USEDEP}] )
svg? (
dev-libs/glib:2[${MULTILIB_USEDEP}]
>=gnome-base/librsvg-2.52:2[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
)
svt-av1? ( >=media-libs/svt-av1-0.9:=[${MULTILIB_USEDEP}] )
theora? ( media-libs/libtheora:=[encode,${MULTILIB_USEDEP}] )
truetype? (
media-libs/freetype:2[${MULTILIB_USEDEP}]
media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
)
twolame? ( media-sound/twolame[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( media-libs/libva:=[X?,${MULTILIB_USEDEP}] )
vdpau? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libvdpau[${MULTILIB_USEDEP}]
)
vidstab? ( media-libs/vidstab[${MULTILIB_USEDEP}] )
vorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
vpx? ( media-libs/libvpx:=[${MULTILIB_USEDEP}] )
vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
x264? ( media-libs/x264:=[${MULTILIB_USEDEP}] )
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )
xml? ( dev-libs/libxml2:=[${MULTILIB_USEDEP}] )
xvid? ( media-libs/xvid[${MULTILIB_USEDEP}] )
zeromq? ( net-libs/zeromq:= )
zimg? ( media-libs/zimg[${MULTILIB_USEDEP}] )
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
zvbi? ( media-libs/zvbi[${MULTILIB_USEDEP}] )
${FFMPEG_SOC_PATCH:+"
soc? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
"}
"
RDEPEND="
${COMMON_DEPEND}
amf? ( media-video/amdgpu-pro-amf )
"
DEPEND="
${COMMON_DEPEND}
X? ( x11-base/xorg-proto )
amf? ( media-libs/amf-headers )
kernel_linux? ( >=sys-kernel/linux-headers-6 )
ladspa? ( media-libs/ladspa-sdk )
nvenc? ( >=media-libs/nv-codec-headers-12.1.14.0 )
opencl? ( dev-util/opencl-headers )
vulkan? ( dev-util/vulkan-headers )
"
BDEPEND="
app-alternatives/awk
virtual/pkgconfig
amd64? (
|| (
dev-lang/nasm
dev-lang/yasm
)
)
cuda-clang? ( llvm-core/clang:*[llvm_targets_NVPTX] )
${FFMPEG_UNSLOTTED:+"
dev-lang/perl
doc? ( sys-apps/texinfo )
"}
"
[[ ${PV} != 9999 ]] &&
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-ffmpeg )"
DOCS=( CREDITS Changelog README.md doc/APIchanges )
[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/libavutil/avconfig.h
)
PATCHES=(
"${WORKDIR}"/patches
)
pkg_pretend() {
# TODO: drop this after a few months
if has_version "${CATEGORY}/${PN}[mp3]" && use !lame; then #952971
ewarn "${PN}'s 'mp3' USE was renamed to 'lame', please enable it"
ewarn "if wish to keep the ability to encode using media-sound/lame."
ewarn "This is *not* needed if only want mp3 playback."
fi
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] || return
if use chromaprint && has_version 'media-libs/chromaprint[tools]'; then
ewarn "media-libs/chromaprint is installed with USE=tools which links to"
ewarn "ffmpeg, and USE=chromaprint is enabled on ffmpeg which links to"
ewarn "chromaprint (circular). This may cause issues when updating ffmpeg."
ewarn
ewarn "If get a build failure with 'ERROR: chromaprint not found' or so,"
ewarn "first rebuild chromaprint with USE=-tools, then rebuild ffmpeg, and"
ewarn "then finally rebuild chromaprint with USE=tools again (bug #862996)."
fi
[[ ${EXTRA_FFMPEG_CONF} ]] && # drop this eventually
die "EXTRA_FFMPEG_CONF is set in the environment, please use EXTRA_ECONF instead"
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
use verify-sig &&
verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \
"${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc
default
fi
}
src_prepare() {
in_iuse chromium && PATCHES+=( "${FILESDIR}"/chromium-r3.patch )
in_iuse soc && use soc && PATCHES+=( "${DISTDIR}"/${FFMPEG_SOC_PATCH} )
default
# respect user preferences
sed -i '/cflags -fdiagnostics-color/d' configure || die
# handle here to avoid repeating for each ABI below (bug #923491)
FFMPEG_ENABLE_LTO=
if tc-is-lto; then
: "$(get-flag -flto)" # get -flto=<val> (e.g. =thin)
FFMPEG_ENABLE_LTO=--enable-lto${_#-flto}
tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835
fi
filter-lto
use elibc_musl && append-cppflags -D__musl__ #940733
}
multilib_src_configure() {
local conf=( "${S}"/configure ) # not autotools-based
local prefix=${EPREFIX}/usr
if [[ ! ${FFMPEG_UNSLOTTED} ]]; then
prefix+=/lib/ffmpeg${SLOT%/*}
# could get SONAME clashes, so prefer rpath over LDPATH
conf+=(
--enable-rpath
--disable-doc
)
fi
conf+=(
--prefix="${prefix}"
--libdir="${prefix}"/$(get_libdir)
--shlibdir="${prefix}"/$(get_libdir)
--mandir="${prefix}"/share/man
--docdir="${EPREFIX}"/usr/share/doc/${PF}/html
--ar="$(tc-getAR)"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--nm="$(tc-getNM)"
--pkg-config="$(tc-getPKG_CONFIG)"
--ranlib="$(tc-getRANLIB)"
--disable-stripping
# overrides users' -g/-O, let *FLAGS handle these
--disable-debug
--disable-optimizations
--optflags=' '
# pass option over *FLAGS due to special logic (bug #566282,#754654)
${FFMPEG_ENABLE_LTO}
# basic defaults that should not really need a USE
--enable-iconv
--enable-pic
--enable-shared
--disable-static
$(multilib_native_enable manpages) # needs pod2man
--disable-podpages
--disable-txtpages
# disabled primarily due to being unpackaged
--disable-decklink
--disable-libaribcaption
--disable-libdavs2
--disable-libklvanc
--disable-libmysofa
--disable-libopenvino
--disable-libshine
--disable-libtls
--disable-libuavs3d
--disable-libxavs
--disable-libxavs2
--disable-pocketsphinx
--disable-rkmpp
--disable-vapoursynth
# disabled for other or additional reasons
--disable-cuda-nvcc # prefer cuda-llvm for less issues
--disable-libcelt # obsolete (bug #664158)
--disable-libglslang # prefer USE=shaderc (bug #918989,#920283,#922333)
--disable-liblensfun # https://trac.ffmpeg.org/ticket/9112 (abandoned?)
--disable-libmfx # prefer libvpl for USE=qsv
--disable-libnpp # deprecated and not supported for cuda 13.0+
--disable-libopencv # leaving for later due to circular opencv[ffmpeg]
--disable-librist # currently only supported in >=ffmpeg-8 ebuilds
--disable-libtensorflow # causes headaches, and is gone
--disable-libvmaf # use ffmpeg-8+ instead, needs old vmaf (bug #968554)
--disable-mbedtls # messy with slots, tests underlinking issues
--disable-mmal # prefer USE=soc
--disable-omx # unsupported (bug #653386)
--disable-omx-rpi # ^
# to avoid obscure issues like bug #915384 and simplify the ebuild,
# not passing the following (use EXTRA_ECONF if really must):
# --cpu: adds -march=<exact> after the user's more adapted
# =native, its logic also does not account for -mno-*
# --disable/enable-<cpufeature>: safer to detect at runtime
)
in_iuse soc && use soc &&
conf+=(
--disable-epoxy
--enable-libudev
--enable-sand
--enable-v4l2-request
)
# broken on x32 (bug #427004), and not PIC safe on x86 (bug #916067)
[[ ${ABI} == @(x32|x86) ]] && conf+=( --disable-asm )
# disable due to asm-related failures on ppc (bug #951464, ppc64be)
# https://trac.ffmpeg.org/ticket/9604 (ppc64el)
# https://trac.ffmpeg.org/ticket/10955 (ppc64el)
# (review re-enabling if resolved, or if debian allows it again)
use ppc || use ppc64 && conf+=( --disable-asm )
if tc-is-cross-compiler; then
conf+=(
--enable-cross-compile
--arch="$(tc-arch-kernel)"
--cross-prefix="${CHOST}-"
--host-cc="$(tc-getBUILD_CC)"
)
case ${CHOST} in
*mingw32*) conf+=( --target-os=mingw32 );;
*linux*) conf+=( --target-os=linux );;
esac
elif use arm; then
# TODO?: could *always* pass tc-arch-kernel, albeit that function
# is meant for the kernel and just mostly matches by accident
conf+=( --arch=arm ) #969514
fi
# skipping tests is handled at configure-time
local skip_tests=()
# zlib-ng is not bitexact w/ zlib producing mismatching md5sum (bug #965737)
has_version 'sys-libs/zlib-ng[compat]' &&
skip_tests+=(
lavf-{apng{,.png},gray16be.png,png,rgb48be.png}
mov-mp4-frag-flush
vsynth{1,2,3}-{flashsv,mpng,zlib}
)
(( ${#skip_tests[@]} )) &&
conf+=( --ignore-tests=$(IFS=,; echo "${skip_tests[*]}") )
# import options from FFMPEG_IUSE_MAP
local flag license mod v
local -A optmap=() licensemap=()
for v in "${FFMPEG_IUSE_MAP[@]}"; do
[[ ${v} =~ \+?([^:]+):?([^@]*)@?(.*) ]] || die "${v}"
flag=${BASH_REMATCH[1]}
license=${BASH_REMATCH[3]}
v=${BASH_REMATCH[2]:-${flag}}
for v in ${v//,/ }; do
mod=${v::1}
v=${v#[\!\^]}
if [[ ${mod} == '!' ]]; then
if use ${flag}; then
optmap[${v}]=--disable-${v}
unset licensemap[${v}]
fi
elif [[ ! -v optmap[${v}] ]]; then
if [[ ${mod} == '^' ]]; then
optmap[${v}]=$(multilib_native_use_enable ${flag} ${v})
else
optmap[${v}]=$(use_enable ${flag} ${v})
fi
use ${flag} && licensemap[${v}]=${license}
fi
done
done
for license in "${licensemap[@]}"; do
case ${license} in
v3ifgpl) use gpl || continue ;&
v3) optmap[v3]=--enable-version3 ;;
nonfree) use gpl && optmap[nonfree]=--enable-nonfree ;;
esac
done
conf+=(
"${optmap[@]}"
${EXTRA_ECONF}
)
einfo "${conf[*]}"
"${conf[@]}" || die "configure failed, see ${BUILD_DIR}/ffbuild/config.log"
}
multilib_src_compile() {
emake V=1
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 libffmpeg
}
multilib_src_test() {
local -x LD_LIBRARY_PATH=$(printf %s: "${BUILD_DIR}"/lib*)${LD_LIBRARY_PATH}
emake V=1 -k fate
}
multilib_src_install() {
emake V=1 DESTDIR="${D}" install
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 DESTDIR="${D}" install-libffmpeg
}
-596
View File
@@ -1,596 +0,0 @@
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs
FFMPEG_SOC_PATCH=ffmpeg-rpi-7.1.1.patch
FFMPEG_SUBSLOT=59.61.61 # avutil.avcodec.avformat SONAME
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
https://git.ffmpeg.org/ffmpeg.git
https://github.com/FFmpeg/FFmpeg.git
)
else
inherit verify-sig
SRC_URI="
https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz
verify-sig? ( https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz.asc )
${FFMPEG_SOC_PATCH:+"
soc? ( https://dev.gentoo.org/~chewi/distfiles/${FFMPEG_SOC_PATCH} )
"}
https://distfiles.gentoo.org/pub/dev/ionen@gentoo.org/ffmpeg-$(ver_cut 1-2)-patchset-4.tar.xz
"
S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} for ffmpeg-compat
KEYWORDS="amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
fi
DESCRIPTION="Complete solution to record/convert/stream audio and video"
HOMEPAGE="
https://ffmpeg.org/
https://code.ffmpeg.org/FFmpeg/FFmpeg/
"
[[ ${PN} == *-compat ]] && FFMPEG_UNSLOTTED= || FFMPEG_UNSLOTTED=1
FFMPEG_IUSE_MAP=(
# [+]flag[:[^][!]opt1,...][@<v3|nonfree>]], ^ = native-only, ! = override
# remember to keep LICENSE, REQUIRED_USE, and RESTRICT in sync
X:libxcb,libxcb-shape,libxcb-shm,libxcb-xfixes,xlib
alsa
amf
amrenc:libvo-amrwbenc@v3
amr:libopencore-amrnb,libopencore-amrwb@v3
appkit
bluray:libbluray
bs2b:libbs2b
bzip2:bzlib
cdio:libcdio
chromaprint
codec2:libcodec2
cuda-clang:cuda-llvm
+dav1d:libdav1d
${FFMPEG_UNSLOTTED:+doc:^htmlpages}
+drm:libdrm
dvd:libdvdnav,libdvdread
fdk:libfdk-aac@nonfree
flite:libflite
+fontconfig:libfontconfig
frei0r
fribidi:libfribidi
gcrypt
gme:libgme
gmp:@v3
+gnutls # unused if USE=openssl, default for bug #905113,#917627
+gpl
gsm:libgsm
iec61883:libiec61883
ieee1394:libdc1394
jack:libjack
jpeg2k:libopenjpeg
jpegxl:libjxl
kvazaar:libkvazaar
ladspa
lame:libmp3lame
lcms:lcms2
libaom
libaribb24:@v3 # reminder: req use on gpl unneeded if >=1.0.4 (not in tree)
+libass
libcaca
libilbc
liblc3
libplacebo
librtmp:librtmp
libsoxr
lv2
lzma
modplug:libmodplug
nvenc:cuvid,ffnvcodec,nvdec,nvenc
ocr:libtesseract
openal
opencl
opengl
openh264:libopenh264
openmpt:libopenmpt
openssl:openssl,!gnutls@v3ifgpl # still LGPL2.1+ if USE=-gpl
opus:libopus
+postproc # exposed as a USE for clarity with the GPL requirement
pulseaudio:libpulse
qrcode:libqrencode
qsv:libvpl
quirc:libquirc
rabbitmq:^librabbitmq # no multilib
rav1e:^librav1e # no multilib
rubberband:librubberband
samba:libsmbclient@v3 # GPL-3+ only
sdl:sdl2
shaderc:libshaderc
snappy:libsnappy
sndio
speex:libspeex
srt:libsrt
ssh:libssh
svg:librsvg
svt-av1:libsvtav1
theora:libtheora
+truetype:libfreetype,libharfbuzz
twolame:libtwolame
v4l:libv4l2
vaapi
vdpau
vidstab:libvidstab
vorbis:libvorbis
vpx:libvpx
vulkan
webp:libwebp
x264:libx264
x265:libx265
+xml:libxml2
xvid:libxvid
zeromq:^libzmq # no multilib
zimg:libzimg
+zlib
zvbi:libzvbi
)
# all-rights is used to express the GPL incompatibility (RESTRICT=bindist)
LICENSE="
gpl? (
GPL-2+
amr? ( GPL-3+ ) amrenc? ( GPL-3+ ) libaribb24? ( GPL-3+ )
gmp? ( GPL-3+ ) openssl? ( GPL-3+ )
fdk? ( all-rights-reserved )
)
!gpl? (
LGPL-2.1+
amr? ( LGPL-3+ ) amrenc? ( LGPL-3+ ) libaribb24? ( LGPL-3+ )
gmp? ( LGPL-3+ )
)
samba? ( GPL-3+ )
"
[[ ${FFMPEG_UNSLOTTED} ]] && : 0 || : "$(ver_cut 1)"
SLOT="${_}/${FFMPEG_SUBSLOT}"
IUSE="
${FFMPEG_IUSE_MAP[*]%:*}
${FFMPEG_UNSLOTTED:+chromium}
${FFMPEG_SOC_PATCH:+soc}
"
REQUIRED_USE="
cuda-clang? ( nvenc )
fribidi? ( truetype )
gmp? ( !librtmp )
libplacebo? ( vulkan )
shaderc? ( vulkan )
libaribb24? ( gpl ) cdio? ( gpl ) dvd? ( gpl ) frei0r? ( gpl )
postproc? ( gpl ) rubberband? ( gpl ) samba? ( gpl )
vidstab? ( gpl ) x264? ( gpl ) x265? ( gpl ) xvid? ( gpl )
${FFMPEG_UNSLOTTED:+chromium? ( opus )}
${FFMPEG_SOC_PATCH:+soc? ( drm )}
"
RESTRICT="gpl? ( fdk? ( bindist ) )"
# dlopen: amdgpu-pro-amf, vulkan-loader
COMMON_DEPEND="
virtual/libiconv[${MULTILIB_USEDEP}]
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/libxcb:=[${MULTILIB_USEDEP}]
)
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
amr? ( media-libs/opencore-amr[${MULTILIB_USEDEP}] )
amrenc? ( media-libs/vo-amrwbenc[${MULTILIB_USEDEP}] )
bluray? ( media-libs/libbluray:=[${MULTILIB_USEDEP}] )
bs2b? ( media-libs/libbs2b[${MULTILIB_USEDEP}] )
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
cdio? ( dev-libs/libcdio-paranoia:=[${MULTILIB_USEDEP}] )
chromaprint? ( media-libs/chromaprint:=[${MULTILIB_USEDEP}] )
codec2? ( media-libs/codec2:=[${MULTILIB_USEDEP}] )
dav1d? ( media-libs/dav1d:=[${MULTILIB_USEDEP}] )
dvd? (
media-libs/libdvdnav[${MULTILIB_USEDEP}]
media-libs/libdvdread:=[${MULTILIB_USEDEP}]
)
drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
fdk? ( media-libs/fdk-aac:=[${MULTILIB_USEDEP}] )
flite? ( app-accessibility/flite[${MULTILIB_USEDEP}] )
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
frei0r? ( media-plugins/frei0r-plugins[${MULTILIB_USEDEP}] )
fribidi? ( dev-libs/fribidi[${MULTILIB_USEDEP}] )
gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
gmp? ( dev-libs/gmp:=[${MULTILIB_USEDEP}] )
gnutls? ( !openssl? (
net-libs/gnutls:=[${MULTILIB_USEDEP}]
) )
gsm? ( media-sound/gsm[${MULTILIB_USEDEP}] )
iec61883? (
media-libs/libiec61883[${MULTILIB_USEDEP}]
sys-libs/libavc1394[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
ieee1394? (
media-libs/libdc1394:2=[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
jack? ( virtual/jack[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
jpegxl? ( media-libs/libjxl:=[${MULTILIB_USEDEP}] )
kvazaar? ( media-libs/kvazaar:=[${MULTILIB_USEDEP}] )
lame? ( media-sound/lame[${MULTILIB_USEDEP}] )
lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] )
libaom? ( media-libs/libaom:=[${MULTILIB_USEDEP}] )
libaribb24? ( media-libs/aribb24[${MULTILIB_USEDEP}] )
libass? ( media-libs/libass:=[${MULTILIB_USEDEP}] )
libcaca? ( media-libs/libcaca[${MULTILIB_USEDEP}] )
libilbc? ( media-libs/libilbc:=[${MULTILIB_USEDEP}] )
liblc3? ( >=media-sound/liblc3-1.1[${MULTILIB_USEDEP}] )
libplacebo? ( media-libs/libplacebo:=[vulkan,${MULTILIB_USEDEP}] )
librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] )
lv2? (
media-libs/lilv[${MULTILIB_USEDEP}]
media-libs/lv2[${MULTILIB_USEDEP}]
)
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
modplug? ( media-libs/libmodplug[${MULTILIB_USEDEP}] )
ocr? ( app-text/tesseract:=[${MULTILIB_USEDEP}] )
openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
opengl? ( media-libs/libglvnd[X,${MULTILIB_USEDEP}] )
openh264? ( media-libs/openh264:=[${MULTILIB_USEDEP}] )
openmpt? ( media-libs/libopenmpt[${MULTILIB_USEDEP}] )
openssl? ( >=dev-libs/openssl-3:=[${MULTILIB_USEDEP}] )
opus? ( media-libs/opus[${MULTILIB_USEDEP}] )
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
qrcode? ( media-gfx/qrencode:=[${MULTILIB_USEDEP}] )
qsv? ( media-libs/libvpl:=[${MULTILIB_USEDEP}] )
quirc? ( media-libs/quirc:=[${MULTILIB_USEDEP}] )
rabbitmq? ( net-libs/rabbitmq-c:= )
rav1e? ( >=media-video/rav1e-0.5:=[capi] )
rubberband? ( media-libs/rubberband:=[${MULTILIB_USEDEP}] )
samba? ( net-fs/samba:=[client,${MULTILIB_USEDEP}] )
sdl? (
media-libs/libsdl2[sound(+),video(+),${MULTILIB_USEDEP}]
libplacebo? ( media-libs/libsdl2[vulkan] )
)
shaderc? ( media-libs/shaderc[${MULTILIB_USEDEP}] )
snappy? ( app-arch/snappy:=[${MULTILIB_USEDEP}] )
sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
speex? ( media-libs/speex[${MULTILIB_USEDEP}] )
srt? ( net-libs/srt:=[${MULTILIB_USEDEP}] )
ssh? ( net-libs/libssh:=[sftp,${MULTILIB_USEDEP}] )
svg? (
dev-libs/glib:2[${MULTILIB_USEDEP}]
>=gnome-base/librsvg-2.52:2[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
)
svt-av1? ( >=media-libs/svt-av1-0.9:=[${MULTILIB_USEDEP}] )
theora? ( media-libs/libtheora:=[encode,${MULTILIB_USEDEP}] )
truetype? (
media-libs/freetype:2[${MULTILIB_USEDEP}]
media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
)
twolame? ( media-sound/twolame[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( media-libs/libva:=[X?,${MULTILIB_USEDEP}] )
vdpau? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libvdpau[${MULTILIB_USEDEP}]
)
vidstab? ( media-libs/vidstab[${MULTILIB_USEDEP}] )
vorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
vpx? ( media-libs/libvpx:=[${MULTILIB_USEDEP}] )
vulkan? ( media-libs/vulkan-loader[${MULTILIB_USEDEP}] )
webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
x264? ( media-libs/x264:=[${MULTILIB_USEDEP}] )
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )
xml? ( dev-libs/libxml2:=[${MULTILIB_USEDEP}] )
xvid? ( media-libs/xvid[${MULTILIB_USEDEP}] )
zeromq? ( net-libs/zeromq:= )
zimg? ( media-libs/zimg[${MULTILIB_USEDEP}] )
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
zvbi? ( media-libs/zvbi[${MULTILIB_USEDEP}] )
${FFMPEG_SOC_PATCH:+"
soc? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
"}
"
RDEPEND="
${COMMON_DEPEND}
amf? ( media-video/amdgpu-pro-amf )
"
DEPEND="
${COMMON_DEPEND}
X? ( x11-base/xorg-proto )
amf? ( media-libs/amf-headers )
kernel_linux? ( >=sys-kernel/linux-headers-6 )
ladspa? ( media-libs/ladspa-sdk )
nvenc? ( >=media-libs/nv-codec-headers-12.1.14.0 )
opencl? ( dev-util/opencl-headers )
vulkan? ( dev-util/vulkan-headers )
"
BDEPEND="
app-alternatives/awk
virtual/pkgconfig
amd64? (
|| (
dev-lang/nasm
dev-lang/yasm
)
)
cuda-clang? ( llvm-core/clang:*[llvm_targets_NVPTX] )
${FFMPEG_UNSLOTTED:+"
dev-lang/perl
doc? ( sys-apps/texinfo )
"}
"
[[ ${PV} != 9999 ]] &&
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-ffmpeg )"
DOCS=( CREDITS Changelog README.md doc/APIchanges )
[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/libavutil/avconfig.h
)
PATCHES=(
"${WORKDIR}"/patches
)
pkg_pretend() {
# TODO: drop this after a few months
if has_version "${CATEGORY}/${PN}[mp3]" && use !lame; then #952971
ewarn "${PN}'s 'mp3' USE was renamed to 'lame', please enable it"
ewarn "if wish to keep the ability to encode using media-sound/lame."
ewarn "This is *not* needed if only want mp3 playback."
fi
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] || return
if use chromaprint && has_version 'media-libs/chromaprint[tools]'; then
ewarn "media-libs/chromaprint is installed with USE=tools which links to"
ewarn "ffmpeg, and USE=chromaprint is enabled on ffmpeg which links to"
ewarn "chromaprint (circular). This may cause issues when updating ffmpeg."
ewarn
ewarn "If get a build failure with 'ERROR: chromaprint not found' or so,"
ewarn "first rebuild chromaprint with USE=-tools, then rebuild ffmpeg, and"
ewarn "then finally rebuild chromaprint with USE=tools again (bug #862996)."
fi
[[ ${EXTRA_FFMPEG_CONF} ]] && # drop this eventually
die "EXTRA_FFMPEG_CONF is set in the environment, please use EXTRA_ECONF instead"
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
use verify-sig &&
verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \
"${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc
default
fi
}
src_prepare() {
in_iuse chromium && PATCHES+=( "${FILESDIR}"/chromium-r3.patch )
in_iuse soc && use soc && PATCHES+=( "${DISTDIR}"/${FFMPEG_SOC_PATCH} )
default
# respect user preferences
sed -i '/cflags -fdiagnostics-color/d' configure || die
# handle here to avoid repeating for each ABI below (bug #923491)
FFMPEG_ENABLE_LTO=
if tc-is-lto; then
: "$(get-flag -flto)" # get -flto=<val> (e.g. =thin)
FFMPEG_ENABLE_LTO=--enable-lto${_#-flto}
tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835
fi
filter-lto
}
multilib_src_configure() {
local conf=( "${S}"/configure ) # not autotools-based
local prefix=${EPREFIX}/usr
if [[ ! ${FFMPEG_UNSLOTTED} ]]; then
prefix+=/lib/ffmpeg${SLOT%/*}
# could get SONAME clashes, so prefer rpath over LDPATH
conf+=(
--enable-rpath
--disable-doc
)
fi
conf+=(
--prefix="${prefix}"
--libdir="${prefix}"/$(get_libdir)
--shlibdir="${prefix}"/$(get_libdir)
--mandir="${prefix}"/share/man
--docdir="${EPREFIX}"/usr/share/doc/${PF}/html
--ar="$(tc-getAR)"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--nm="$(tc-getNM)"
--pkg-config="$(tc-getPKG_CONFIG)"
--ranlib="$(tc-getRANLIB)"
--disable-stripping
# overrides users' -g/-O, let *FLAGS handle these
--disable-debug
--disable-optimizations
--optflags=' '
# pass option over *FLAGS due to special logic (bug #566282,#754654)
${FFMPEG_ENABLE_LTO}
# basic defaults that should not really need a USE
--enable-iconv
--enable-pic
--enable-shared
--disable-static
$(multilib_native_enable manpages) # needs pod2man
--disable-podpages
--disable-txtpages
# disabled primarily due to being unpackaged
--disable-decklink
--disable-libaribcaption
--disable-libdavs2
--disable-libklvanc
--disable-liblcevc-dec
--disable-libmysofa
--disable-libopenvino
--disable-libshine
--disable-libtls
--disable-libuavs3d
--disable-libvvenc
--disable-libxavs
--disable-libxavs2
--disable-libxevd
--disable-libxeve
--disable-pocketsphinx
--disable-rkmpp
--disable-vapoursynth
# disabled for other or additional reasons
--disable-cuda-nvcc # prefer cuda-llvm for less issues
--disable-libcelt # obsolete (bug #664158)
--disable-libglslang # prefer USE=shaderc (bug #918989,#920283,#922333)
--disable-liblensfun # https://trac.ffmpeg.org/ticket/9112 (abandoned?)
--disable-libmfx # prefer libvpl for USE=qsv
--disable-libnpp # deprecated and not supported for cuda 13.0+
--disable-libopencv # leaving for later due to circular opencv[ffmpeg]
--disable-librist # currently only supported in >=ffmpeg-8 ebuilds
--disable-libtensorflow # causes headaches, and is gone
--disable-libtorch # support may need special attention (bug #936127)
--disable-libvmaf # use ffmpeg-8+ instead, needs old vmaf (bug #968554)
--disable-mbedtls # messy with slots, tests underlinking issues
--disable-mmal # prefer USE=soc
--disable-omx # unsupported (bug #653386)
--disable-omx-rpi # ^
# to avoid obscure issues like bug #915384 and simplify the ebuild,
# not passing the following (use EXTRA_ECONF if really must):
# --cpu: adds -march=<exact> after the user's more adapted
# =native, its logic also does not account for -mno-*
# --disable/enable-<cpufeature>: safer to detect at runtime
)
in_iuse soc && use soc &&
conf+=(
--disable-epoxy
--enable-libudev
--enable-sand
--enable-v4l2-request
)
# broken on x32 (bug #427004), and not PIC safe on x86 (bug #916067)
[[ ${ABI} == @(x32|x86) ]] && conf+=( --disable-asm )
# disable due to asm-related failures on ppc (bug #951464, ppc64be)
# https://trac.ffmpeg.org/ticket/9604 (ppc64el)
# https://trac.ffmpeg.org/ticket/10955 (ppc64el)
# (review re-enabling if resolved, or if debian allows it again)
use ppc || use ppc64 && conf+=( --disable-asm )
if tc-is-cross-compiler; then
conf+=(
--enable-cross-compile
--arch="$(tc-arch-kernel)"
--cross-prefix="${CHOST}-"
--host-cc="$(tc-getBUILD_CC)"
)
case ${CHOST} in
*mingw32*) conf+=( --target-os=mingw32 );;
*linux*) conf+=( --target-os=linux );;
esac
elif use arm; then
# TODO?: could *always* pass tc-arch-kernel, albeit that function
# is meant for the kernel and just mostly matches by accident
conf+=( --arch=arm ) #969514
fi
# skipping tests is handled at configure-time
local skip_tests=()
# zlib-ng is not bitexact w/ zlib producing mismatching md5sum (bug #965737)
has_version 'sys-libs/zlib-ng[compat]' &&
skip_tests+=(
lavf-{apng{,.png},gray16be.png,png,rgb48be.png}
mov-mp4-frag-flush
vsynth{1,2,3}-{flashsv,mpng,zlib}
)
(( ${#skip_tests[@]} )) &&
conf+=( --ignore-tests=$(IFS=,; echo "${skip_tests[*]}") )
# import options from FFMPEG_IUSE_MAP
local flag license mod v
local -A optmap=() licensemap=()
for v in "${FFMPEG_IUSE_MAP[@]}"; do
[[ ${v} =~ \+?([^:]+):?([^@]*)@?(.*) ]] || die "${v}"
flag=${BASH_REMATCH[1]}
license=${BASH_REMATCH[3]}
v=${BASH_REMATCH[2]:-${flag}}
for v in ${v//,/ }; do
mod=${v::1}
v=${v#[\!\^]}
if [[ ${mod} == '!' ]]; then
if use ${flag}; then
optmap[${v}]=--disable-${v}
unset licensemap[${v}]
fi
elif [[ ! -v optmap[${v}] ]]; then
if [[ ${mod} == '^' ]]; then
optmap[${v}]=$(multilib_native_use_enable ${flag} ${v})
else
optmap[${v}]=$(use_enable ${flag} ${v})
fi
use ${flag} && licensemap[${v}]=${license}
fi
done
done
for license in "${licensemap[@]}"; do
case ${license} in
v3ifgpl) use gpl || continue ;&
v3) optmap[v3]=--enable-version3 ;;
nonfree) use gpl && optmap[nonfree]=--enable-nonfree ;;
esac
done
conf+=(
"${optmap[@]}"
${EXTRA_ECONF}
)
einfo "${conf[*]}"
"${conf[@]}" || die "configure failed, see ${BUILD_DIR}/ffbuild/config.log"
}
multilib_src_compile() {
emake V=1
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 libffmpeg
}
multilib_src_test() {
local -x LD_LIBRARY_PATH=$(printf %s: "${BUILD_DIR}"/lib*)${LD_LIBRARY_PATH}
emake V=1 -k fate
}
multilib_src_install() {
emake V=1 DESTDIR="${D}" install
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 DESTDIR="${D}" install-libffmpeg
}
-639
View File
@@ -1,639 +0,0 @@
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs udev
FFMPEG_SOC_PATCH=ffmpeg-soc-8.1.patch
FFMPEG_SUBSLOT=60.62.62 # avutil.avcodec.avformat SONAME
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
https://git.ffmpeg.org/ffmpeg.git
https://github.com/FFmpeg/FFmpeg.git
)
else
inherit verify-sig
SRC_URI="
https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz
verify-sig? ( https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz.asc )
${FFMPEG_SOC_PATCH:+"
soc? ( https://dev.gentoo.org/~chewi/distfiles/${FFMPEG_SOC_PATCH} )
"}
"
S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} for ffmpeg-compat
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ~ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
fi
DESCRIPTION="Complete solution to record/convert/stream audio and video"
HOMEPAGE="
https://ffmpeg.org/
https://code.ffmpeg.org/FFmpeg/FFmpeg/
"
[[ ${PN} == *-compat ]] && FFMPEG_UNSLOTTED= || FFMPEG_UNSLOTTED=1
FFMPEG_IUSE_MAP=(
# [+]flag[:[^][!]opt1,...][@<v3|nonfree>]], ^ = native-only, ! = override
# remember to keep LICENSE, REQUIRED_USE, and RESTRICT in sync
X:libxcb,libxcb-shape,libxcb-shm,libxcb-xfixes,xlib
alsa
amf
amrenc:libvo-amrwbenc@v3
amr:libopencore-amrnb,libopencore-amrwb@v3
appkit
bluray:libbluray
bs2b:libbs2b
bzip2:bzlib
cairo
cdio:libcdio
chromaprint
codec2:libcodec2
cuda-clang:cuda-llvm
+dav1d:libdav1d
${FFMPEG_UNSLOTTED:+doc:^htmlpages}
+drm:libdrm
dvd:libdvdnav,libdvdread
fdk:libfdk-aac@nonfree
flite:libflite
+fontconfig:libfontconfig
frei0r
fribidi:libfribidi
gcrypt
gme:libgme
gmp:@v3
+gnutls # unused if USE=openssl, default for bug #905113,#917627
+gpl
gsm:libgsm
iec61883:libiec61883
ieee1394:libdc1394
jack:libjack
jpeg2k:libopenjpeg
jpegxl:libjxl
kvazaar:libkvazaar
ladspa
lame:libmp3lame
lcms:lcms2
libaom
libaribb24:@v3 # reminder: req use on gpl unneeded if >=1.0.4 (not in tree)
+libass
libcaca
libilbc
liblc3
libplacebo
librtmp:librtmp
libsoxr
lv2
lzma
modplug:libmodplug
nvenc:cuvid,ffnvcodec,nvdec,nvenc
opencolorio:^libopencolorio # no multilib
ocr:libtesseract
openal
opencl
opengl
openh264:libopenh264
openmpt:libopenmpt
openssl:openssl,!gnutls@v3ifgpl # still LGPL2.1+ if USE=-gpl
opus:libopus
pulseaudio:libpulse
qrcode:libqrencode
qsv:libvpl
quirc:libquirc
rabbitmq:^librabbitmq # no multilib
rav1e:^librav1e # no multilib
rist:^librist # no multilib
rubberband:librubberband
samba:libsmbclient@v3 # GPL-3+ only
sdl:sdl2
snappy:libsnappy
sndio
speex:libspeex
srt:libsrt
ssh:libssh
svg:librsvg
svt-av1:libsvtav1
theora:libtheora
+truetype:libfreetype,libharfbuzz
twolame:libtwolame
v4l:libv4l2
vaapi
vdpau
vidstab:libvidstab
vmaf:libvmaf
vorbis:libvorbis
vpx:libvpx
# libshaderc: merged here given shaderc is needed at build-time
# either way and many vulkan features depend on spirv_library
# vulkan-static: it still uses shared, only means no dlopen()
vulkan:libshaderc,vulkan,vulkan-static
webp:libwebp
x264:libx264
x265:libx265
+xml:libxml2
xvid:libxvid
zeromq:^libzmq # no multilib
zimg:libzimg
+zlib
zvbi:libzvbi
)
# all-rights is used to express the GPL incompatibility (RESTRICT=bindist)
LICENSE="
gpl? (
GPL-2+
amr? ( GPL-3+ ) amrenc? ( GPL-3+ ) libaribb24? ( GPL-3+ )
gmp? ( GPL-3+ ) openssl? ( GPL-3+ )
fdk? ( all-rights-reserved )
)
!gpl? (
LGPL-2.1+
amr? ( LGPL-3+ ) amrenc? ( LGPL-3+ ) libaribb24? ( LGPL-3+ )
gmp? ( LGPL-3+ )
)
samba? ( GPL-3+ )
"
[[ ${FFMPEG_UNSLOTTED} ]] && : 0 || : "$(ver_cut 1)"
SLOT="${_}/${FFMPEG_SUBSLOT}"
IUSE="
${FFMPEG_IUSE_MAP[*]%:*}
${FFMPEG_UNSLOTTED:+chromium}
${FFMPEG_SOC_PATCH:+soc}
"
REQUIRED_USE="
cuda-clang? ( nvenc )
fribidi? ( truetype )
gmp? ( !librtmp )
libplacebo? ( vulkan )
libaribb24? ( gpl ) cdio? ( gpl ) dvd? ( gpl ) frei0r? ( gpl )
rubberband? ( gpl ) samba? ( gpl ) vidstab? ( gpl ) x264? ( gpl )
x265? ( gpl ) xvid? ( gpl )
${FFMPEG_UNSLOTTED:+chromium? ( opus )}
${FFMPEG_SOC_PATCH:+soc? ( drm )}
"
RESTRICT="gpl? ( fdk? ( bindist ) )"
# dlopen: amdgpu-pro-amf
COMMON_DEPEND="
virtual/libiconv[${MULTILIB_USEDEP}]
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/libxcb:=[${MULTILIB_USEDEP}]
)
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
amr? ( media-libs/opencore-amr[${MULTILIB_USEDEP}] )
amrenc? ( media-libs/vo-amrwbenc[${MULTILIB_USEDEP}] )
bluray? ( media-libs/libbluray:=[${MULTILIB_USEDEP}] )
bs2b? ( media-libs/libbs2b[${MULTILIB_USEDEP}] )
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
cairo? ( x11-libs/cairo[${MULTILIB_USEDEP}] )
cdio? ( dev-libs/libcdio-paranoia:=[${MULTILIB_USEDEP}] )
chromaprint? ( media-libs/chromaprint:=[${MULTILIB_USEDEP}] )
codec2? ( media-libs/codec2:=[${MULTILIB_USEDEP}] )
dav1d? ( media-libs/dav1d:=[${MULTILIB_USEDEP}] )
dvd? (
media-libs/libdvdnav[${MULTILIB_USEDEP}]
media-libs/libdvdread:=[${MULTILIB_USEDEP}]
)
drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
fdk? ( media-libs/fdk-aac:=[${MULTILIB_USEDEP}] )
flite? ( app-accessibility/flite[${MULTILIB_USEDEP}] )
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
frei0r? ( media-plugins/frei0r-plugins[${MULTILIB_USEDEP}] )
fribidi? ( dev-libs/fribidi[${MULTILIB_USEDEP}] )
gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
gmp? ( dev-libs/gmp:=[${MULTILIB_USEDEP}] )
gnutls? ( !openssl? (
net-libs/gnutls:=[${MULTILIB_USEDEP}]
) )
gsm? ( media-sound/gsm[${MULTILIB_USEDEP}] )
iec61883? (
media-libs/libiec61883[${MULTILIB_USEDEP}]
sys-libs/libavc1394[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
ieee1394? (
media-libs/libdc1394:2=[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
jack? ( virtual/jack[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
jpegxl? ( media-libs/libjxl:=[${MULTILIB_USEDEP}] )
kvazaar? ( media-libs/kvazaar:=[${MULTILIB_USEDEP}] )
lame? ( media-sound/lame[${MULTILIB_USEDEP}] )
lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] )
libaom? ( media-libs/libaom:=[${MULTILIB_USEDEP}] )
libaribb24? ( media-libs/aribb24[${MULTILIB_USEDEP}] )
libass? ( media-libs/libass:=[${MULTILIB_USEDEP}] )
libcaca? ( media-libs/libcaca[${MULTILIB_USEDEP}] )
libilbc? ( media-libs/libilbc:=[${MULTILIB_USEDEP}] )
liblc3? ( >=media-sound/liblc3-1.1[${MULTILIB_USEDEP}] )
libplacebo? ( media-libs/libplacebo:=[vulkan,${MULTILIB_USEDEP}] )
librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] )
lv2? (
media-libs/lilv[${MULTILIB_USEDEP}]
media-libs/lv2[${MULTILIB_USEDEP}]
)
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
modplug? ( media-libs/libmodplug[${MULTILIB_USEDEP}] )
opencolorio? ( media-libs/opencolorio:= )
ocr? ( app-text/tesseract:=[${MULTILIB_USEDEP}] )
openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
opengl? ( media-libs/libglvnd[X,${MULTILIB_USEDEP}] )
openh264? ( media-libs/openh264:=[${MULTILIB_USEDEP}] )
openmpt? ( media-libs/libopenmpt[${MULTILIB_USEDEP}] )
openssl? ( >=dev-libs/openssl-3:=[${MULTILIB_USEDEP}] )
opus? ( media-libs/opus[${MULTILIB_USEDEP}] )
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
qrcode? ( media-gfx/qrencode:=[${MULTILIB_USEDEP}] )
qsv? ( media-libs/libvpl:=[${MULTILIB_USEDEP}] )
quirc? ( media-libs/quirc:=[${MULTILIB_USEDEP}] )
rabbitmq? ( net-libs/rabbitmq-c:= )
rav1e? ( >=media-video/rav1e-0.5:=[capi] )
rist? ( net-libs/librist )
rubberband? ( media-libs/rubberband:=[${MULTILIB_USEDEP}] )
samba? ( net-fs/samba:=[client,${MULTILIB_USEDEP}] )
sdl? (
media-libs/libsdl2[sound(+),video(+),${MULTILIB_USEDEP}]
libplacebo? ( media-libs/libsdl2[vulkan] )
)
snappy? ( app-arch/snappy:=[${MULTILIB_USEDEP}] )
sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
speex? ( media-libs/speex[${MULTILIB_USEDEP}] )
srt? ( net-libs/srt:=[${MULTILIB_USEDEP}] )
ssh? ( net-libs/libssh:=[sftp,${MULTILIB_USEDEP}] )
svg? (
dev-libs/glib:2[${MULTILIB_USEDEP}]
>=gnome-base/librsvg-2.52:2[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
)
svt-av1? ( >=media-libs/svt-av1-0.9:=[${MULTILIB_USEDEP}] )
theora? ( media-libs/libtheora:=[encode,${MULTILIB_USEDEP}] )
truetype? (
media-libs/freetype:2[${MULTILIB_USEDEP}]
media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
)
twolame? ( media-sound/twolame[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( media-libs/libva:=[X?,${MULTILIB_USEDEP}] )
vdpau? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libvdpau[${MULTILIB_USEDEP}]
)
vidstab? ( media-libs/vidstab[${MULTILIB_USEDEP}] )
vmaf? ( media-libs/libvmaf:=[${MULTILIB_USEDEP}] )
vorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
vpx? ( media-libs/libvpx:=[${MULTILIB_USEDEP}] )
vulkan? (
media-libs/shaderc[${MULTILIB_USEDEP}]
media-libs/vulkan-loader[${MULTILIB_USEDEP}]
)
webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
x264? ( media-libs/x264:=[${MULTILIB_USEDEP}] )
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )
xml? ( dev-libs/libxml2:=[${MULTILIB_USEDEP}] )
xvid? ( media-libs/xvid[${MULTILIB_USEDEP}] )
zeromq? ( net-libs/zeromq:= )
zimg? ( media-libs/zimg[${MULTILIB_USEDEP}] )
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
zvbi? ( media-libs/zvbi[${MULTILIB_USEDEP}] )
${FFMPEG_SOC_PATCH:+"
soc? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
"}
"
RDEPEND="
${COMMON_DEPEND}
amf? ( media-video/amdgpu-pro-amf )
"
DEPEND="
${COMMON_DEPEND}
X? ( x11-base/xorg-proto )
amf? ( >=media-libs/amf-headers-1.5.0 )
kernel_linux? ( >=sys-kernel/linux-headers-6 )
ladspa? ( media-libs/ladspa-sdk )
nvenc? ( >=media-libs/nv-codec-headers-12.1.14.0 )
opencl? ( dev-util/opencl-headers )
vulkan? ( >=dev-util/vulkan-headers-1.4.317 )
"
BDEPEND="
app-alternatives/awk
virtual/pkgconfig
amd64? ( dev-lang/nasm )
cuda-clang? ( llvm-core/clang:*[llvm_targets_NVPTX] )
vulkan? ( media-libs/shaderc )
${FFMPEG_UNSLOTTED:+"
dev-lang/perl
doc? ( sys-apps/texinfo )
"}
"
[[ ${PV} != 9999 ]] &&
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-ffmpeg )"
DOCS=( CREDITS Changelog README.md doc/APIchanges )
[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/libavutil/avconfig.h
)
PATCHES=(
"${FILESDIR}"/ffmpeg-6.1-opencl-parallel-gmake-fix.patch
)
pkg_pretend() {
# TODO: drop this after a few months
if has_version "${CATEGORY}/${PN}[mp3]" && use !lame; then #952971
ewarn "${PN}'s 'mp3' USE was renamed to 'lame', please enable it"
ewarn "if wish to keep the ability to encode using media-sound/lame."
ewarn "This is *not* needed if only want mp3 playback."
fi
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] || return
if use chromaprint && has_version 'media-libs/chromaprint[tools]'; then
ewarn "media-libs/chromaprint is installed with USE=tools which links to"
ewarn "ffmpeg, and USE=chromaprint is enabled on ffmpeg which links to"
ewarn "chromaprint (circular). This may cause issues when updating ffmpeg."
ewarn
ewarn "If get a build failure with 'ERROR: chromaprint not found' or so,"
ewarn "first rebuild chromaprint with USE=-tools, then rebuild ffmpeg, and"
ewarn "then finally rebuild chromaprint with USE=tools again (bug #862996)."
fi
[[ ${EXTRA_FFMPEG_CONF} ]] && # drop this eventually
die "EXTRA_FFMPEG_CONF is set in the environment, please use EXTRA_ECONF instead"
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
use verify-sig &&
verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \
"${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc
default
fi
}
src_prepare() {
in_iuse chromium && PATCHES+=( "${FILESDIR}"/chromium-r3.patch )
in_iuse soc && use soc && PATCHES+=( "${DISTDIR}"/${FFMPEG_SOC_PATCH} )
default
# respect user preferences
sed -i '/cflags -fdiagnostics-color/d' configure || die
# handle here to avoid repeating for each ABI below (bug #923491)
FFMPEG_ENABLE_LTO=
if tc-is-lto; then
: "$(get-flag -flto)" # get -flto=<val> (e.g. =thin)
FFMPEG_ENABLE_LTO=--enable-lto${_#-flto}
tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835
fi
filter-lto
# workaround ICE with <gcc-16.1.1_p20260606:16 (bug #973641)
# TODO: kept to let people update, cleanup after a few months
tc-is-gcc && [[ $(gcc-major-version) -eq 16 ]] &&
has_version -b '<sys-devel/gcc-16.1.1_p20260606:16' &&
append-flags -fno-tree-vectorize
}
multilib_src_configure() {
local conf=( "${S}"/configure ) # not autotools-based
local prefix=${EPREFIX}/usr
if [[ ! ${FFMPEG_UNSLOTTED} ]]; then
prefix+=/lib/ffmpeg${SLOT%/*}
# could get SONAME clashes, so prefer rpath over LDPATH
conf+=(
--enable-rpath
--disable-doc
)
fi
conf+=(
--prefix="${prefix}"
--libdir="${prefix}"/$(get_libdir)
--shlibdir="${prefix}"/$(get_libdir)
--mandir="${prefix}"/share/man
--docdir="${EPREFIX}"/usr/share/doc/${PF}/html
--ar="$(tc-getAR)"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--nm="$(tc-getNM)"
--pkg-config="$(tc-getPKG_CONFIG)"
--ranlib="$(tc-getRANLIB)"
--disable-stripping
# overrides users' -g/-O, let *FLAGS handle these
--disable-debug
--disable-optimizations
--optflags=' '
# pass option over *FLAGS due to special logic (bug #566282,#754654)
${FFMPEG_ENABLE_LTO}
# basic defaults that should not really need a USE
--enable-iconv
--enable-pic
--enable-shared
--disable-static
$(multilib_native_enable manpages) # needs pod2man
--disable-podpages
--disable-txtpages
# disabled primarily due to being unpackaged
--disable-decklink
--disable-libaribcaption
--disable-libdavs2
--disable-libklvanc
--disable-liblcevc-dec
--disable-libmpeghdec
--disable-libmysofa
--disable-liboapv
--disable-libopenvino
--disable-libshine
--disable-libsvtjpegxs
--disable-libtls
--disable-libuavs3d
--disable-libvvenc
--disable-libxavs
--disable-libxavs2
--disable-libxevd
--disable-libxevdb
--disable-libxeve
--disable-libxeveb
--disable-ohcodec
--disable-pocketsphinx
--disable-rkmpp
--disable-vapoursynth
--disable-whisper
# disabled for other or additional reasons
--disable-cuda-nvcc # prefer cuda-llvm for less issues
--disable-libcelt # obsolete (bug #664158)
--disable-libglslang # prefer shaderc (bug #918989,#920283,#922333)
--disable-liblensfun # https://trac.ffmpeg.org/ticket/9112 (abandoned?)
--disable-libmfx # prefer libvpl for USE=qsv
--disable-libnpp # deprecated and not supported for cuda 13.0+
--disable-libopencv # leaving for later due to circular opencv[ffmpeg]
--disable-libtensorflow # causes headaches, and is gone
--disable-libtorch # support may need special attention (bug #936127)
--disable-mbedtls # messy with slots, tests underlinking issues
--disable-mmal # prefer USE=soc
--disable-omx # unsupported (bug #653386)
--disable-omx-rpi # ^
# to avoid obscure issues like bug #915384 and simplify the ebuild,
# not passing the following (use EXTRA_ECONF if really must):
# --cpu: adds -march=<exact> after the user's more adapted
# =native, its logic also does not account for -mno-*
# --disable/enable-<cpufeature>: safer to detect at runtime
)
in_iuse soc && use soc &&
conf+=(
--enable-libudev
--enable-sand
--enable-v4l2-request
)
# broken on x32 (bug #427004), and not PIC safe on x86 (bug #916067)
[[ ${ABI} == @(x32|x86) ]] && conf+=( --disable-asm )
# disable due to asm-related failures on ppc (bug #951464, ppc64be)
# https://trac.ffmpeg.org/ticket/9604 (ppc64el)
# https://trac.ffmpeg.org/ticket/10955 (ppc64el)
# (review re-enabling if resolved, or if debian allows it again)
use ppc || use ppc64 && conf+=( --disable-asm )
if tc-is-cross-compiler; then
conf+=(
--enable-cross-compile
--arch="$(tc-arch-kernel)"
--cross-prefix="${CHOST}-"
--host-cc="$(tc-getBUILD_CC)"
)
case ${CHOST} in
*mingw32*) conf+=( --target-os=mingw32 );;
*linux*) conf+=( --target-os=linux );;
esac
elif use arm; then
# TODO?: could *always* pass tc-arch-kernel, albeit that function
# is meant for the kernel and just mostly matches by accident
conf+=( --arch=arm ) #969514
fi
# skipping tests is handled at configure-time
local skip_tests=()
# tests known failing on BE arches, skip for now given potential
# fixes are complex and would rather wait for fixed release
# (shouldn't impact most BE users, scarcely used features)
# https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/22564
# https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22274
[[ $(tc-endian) == big ]] &&
skip_tests+=(
filter-drawvg-video
vsynth{1,2,3}-ffvhuff420p12
)
# zlib-ng is not bitexact w/ zlib producing mismatching md5sum (bug #965737)
has_version 'sys-libs/zlib-ng[compat]' &&
skip_tests+=(
lavf-{apng{,.png},gray16be.png,png,rgb48be.png}
mov-mp4-frag-flush
vsynth{1,2,3}-{flashsv,mpng,zlib}
)
(( ${#skip_tests[@]} )) &&
conf+=( --ignore-tests=$(IFS=,; echo "${skip_tests[*]}") )
# import options from FFMPEG_IUSE_MAP
local flag license mod v
local -A optmap=() licensemap=()
for v in "${FFMPEG_IUSE_MAP[@]}"; do
[[ ${v} =~ \+?([^:]+):?([^@]*)@?(.*) ]] || die "${v}"
flag=${BASH_REMATCH[1]}
license=${BASH_REMATCH[3]}
v=${BASH_REMATCH[2]:-${flag}}
for v in ${v//,/ }; do
mod=${v::1}
v=${v#[\!\^]}
if [[ ${mod} == '!' ]]; then
if use ${flag}; then
optmap[${v}]=--disable-${v}
unset licensemap[${v}]
fi
elif [[ ! -v optmap[${v}] ]]; then
if [[ ${mod} == '^' ]]; then
optmap[${v}]=$(multilib_native_use_enable ${flag} ${v})
else
optmap[${v}]=$(use_enable ${flag} ${v})
fi
use ${flag} && licensemap[${v}]=${license}
fi
done
done
for license in "${licensemap[@]}"; do
case ${license} in
v3ifgpl) use gpl || continue ;&
v3) optmap[v3]=--enable-version3 ;;
nonfree) use gpl && optmap[nonfree]=--enable-nonfree ;;
esac
done
conf+=(
"${optmap[@]}"
${EXTRA_ECONF}
)
einfo "${conf[*]}"
"${conf[@]}" || die "configure failed, see ${BUILD_DIR}/ffbuild/config.log"
}
multilib_src_compile() {
mkdir -p fftools/resources/ || die #965687
mkdir -p libav{codec,filter}/vulkan/ || die #974907
emake V=1
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 libffmpeg
}
multilib_src_test() {
local -x LD_LIBRARY_PATH=$(printf %s: "${BUILD_DIR}"/lib*)${LD_LIBRARY_PATH}
emake V=1 -k fate
}
multilib_src_install() {
emake V=1 DESTDIR="${D}" install
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 DESTDIR="${D}" install-libffmpeg
}
multilib_src_install_all() {
in_iuse soc && use soc && udev_dorules "${FILESDIR}"/60-dma-heap-ffmpeg.rules
einstalldocs
}
pkg_postinst() {
in_iuse soc && use soc && udev_reload
}
pkg_postrm() {
in_iuse soc && use soc && udev_reload
}
-639
View File
@@ -1,639 +0,0 @@
# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit flag-o-matic multilib-minimal toolchain-funcs udev
FFMPEG_SOC_PATCH=ffmpeg-soc-8.1.patch
FFMPEG_SUBSLOT=60.62.62 # avutil.avcodec.avformat SONAME
if [[ ${PV} == 9999 ]]; then
inherit git-r3
EGIT_REPO_URI=(
https://git.ffmpeg.org/ffmpeg.git
https://github.com/FFmpeg/FFmpeg.git
)
else
inherit verify-sig
SRC_URI="
https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz
verify-sig? ( https://ffmpeg.org/releases/ffmpeg-${PV}.tar.xz.asc )
${FFMPEG_SOC_PATCH:+"
soc? ( https://dev.gentoo.org/~chewi/distfiles/${FFMPEG_SOC_PATCH} )
"}
"
S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} for ffmpeg-compat
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~mips ppc ppc64 ~riscv ~sparc x86 ~arm64-macos ~x64-macos"
fi
DESCRIPTION="Complete solution to record/convert/stream audio and video"
HOMEPAGE="
https://ffmpeg.org/
https://code.ffmpeg.org/FFmpeg/FFmpeg/
"
[[ ${PN} == *-compat ]] && FFMPEG_UNSLOTTED= || FFMPEG_UNSLOTTED=1
FFMPEG_IUSE_MAP=(
# [+]flag[:[^][!]opt1,...][@<v3|nonfree>]], ^ = native-only, ! = override
# remember to keep LICENSE, REQUIRED_USE, and RESTRICT in sync
X:libxcb,libxcb-shape,libxcb-shm,libxcb-xfixes,xlib
alsa
amf
amrenc:libvo-amrwbenc@v3
amr:libopencore-amrnb,libopencore-amrwb@v3
appkit
bluray:libbluray
bs2b:libbs2b
bzip2:bzlib
cairo
cdio:libcdio
chromaprint
codec2:libcodec2
cuda-clang:cuda-llvm
+dav1d:libdav1d
${FFMPEG_UNSLOTTED:+doc:^htmlpages}
+drm:libdrm
dvd:libdvdnav,libdvdread
fdk:libfdk-aac@nonfree
flite:libflite
+fontconfig:libfontconfig
frei0r
fribidi:libfribidi
gcrypt
gme:libgme
gmp:@v3
+gnutls # unused if USE=openssl, default for bug #905113,#917627
+gpl
gsm:libgsm
iec61883:libiec61883
ieee1394:libdc1394
jack:libjack
jpeg2k:libopenjpeg
jpegxl:libjxl
kvazaar:libkvazaar
ladspa
lame:libmp3lame
lcms:lcms2
libaom
libaribb24:@v3 # reminder: req use on gpl unneeded if >=1.0.4 (not in tree)
+libass
libcaca
libilbc
liblc3
libplacebo
librtmp:librtmp
libsoxr
lv2
lzma
modplug:libmodplug
nvenc:cuvid,ffnvcodec,nvdec,nvenc
opencolorio:^libopencolorio # no multilib
ocr:libtesseract
openal
opencl
opengl
openh264:libopenh264
openmpt:libopenmpt
openssl:openssl,!gnutls@v3ifgpl # still LGPL2.1+ if USE=-gpl
opus:libopus
pulseaudio:libpulse
qrcode:libqrencode
qsv:libvpl
quirc:libquirc
rabbitmq:^librabbitmq # no multilib
rav1e:^librav1e # no multilib
rist:^librist # no multilib
rubberband:librubberband
samba:libsmbclient@v3 # GPL-3+ only
sdl:sdl2
snappy:libsnappy
sndio
speex:libspeex
srt:libsrt
ssh:libssh
svg:librsvg
svt-av1:libsvtav1
theora:libtheora
+truetype:libfreetype,libharfbuzz
twolame:libtwolame
v4l:libv4l2
vaapi
vdpau
vidstab:libvidstab
vmaf:libvmaf
vorbis:libvorbis
vpx:libvpx
# libshaderc: merged here given shaderc is needed at build-time
# either way and many vulkan features depend on spirv_library
# vulkan-static: it still uses shared, only means no dlopen()
vulkan:libshaderc,vulkan,vulkan-static
webp:libwebp
x264:libx264
x265:libx265
+xml:libxml2
xvid:libxvid
zeromq:^libzmq # no multilib
zimg:libzimg
+zlib
zvbi:libzvbi
)
# all-rights is used to express the GPL incompatibility (RESTRICT=bindist)
LICENSE="
gpl? (
GPL-2+
amr? ( GPL-3+ ) amrenc? ( GPL-3+ ) libaribb24? ( GPL-3+ )
gmp? ( GPL-3+ ) openssl? ( GPL-3+ )
fdk? ( all-rights-reserved )
)
!gpl? (
LGPL-2.1+
amr? ( LGPL-3+ ) amrenc? ( LGPL-3+ ) libaribb24? ( LGPL-3+ )
gmp? ( LGPL-3+ )
)
samba? ( GPL-3+ )
"
[[ ${FFMPEG_UNSLOTTED} ]] && : 0 || : "$(ver_cut 1)"
SLOT="${_}/${FFMPEG_SUBSLOT}"
IUSE="
${FFMPEG_IUSE_MAP[*]%:*}
${FFMPEG_UNSLOTTED:+chromium}
${FFMPEG_SOC_PATCH:+soc}
"
REQUIRED_USE="
cuda-clang? ( nvenc )
fribidi? ( truetype )
gmp? ( !librtmp )
libplacebo? ( vulkan )
libaribb24? ( gpl ) cdio? ( gpl ) dvd? ( gpl ) frei0r? ( gpl )
rubberband? ( gpl ) samba? ( gpl ) vidstab? ( gpl ) x264? ( gpl )
x265? ( gpl ) xvid? ( gpl )
${FFMPEG_UNSLOTTED:+chromium? ( opus )}
${FFMPEG_SOC_PATCH:+soc? ( drm )}
"
RESTRICT="gpl? ( fdk? ( bindist ) )"
# dlopen: amdgpu-pro-amf
COMMON_DEPEND="
virtual/libiconv[${MULTILIB_USEDEP}]
X? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libXext[${MULTILIB_USEDEP}]
x11-libs/libXv[${MULTILIB_USEDEP}]
x11-libs/libxcb:=[${MULTILIB_USEDEP}]
)
alsa? ( media-libs/alsa-lib[${MULTILIB_USEDEP}] )
amr? ( media-libs/opencore-amr[${MULTILIB_USEDEP}] )
amrenc? ( media-libs/vo-amrwbenc[${MULTILIB_USEDEP}] )
bluray? ( media-libs/libbluray:=[${MULTILIB_USEDEP}] )
bs2b? ( media-libs/libbs2b[${MULTILIB_USEDEP}] )
bzip2? ( app-arch/bzip2[${MULTILIB_USEDEP}] )
cairo? ( x11-libs/cairo[${MULTILIB_USEDEP}] )
cdio? ( dev-libs/libcdio-paranoia:=[${MULTILIB_USEDEP}] )
chromaprint? ( media-libs/chromaprint:=[${MULTILIB_USEDEP}] )
codec2? ( media-libs/codec2:=[${MULTILIB_USEDEP}] )
dav1d? ( media-libs/dav1d:=[${MULTILIB_USEDEP}] )
dvd? (
media-libs/libdvdnav[${MULTILIB_USEDEP}]
media-libs/libdvdread:=[${MULTILIB_USEDEP}]
)
drm? ( x11-libs/libdrm[${MULTILIB_USEDEP}] )
fdk? ( media-libs/fdk-aac:=[${MULTILIB_USEDEP}] )
flite? ( app-accessibility/flite[${MULTILIB_USEDEP}] )
fontconfig? ( media-libs/fontconfig[${MULTILIB_USEDEP}] )
frei0r? ( media-plugins/frei0r-plugins[${MULTILIB_USEDEP}] )
fribidi? ( dev-libs/fribidi[${MULTILIB_USEDEP}] )
gcrypt? ( dev-libs/libgcrypt:=[${MULTILIB_USEDEP}] )
gme? ( media-libs/game-music-emu[${MULTILIB_USEDEP}] )
gmp? ( dev-libs/gmp:=[${MULTILIB_USEDEP}] )
gnutls? ( !openssl? (
net-libs/gnutls:=[${MULTILIB_USEDEP}]
) )
gsm? ( media-sound/gsm[${MULTILIB_USEDEP}] )
iec61883? (
media-libs/libiec61883[${MULTILIB_USEDEP}]
sys-libs/libavc1394[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
ieee1394? (
media-libs/libdc1394:2=[${MULTILIB_USEDEP}]
sys-libs/libraw1394[${MULTILIB_USEDEP}]
)
jack? ( virtual/jack[${MULTILIB_USEDEP}] )
jpeg2k? ( media-libs/openjpeg:2=[${MULTILIB_USEDEP}] )
jpegxl? ( media-libs/libjxl:=[${MULTILIB_USEDEP}] )
kvazaar? ( media-libs/kvazaar:=[${MULTILIB_USEDEP}] )
lame? ( media-sound/lame[${MULTILIB_USEDEP}] )
lcms? ( media-libs/lcms:2[${MULTILIB_USEDEP}] )
libaom? ( media-libs/libaom:=[${MULTILIB_USEDEP}] )
libaribb24? ( media-libs/aribb24[${MULTILIB_USEDEP}] )
libass? ( media-libs/libass:=[${MULTILIB_USEDEP}] )
libcaca? ( media-libs/libcaca[${MULTILIB_USEDEP}] )
libilbc? ( media-libs/libilbc:=[${MULTILIB_USEDEP}] )
liblc3? ( >=media-sound/liblc3-1.1[${MULTILIB_USEDEP}] )
libplacebo? ( media-libs/libplacebo:=[vulkan,${MULTILIB_USEDEP}] )
librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] )
libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] )
lv2? (
media-libs/lilv[${MULTILIB_USEDEP}]
media-libs/lv2[${MULTILIB_USEDEP}]
)
lzma? ( app-arch/xz-utils[${MULTILIB_USEDEP}] )
modplug? ( media-libs/libmodplug[${MULTILIB_USEDEP}] )
opencolorio? ( media-libs/opencolorio:= )
ocr? ( app-text/tesseract:=[${MULTILIB_USEDEP}] )
openal? ( media-libs/openal[${MULTILIB_USEDEP}] )
opencl? ( virtual/opencl[${MULTILIB_USEDEP}] )
opengl? ( media-libs/libglvnd[X,${MULTILIB_USEDEP}] )
openh264? ( media-libs/openh264:=[${MULTILIB_USEDEP}] )
openmpt? ( media-libs/libopenmpt[${MULTILIB_USEDEP}] )
openssl? ( >=dev-libs/openssl-3:=[${MULTILIB_USEDEP}] )
opus? ( media-libs/opus[${MULTILIB_USEDEP}] )
pulseaudio? ( media-libs/libpulse[${MULTILIB_USEDEP}] )
qrcode? ( media-gfx/qrencode:=[${MULTILIB_USEDEP}] )
qsv? ( media-libs/libvpl:=[${MULTILIB_USEDEP}] )
quirc? ( media-libs/quirc:=[${MULTILIB_USEDEP}] )
rabbitmq? ( net-libs/rabbitmq-c:= )
rav1e? ( >=media-video/rav1e-0.5:=[capi] )
rist? ( net-libs/librist )
rubberband? ( media-libs/rubberband:=[${MULTILIB_USEDEP}] )
samba? ( net-fs/samba:=[client,${MULTILIB_USEDEP}] )
sdl? (
media-libs/libsdl2[sound(+),video(+),${MULTILIB_USEDEP}]
libplacebo? ( media-libs/libsdl2[vulkan] )
)
snappy? ( app-arch/snappy:=[${MULTILIB_USEDEP}] )
sndio? ( media-sound/sndio:=[${MULTILIB_USEDEP}] )
speex? ( media-libs/speex[${MULTILIB_USEDEP}] )
srt? ( net-libs/srt:=[${MULTILIB_USEDEP}] )
ssh? ( net-libs/libssh:=[sftp,${MULTILIB_USEDEP}] )
svg? (
dev-libs/glib:2[${MULTILIB_USEDEP}]
>=gnome-base/librsvg-2.52:2[${MULTILIB_USEDEP}]
x11-libs/cairo[${MULTILIB_USEDEP}]
)
svt-av1? ( >=media-libs/svt-av1-0.9:=[${MULTILIB_USEDEP}] )
theora? ( media-libs/libtheora:=[encode,${MULTILIB_USEDEP}] )
truetype? (
media-libs/freetype:2[${MULTILIB_USEDEP}]
media-libs/harfbuzz:=[${MULTILIB_USEDEP}]
)
twolame? ( media-sound/twolame[${MULTILIB_USEDEP}] )
v4l? ( media-libs/libv4l[${MULTILIB_USEDEP}] )
vaapi? ( media-libs/libva:=[X?,${MULTILIB_USEDEP}] )
vdpau? (
x11-libs/libX11[${MULTILIB_USEDEP}]
x11-libs/libvdpau[${MULTILIB_USEDEP}]
)
vidstab? ( media-libs/vidstab[${MULTILIB_USEDEP}] )
vmaf? ( media-libs/libvmaf:=[${MULTILIB_USEDEP}] )
vorbis? ( media-libs/libvorbis[${MULTILIB_USEDEP}] )
vpx? ( media-libs/libvpx:=[${MULTILIB_USEDEP}] )
vulkan? (
media-libs/shaderc[${MULTILIB_USEDEP}]
media-libs/vulkan-loader[${MULTILIB_USEDEP}]
)
webp? ( media-libs/libwebp:=[${MULTILIB_USEDEP}] )
x264? ( media-libs/x264:=[${MULTILIB_USEDEP}] )
x265? ( media-libs/x265:=[${MULTILIB_USEDEP}] )
xml? ( dev-libs/libxml2:=[${MULTILIB_USEDEP}] )
xvid? ( media-libs/xvid[${MULTILIB_USEDEP}] )
zeromq? ( net-libs/zeromq:= )
zimg? ( media-libs/zimg[${MULTILIB_USEDEP}] )
zlib? ( virtual/zlib:=[${MULTILIB_USEDEP}] )
zvbi? ( media-libs/zvbi[${MULTILIB_USEDEP}] )
${FFMPEG_SOC_PATCH:+"
soc? ( virtual/libudev:=[${MULTILIB_USEDEP}] )
"}
"
RDEPEND="
${COMMON_DEPEND}
amf? ( media-video/amdgpu-pro-amf )
"
DEPEND="
${COMMON_DEPEND}
X? ( x11-base/xorg-proto )
amf? ( >=media-libs/amf-headers-1.5.0 )
kernel_linux? ( >=sys-kernel/linux-headers-6 )
ladspa? ( media-libs/ladspa-sdk )
nvenc? ( >=media-libs/nv-codec-headers-12.1.14.0 )
opencl? ( dev-util/opencl-headers )
vulkan? ( >=dev-util/vulkan-headers-1.4.317 )
"
BDEPEND="
app-alternatives/awk
virtual/pkgconfig
amd64? ( dev-lang/nasm )
cuda-clang? ( llvm-core/clang:*[llvm_targets_NVPTX] )
vulkan? ( media-libs/shaderc )
${FFMPEG_UNSLOTTED:+"
dev-lang/perl
doc? ( sys-apps/texinfo )
"}
"
[[ ${PV} != 9999 ]] &&
BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-ffmpeg )"
DOCS=( CREDITS Changelog README.md doc/APIchanges )
[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES )
MULTILIB_WRAPPED_HEADERS=(
/usr/include/libavutil/avconfig.h
)
PATCHES=(
"${FILESDIR}"/ffmpeg-6.1-opencl-parallel-gmake-fix.patch
)
pkg_pretend() {
# TODO: drop this after a few months
if has_version "${CATEGORY}/${PN}[mp3]" && use !lame; then #952971
ewarn "${PN}'s 'mp3' USE was renamed to 'lame', please enable it"
ewarn "if wish to keep the ability to encode using media-sound/lame."
ewarn "This is *not* needed if only want mp3 playback."
fi
}
pkg_setup() {
[[ ${MERGE_TYPE} != binary ]] || return
if use chromaprint && has_version 'media-libs/chromaprint[tools]'; then
ewarn "media-libs/chromaprint is installed with USE=tools which links to"
ewarn "ffmpeg, and USE=chromaprint is enabled on ffmpeg which links to"
ewarn "chromaprint (circular). This may cause issues when updating ffmpeg."
ewarn
ewarn "If get a build failure with 'ERROR: chromaprint not found' or so,"
ewarn "first rebuild chromaprint with USE=-tools, then rebuild ffmpeg, and"
ewarn "then finally rebuild chromaprint with USE=tools again (bug #862996)."
fi
[[ ${EXTRA_FFMPEG_CONF} ]] && # drop this eventually
die "EXTRA_FFMPEG_CONF is set in the environment, please use EXTRA_ECONF instead"
}
src_unpack() {
if [[ ${PV} == 9999 ]]; then
git-r3_src_unpack
else
use verify-sig &&
verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \
"${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc
default
fi
}
src_prepare() {
in_iuse chromium && PATCHES+=( "${FILESDIR}"/chromium-r3.patch )
in_iuse soc && use soc && PATCHES+=( "${DISTDIR}"/${FFMPEG_SOC_PATCH} )
default
# respect user preferences
sed -i '/cflags -fdiagnostics-color/d' configure || die
# handle here to avoid repeating for each ABI below (bug #923491)
FFMPEG_ENABLE_LTO=
if tc-is-lto; then
: "$(get-flag -flto)" # get -flto=<val> (e.g. =thin)
FFMPEG_ENABLE_LTO=--enable-lto${_#-flto}
tc-ld-is-mold && tc-is-clang && FFMPEG_ENABLE_LTO= #963835
fi
filter-lto
# workaround ICE with <gcc-16.1.1_p20260606:16 (bug #973641)
# TODO: kept to let people update, cleanup after a few months
tc-is-gcc && [[ $(gcc-major-version) -eq 16 ]] &&
has_version -b '<sys-devel/gcc-16.1.1_p20260606:16' &&
append-flags -fno-tree-vectorize
}
multilib_src_configure() {
local conf=( "${S}"/configure ) # not autotools-based
local prefix=${EPREFIX}/usr
if [[ ! ${FFMPEG_UNSLOTTED} ]]; then
prefix+=/lib/ffmpeg${SLOT%/*}
# could get SONAME clashes, so prefer rpath over LDPATH
conf+=(
--enable-rpath
--disable-doc
)
fi
conf+=(
--prefix="${prefix}"
--libdir="${prefix}"/$(get_libdir)
--shlibdir="${prefix}"/$(get_libdir)
--mandir="${prefix}"/share/man
--docdir="${EPREFIX}"/usr/share/doc/${PF}/html
--ar="$(tc-getAR)"
--cc="$(tc-getCC)"
--cxx="$(tc-getCXX)"
--nm="$(tc-getNM)"
--pkg-config="$(tc-getPKG_CONFIG)"
--ranlib="$(tc-getRANLIB)"
--disable-stripping
# overrides users' -g/-O, let *FLAGS handle these
--disable-debug
--disable-optimizations
--optflags=' '
# pass option over *FLAGS due to special logic (bug #566282,#754654)
${FFMPEG_ENABLE_LTO}
# basic defaults that should not really need a USE
--enable-iconv
--enable-pic
--enable-shared
--disable-static
$(multilib_native_enable manpages) # needs pod2man
--disable-podpages
--disable-txtpages
# disabled primarily due to being unpackaged
--disable-decklink
--disable-libaribcaption
--disable-libdavs2
--disable-libklvanc
--disable-liblcevc-dec
--disable-libmpeghdec
--disable-libmysofa
--disable-liboapv
--disable-libopenvino
--disable-libshine
--disable-libsvtjpegxs
--disable-libtls
--disable-libuavs3d
--disable-libvvenc
--disable-libxavs
--disable-libxavs2
--disable-libxevd
--disable-libxevdb
--disable-libxeve
--disable-libxeveb
--disable-ohcodec
--disable-pocketsphinx
--disable-rkmpp
--disable-vapoursynth
--disable-whisper
# disabled for other or additional reasons
--disable-cuda-nvcc # prefer cuda-llvm for less issues
--disable-libcelt # obsolete (bug #664158)
--disable-libglslang # prefer shaderc (bug #918989,#920283,#922333)
--disable-liblensfun # https://trac.ffmpeg.org/ticket/9112 (abandoned?)
--disable-libmfx # prefer libvpl for USE=qsv
--disable-libnpp # deprecated and not supported for cuda 13.0+
--disable-libopencv # leaving for later due to circular opencv[ffmpeg]
--disable-libtensorflow # causes headaches, and is gone
--disable-libtorch # support may need special attention (bug #936127)
--disable-mbedtls # messy with slots, tests underlinking issues
--disable-mmal # prefer USE=soc
--disable-omx # unsupported (bug #653386)
--disable-omx-rpi # ^
# to avoid obscure issues like bug #915384 and simplify the ebuild,
# not passing the following (use EXTRA_ECONF if really must):
# --cpu: adds -march=<exact> after the user's more adapted
# =native, its logic also does not account for -mno-*
# --disable/enable-<cpufeature>: safer to detect at runtime
)
in_iuse soc && use soc &&
conf+=(
--enable-libudev
--enable-sand
--enable-v4l2-request
)
# broken on x32 (bug #427004), and not PIC safe on x86 (bug #916067)
[[ ${ABI} == @(x32|x86) ]] && conf+=( --disable-asm )
# disable due to asm-related failures on ppc (bug #951464, ppc64be)
# https://trac.ffmpeg.org/ticket/9604 (ppc64el)
# https://trac.ffmpeg.org/ticket/10955 (ppc64el)
# (review re-enabling if resolved, or if debian allows it again)
use ppc || use ppc64 && conf+=( --disable-asm )
if tc-is-cross-compiler; then
conf+=(
--enable-cross-compile
--arch="$(tc-arch-kernel)"
--cross-prefix="${CHOST}-"
--host-cc="$(tc-getBUILD_CC)"
)
case ${CHOST} in
*mingw32*) conf+=( --target-os=mingw32 );;
*linux*) conf+=( --target-os=linux );;
esac
elif use arm; then
# TODO?: could *always* pass tc-arch-kernel, albeit that function
# is meant for the kernel and just mostly matches by accident
conf+=( --arch=arm ) #969514
fi
# skipping tests is handled at configure-time
local skip_tests=()
# tests known failing on BE arches, skip for now given potential
# fixes are complex and would rather wait for fixed release
# (shouldn't impact most BE users, scarcely used features)
# https://code.ffmpeg.org/FFmpeg/FFmpeg/issues/22564
# https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/22274
[[ $(tc-endian) == big ]] &&
skip_tests+=(
filter-drawvg-video
vsynth{1,2,3}-ffvhuff420p12
)
# zlib-ng is not bitexact w/ zlib producing mismatching md5sum (bug #965737)
has_version 'sys-libs/zlib-ng[compat]' &&
skip_tests+=(
lavf-{apng{,.png},gray16be.png,png,rgb48be.png}
mov-mp4-frag-flush
vsynth{1,2,3}-{flashsv,mpng,zlib}
)
(( ${#skip_tests[@]} )) &&
conf+=( --ignore-tests=$(IFS=,; echo "${skip_tests[*]}") )
# import options from FFMPEG_IUSE_MAP
local flag license mod v
local -A optmap=() licensemap=()
for v in "${FFMPEG_IUSE_MAP[@]}"; do
[[ ${v} =~ \+?([^:]+):?([^@]*)@?(.*) ]] || die "${v}"
flag=${BASH_REMATCH[1]}
license=${BASH_REMATCH[3]}
v=${BASH_REMATCH[2]:-${flag}}
for v in ${v//,/ }; do
mod=${v::1}
v=${v#[\!\^]}
if [[ ${mod} == '!' ]]; then
if use ${flag}; then
optmap[${v}]=--disable-${v}
unset licensemap[${v}]
fi
elif [[ ! -v optmap[${v}] ]]; then
if [[ ${mod} == '^' ]]; then
optmap[${v}]=$(multilib_native_use_enable ${flag} ${v})
else
optmap[${v}]=$(use_enable ${flag} ${v})
fi
use ${flag} && licensemap[${v}]=${license}
fi
done
done
for license in "${licensemap[@]}"; do
case ${license} in
v3ifgpl) use gpl || continue ;&
v3) optmap[v3]=--enable-version3 ;;
nonfree) use gpl && optmap[nonfree]=--enable-nonfree ;;
esac
done
conf+=(
"${optmap[@]}"
${EXTRA_ECONF}
)
einfo "${conf[*]}"
"${conf[@]}" || die "configure failed, see ${BUILD_DIR}/ffbuild/config.log"
}
multilib_src_compile() {
mkdir -p fftools/resources/ || die #965687
mkdir -p libav{codec,filter}/vulkan/ || die #974907
emake V=1
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 libffmpeg
}
multilib_src_test() {
local -x LD_LIBRARY_PATH=$(printf %s: "${BUILD_DIR}"/lib*)${LD_LIBRARY_PATH}
emake V=1 -k fate
}
multilib_src_install() {
emake V=1 DESTDIR="${D}" install
in_iuse chromium && use chromium && multilib_is_native_abi &&
emake V=1 DESTDIR="${D}" install-libffmpeg
}
multilib_src_install_all() {
in_iuse soc && use soc && udev_dorules "${FILESDIR}"/60-dma-heap-ffmpeg.rules
einstalldocs
}
pkg_postinst() {
in_iuse soc && use soc && udev_reload
}
pkg_postrm() {
in_iuse soc && use soc && udev_reload
}