diff options
Diffstat (limited to 'media-video/ffmpeg-compat')
-rw-r--r-- | media-video/ffmpeg-compat/Manifest | 11 | ||||
-rw-r--r-- | media-video/ffmpeg-compat/ffmpeg-compat-4.4.5.ebuild | 484 | ||||
-rw-r--r-- | media-video/ffmpeg-compat/ffmpeg-compat-6.1.2.ebuild | 562 | ||||
-rw-r--r-- | media-video/ffmpeg-compat/metadata.xml | 121 |
4 files changed, 1178 insertions, 0 deletions
diff --git a/media-video/ffmpeg-compat/Manifest b/media-video/ffmpeg-compat/Manifest new file mode 100644 index 000000000000..fecfba901746 --- /dev/null +++ b/media-video/ffmpeg-compat/Manifest @@ -0,0 +1,11 @@ +DIST ffmpeg-4.4-patchset-1.tar.xz 9916 BLAKE2B 9b41de6b048601f2af41864c3262b3348330f792eea71df4cfab5e740626ee6c633ac5569e6e91d953143f6ad0fac15c840ef0643925e91261f8b4a32e2d386c SHA512 b11d9e182ddb0a48f50d63f5e0bd7fd99f4b8fa7dd17179a3bfbc9419dabb76401408a81ae2d5f118fbf67f28dcfdc3bfb5b7ac70f740259e3ebad8d1ba049bb +DIST ffmpeg-4.4.5.tar.xz 9575596 BLAKE2B 546df09f7731d22e532a18d9ba9be184283f62b7a2e9470e745e536802bc2263a00f11ed6ab0aee8fc60c5f728826311cbf3542084ba3a64b65a61d76295cd64 SHA512 70df4e63ef507a7ec76da34438142499139769728fd5130d9cf48d56c110ec82c3d6a7e6d1622da03c70167fa861d901d016bbe52c21d2b284b8a0d9f30811dc +DIST ffmpeg-4.4.5.tar.xz.asc 520 BLAKE2B 505987208ed58b548f910299adb1324e6eba655cc37e6f03cac32c8623e16a4a884e822c745fb72b1934129a8c0a2706bb8bfb785715e6a68e43f737cb8ed365 SHA512 bcfee8986681dfbefd3add741fcbbc5e223bb06c9800797e68fde968c114055ac3fc02ce8731ed269bf30c92d6c990c7f636f82d42379920012e8a0ace8d527e +DIST ffmpeg-6.1-patchset-1.tar.xz 11296 BLAKE2B 5227d0c7f52a4f217d5517da11c2327585375c9d860f31415e1079f4f1f9186637e07c7da0e168c732cc7abb953440f0ba952395db83074588eb31bee1d5bc9f SHA512 20fe94536a5c3873d0126ff535a3bff595dedc7787162f160ecde6cbd357b9eb3749c9d7b7543aa39896ceb4e656494d31811bf26682776cdfc693fe030cd77b +DIST ffmpeg-6.1.2.tar.xz 10466152 BLAKE2B ff1f2b2bb60ccc4c37b6ffda2a0e6a0be80c451dc99f6d4a99bd95a1bdc44c494d62377c53383ccfb5b818573a1971948d7db34119099dbc56d7258724831d3c SHA512 3a009184d971fc3168e1322d1d724aae787ed0e9c152d8d1813ea0b9099bda3b35c41fcabbd7b140560e7a8fa9fa1ffd7f0938432d5d498c43829fc6cc3d9e08 +DIST ffmpeg-6.1.2.tar.xz.asc 520 BLAKE2B f26a2d6f5423f93090f2a448172e49f3858aeb5a00f326207d374bbb70fa8942c7ee1a7c55338b2db664b647c983cd5ab4fd8d71efe5c37af4c90385ca17d0ab SHA512 a26dba1f4870b964080b45f8468f5ce3591eb6aa69be426bf4afbe5a60c3cbd0fe5056dc86ca7bb817c04ae30d39160cb7773772a9a2123ae7f095b18a6d7050 +DIST ffmpeg-rpi-6.1-r3.patch 800738 BLAKE2B b7e449ee5eec8b50a3b3bba233c5269f3b6845dbd18a619b844c841a97345ce24c7a5d7f4da05b08e3cb49668426b9044f3d3553d9c2ef3a50aec7199bfa3c09 SHA512 aeaf12afabf5f2192fb0b6ef47397d8477b109e49cee8c02a890d1656a27b1985c62c719ef72966d8c97b0709918233b65ea2e0ef988771507e4be137fcd9158 +DIST ffmpeg-rpi-6.1-r3.patch.asc 833 BLAKE2B 31fd5823c06d5884f7b0980de9072c35bbf4e1d6c0ed20b089439325d50956127238ca29469b003dba623b888a5aae3c4d8ad177862534e77b8e51f29cbed96c SHA512 3d8943b7151e20f73e9c14b121c501847bd7e01f2cf57ff135fc8c223653ec9d433bfe4012fa564f70c0471980b66d7ec3d9b5b1b14865187187719ba110cb5f +EBUILD ffmpeg-compat-4.4.5.ebuild 14409 BLAKE2B d048d28498f200c3e1587931b822dbca7faaf30999be51715711e16d484d511160452e80e9406ee4e908656539bc337e865186540e324b8565067b92ec7847db SHA512 6af2f4f570074e6f146f558ef9596b39eb8b05ba87c2cf3939ab47be52d531e66a6f85f4550b16f68f272c75b78b3e3938f938dcb03839294ff2729e4d3f5918 +EBUILD ffmpeg-compat-6.1.2.ebuild 16538 BLAKE2B 723fa6b72bf020386ba64d8435bae59eccc8961a19ee3a865f1747d4e0dbf6ae9051a13a25334a2e4aa819bb3eca16cae90355f7af80d3f6986ad196821b00ca SHA512 c0da5de68124cbcea8edfbe85dd4eb32aacfa75ce60e4b390d4686fbe7cb5ced9ea494fbae0daff450e3c1de0da1abfbc1d84c95dcc1c96f92ed961362af3179 +MISC metadata.xml 7605 BLAKE2B af1dae9179eb75099f73330e42f95be290f59e99e4062f265e0cf339d9d2e9fd3ef5265600e8e497b2edd58d2501ded48fb92fe6e3c92f1c5015fe79a999c187 SHA512 6093fd6f4c22221cc3ee7bde293f0ea9bffbcaecac8c3735f515cc37a1c48b69b6ee38acd34c892c1c72e14bc4f823714e446224f1bc4806e7bad52190fd63e2 diff --git a/media-video/ffmpeg-compat/ffmpeg-compat-4.4.5.ebuild b/media-video/ffmpeg-compat/ffmpeg-compat-4.4.5.ebuild new file mode 100644 index 000000000000..e86d43b6f530 --- /dev/null +++ b/media-video/ffmpeg-compat/ffmpeg-compat-4.4.5.ebuild @@ -0,0 +1,484 @@ +# Copyright 2025 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://dev.gentoo.org/~ionen/distfiles/ffmpeg-$(ver_cut 1-2)-patchset-1.tar.xz + " + S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos" +fi + +DESCRIPTION="Complete solution to record/convert/stream audio and video" +HOMEPAGE="https://ffmpeg.org/" + +[[ ${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:cuda-llvm + +dav1d:libdav1d + 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 + libtesseract + lv2 + lzma + modplug:libmodplug + nvenc:cuvid,ffnvcodec,nvdec,nvenc + 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}] ) + libtesseract? ( app-text/tesseract:=[${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}] ) + 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? ( sys-libs/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 + dev-lang/perl + virtual/pkgconfig + amd64? ( + || ( + dev-lang/nasm + dev-lang/yasm + ) + ) + cuda? ( llvm-core/clang:*[llvm_targets_NVPTX] ) + 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_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 + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \ + "${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc + fi + default + fi +} + +src_prepare() { + default + + # respect user preferences + sed -i '/cflags -fdiagnostics-color/d' configure || die + + # handle *FLAGS 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 # ignoring slotted MANPATH + --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 # librist itself needs attention first (bug #822012) + --disable-libtensorflow # causes headaches, and is gone + --disable-libvmaf # use ffmpeg-6+ instead, needs old vmaf library + --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 ) + + 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 + fi + + # 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[*]}" # no edo.eclass due to noisy long command in errors + "${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 +} diff --git a/media-video/ffmpeg-compat/ffmpeg-compat-6.1.2.ebuild b/media-video/ffmpeg-compat/ffmpeg-compat-6.1.2.ebuild new file mode 100644 index 000000000000..bde869a247e0 --- /dev/null +++ b/media-video/ffmpeg-compat/ffmpeg-compat-6.1.2.ebuild @@ -0,0 +1,562 @@ +# Copyright 2025 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} + verify-sig? ( https://dev.gentoo.org/~chewi/distfiles/${FFMPEG_SOC_PATCH}.asc ) + ) + "} + https://dev.gentoo.org/~ionen/distfiles/ffmpeg-$(ver_cut 1-2)-patchset-1.tar.xz + " + S=${WORKDIR}/ffmpeg-${PV} # avoid ${P} + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~x64-macos" +fi + +DESCRIPTION="Complete solution to record/convert/stream audio and video" +HOMEPAGE="https://ffmpeg.org/" + +[[ ${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:cuda-llvm + +dav1d:libdav1d + 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 + libtesseract + lv2 + lzma + modplug:libmodplug + npp:^libnpp@nonfree # no multilib + nvenc:cuvid,ffnvcodec,nvdec,nvenc + 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 + vmaf:libvmaf + 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 ) npp? ( 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? ( nvenc ) + fribidi? ( truetype ) + gmp? ( !librtmp ) + libplacebo? ( || ( sdl vulkan ) ) + npp? ( nvenc ) + 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 ) npp? ( 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:=[$MULTILIB_USEDEP] ) + librtmp? ( media-video/rtmpdump[${MULTILIB_USEDEP}] ) + libsoxr? ( media-libs/soxr[${MULTILIB_USEDEP}] ) + libtesseract? ( app-text/tesseract:=[${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}] ) + npp? ( dev-util/nvidia-cuda-toolkit:= ) + 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}] ) + 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}] ) + vmaf? ( media-libs/libvmaf:=[${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? ( sys-libs/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 + dev-lang/perl + virtual/pkgconfig + amd64? ( + || ( + dev-lang/nasm + dev-lang/yasm + ) + ) + cuda? ( llvm-core/clang:*[llvm_targets_NVPTX] ) + doc? ( sys-apps/texinfo ) +" +[[ ${PV} != 9999 ]] && + BDEPEND+=" + verify-sig? ( + sec-keys/openpgp-keys-ffmpeg + ${FFMPEG_SOC_PATCH:+" + soc? ( >=sec-keys/openpgp-keys-gentoo-developers-20240708 ) + "} + ) + " + +DOCS=( CREDITS Changelog README.md doc/APIchanges ) +[[ ${PV} != 9999 ]] && DOCS+=( RELEASE_NOTES ) + +MULTILIB_WRAPPED_HEADERS=( + /usr/include/libavutil/avconfig.h +) + +PATCHES=( + "${WORKDIR}"/patches +) + +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 + if use verify-sig; then + verify-sig_verify_detached "${DISTDIR}"/ffmpeg-${PV}.tar.xz{,.asc} \ + "${BROOT}"/usr/share/openpgp-keys/ffmpeg.asc + in_iuse soc && use soc && + verify-sig_verify_detached "${DISTDIR}"/${FFMPEG_SOC_PATCH}{,.asc} \ + "${BROOT}"/usr/share/openpgp-keys/gentoo-developers.asc + fi + 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 *FLAGS 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} + fi + filter-lto + + use elibc_musl && append-cppflags -D__musl__ #940733 + + if use npp; then + local cuda=${ESYSROOT}/opt/cuda/targets/$(usex amd64 x86_64 sbsa)-linux + append-cppflags -I"${cuda}"/include + append-ldflags -L"${cuda}"/lib + fi +} + +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 # ignoring slotted MANPATH + --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-libopencv # leaving for later due to circular opencv[ffmpeg] + --disable-librist # librist itself needs attention first (bug #822012) + --disable-libtensorflow # causes headaches, and is gone + --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 ) + + 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 + fi + + # 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[*]}" # no edo.eclass due to noisy long command in errors + "${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 +} diff --git a/media-video/ffmpeg-compat/metadata.xml b/media-video/ffmpeg-compat/metadata.xml new file mode 100644 index 000000000000..895198538495 --- /dev/null +++ b/media-video/ffmpeg-compat/metadata.xml @@ -0,0 +1,121 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person"> + <email>ionen@gentoo.org</email> + <name>Ionen Wolkens</name> + </maintainer> + <maintainer type="person"> + <email>chewi@gentoo.org</email> + <name>James Le Cuirot</name> + <description>soc USE flag</description> + </maintainer> + <use> + <flag name="amf">Enable AMD's Advanced Media Framework support via <pkg>media-video/amdgpu-pro-amf</pkg></flag> + <flag name="amr">Enable Adaptive Multi-Rate Audio support via <pkg>media-libs/opencore-amr</pkg></flag> + <flag name="amrenc">Enable Adaptive Multi-Rate Audio encoding support via <pkg>media-libs/vo-amrwbenc</pkg></flag> + <flag name="appkit">Enable Apple AppKit framework</flag> + <flag name="bluray">Enable Blu-ray filesystems reading support via <pkg>media-libs/libbluray</pkg></flag> + <flag name="bs2b">Enable Bauer Stereo-to-Binaural filter support via <pkg>media-libs/libbs2b</pkg></flag> + <flag name="cdio">Enable audio CDs reading via <pkg>dev-libs/libcdio-paranoia</pkg></flag> + <flag name="chromaprint">Enable audio fingerprinting support via <pkg>media-libs/chromaprint</pkg></flag> + <flag name="codec2">Enable codec2 low bit rate speech codec support via <pkg>media-libs/codec2</pkg></flag> + <flag name="cuda">Enable support for various GPU-accelerated filters using NVIDIA PTX compiled with <pkg>llvm-core/clang</pkg></flag> + <flag name="dav1d">Enable AV1 decoding support via <pkg>media-libs/dav1d</pkg></flag> + <flag name="drm"> + Enable use of <pkg>x11-libs/libdrm</pkg> for various hardware + accelerated functions and Kernel Mode Setting screen capture + </flag> + <flag name="fdk"> + Enable AAC (Advanced Audio Coding) encoding support via + <pkg>media-libs/fdk-aac</pkg> in addition to FFmpeg's own + implementation (warning: if USE=gpl is enabled, this produces + a non-redistributable build) + </flag> + <flag name="flite">Enable text-to-speech filter support via <pkg>app-accessibility/flite</pkg></flag> + <flag name="frei0r">Enable use of filters through <pkg>media-plugins/frei0r-plugins</pkg></flag> + <flag name="fribidi">Enable Bidi support for the drawtext filter via <pkg>dev-libs/fribidi</pkg></flag> + <flag name="gcrypt"> + Enable using <pkg>dev-libs/libgcrypt</pkg> for rtmp(t)e support (not + needed if using any of USE=gmp,librtmp,openssl), and for obtaining + random bytes (not needed if USE=openssl)</flag> + <flag name="gme">Enables various game music formats support via <pkg>media-libs/game-music-emu</pkg></flag> + <flag name="gnutls"> + Enable using <pkg>net-libs/gnutls</pkg> for TLS/HTTPS support + and other minor functions (has no effect if USE=openssl is set) + </flag> + <flag name="gpl">Enable use of GPL licensed code, should be kept enabled unless LGPL binaries are needed</flag> + <flag name="iec61883">Enable FireWire DV/HDV input device support via <pkg>media-libs/libiec61883</pkg></flag> + <flag name="kvazaar">Enable H.265/HEVC encoding support via <pkg>media-libs/kvazaar</pkg></flag> + <flag name="lcms">Enable ICC profile support via <pkg>media-libs/lcms</pkg></flag> + <flag name="libaom"> + Enable AV1 de/encoding via <pkg>media-libs/libaom</pkg> (warning: this + is the reference implementation and is slower than the alternatives) + </flag> + <flag name="libaribb24">Enable ARIB text and caption decoding via <pkg>media-libs/aribb24</pkg></flag> + <flag name="libilbc">Enable internet Low Bitrate Codec de/encoding support via <pkg>media-libs/libilbc</pkg></flag> + <flag name="libplacebo">Enable use of GPU-accelerated filters from <pkg>media-libs/libplacebo</pkg></flag> + <flag name="librtmp"> + Enable Real Time Messaging Protocol support via <pkg>media-video/rtmpdump</pkg> + in addition to FFmpeg's own implementation + </flag> + <flag name="libsoxr">Enable use of the audio resampler from <pkg>media-libs/soxr</pkg></flag> + <flag name="libtesseract">Enable Optical Character Recognition (OCR) filter support via <pkg>app-text/tesseract</pkg></flag> + <flag name="lv2">Enable use of filters through <pkg>media-libs/lv2</pkg></flag> + <flag name="npp"> + Enable Nvidia Performance Primitives-based filters via + <pkg>dev-util/nvidia-cuda-toolkit</pkg> (warning: if USE=gpl + is enabled, this produces non-redistributable build) + </flag> + <flag name="openh264">Enable H.264 encoding support via <pkg>media-libs/openh264</pkg></flag> + <flag name="openmpt">Enable MPTM tracked music files decoding support via <pkg>media-libs/libopenmpt</pkg></flag> + <flag name="openssl"> + Enable using <pkg>dev-libs/openssl</pkg> for TLS/HTTPS support + and other minor functions (USE=gnutls has no effect if set) + </flag> + <flag name="postproc"> + Enable libpostproc video post processing library support + (should not disable this unless need to disable USE=gpl) + </flag> + <flag name="qsv">Enable Intel Quick Sync Video support via <pkg>media-libs/libvpl</pkg></flag> + <flag name="rabbitmq">Enable AMQP stream support via <pkg>net-libs/rabbitmq-c</pkg></flag> + <flag name="rav1e">Enable AV1 encoding support via <pkg>media-video/rav1e</pkg></flag> + <flag name="rubberband">Enable time-stretching and pitch-shifting audio filter support via <pkg>media-libs/rubberband</pkg></flag> + <flag name="sdl">Enable use of the Simple Direct Layer library (required for the ffplay command)</flag> + <flag name="shaderc">Enable support for various GPU-accelerated filters using Vulkan compiled with <pkg>media-libs/shaderc</pkg></flag> + <flag name="snappy"> + Enable Snappy compression support via <pkg>app-arch/snappy</pkg> + (required for Vidvox Hap encoder support) + </flag> + <flag name="sndio">Enable audio output support via <pkg>media-sound/sndio</pkg></flag> + <flag name="soc">Apply additional patches for efficient playback on some SoCs (e.g. ARM, RISC-V)</flag> + <flag name="srt">Enable Secure Reliable Transport (SRT) support via <pkg>net-libs/srt</pkg></flag> + <flag name="ssh">Enable SSH/SFTP support via <pkg>net-libs/libssh</pkg></flag> + <flag name="svt-av1">Enable AV1 encoding support via <pkg>media-libs/svt-av1</pkg></flag> + <flag name="truetype"> + Enable drawtext filter support via <pkg>media-libs/freetype</pkg> + and <pkg>media-libs/harfbuzz</pkg> + </flag> + <flag name="twolame"> + Enable MP2 encoding support via <pkg>media-sound/twolame</pkg> + in addition to FFmpeg's own implementation + </flag> + <flag name="vidstab">Enable video stabilization filter support via <pkg>media-libs/vidstab</pkg></flag> + <flag name="vmaf">Enable Netflix's perceptual video quality assessment filter support via <pkg>media-libs/libvmaf</pkg></flag> + <flag name="vpx"> + Enable VP8 and VP9 de/encoding support via <pkg>media-libs/libvpx</pkg> + in addition to FFmpeg's own implementation (for decoding only) + </flag> + <flag name="x265">Enable H.265/HEVC encoding support via <pkg>media-libs/x265</pkg></flag> + <flag name="xml">Enable Dynamic Adaptive Streaming over HTTP (DASH) stream support using <pkg>dev-libs/libxml2</pkg></flag> + <flag name="zeromq">Enable ZMQ command receiver filter and streaming support via <pkg>net-libs/zeromq</pkg></flag> + <flag name="zimg">Enable zscale filter support using <pkg>media-libs/zimg</pkg></flag> + <flag name="zvbi">Enable teletext decoding support via <pkg>media-libs/zvbi</pkg></flag> + </use> + <upstream> + <bugs-to>https://trac.ffmpeg.org/</bugs-to> + <doc>https://ffmpeg.org/documentation.html</doc> + <remote-id type="cpe">cpe:/a:ffmpeg:ffmpeg</remote-id> + <remote-id type="github">FFmpeg/FFmpeg</remote-id> + </upstream> +</pkgmetadata> |