ports/opt (3.8): ffmpeg: includes a patch for binutils 2.41
![](https://secure.gravatar.com/avatar/df8330968b6df8cd1c1942c5fb4b720c.jpg?s=120&d=mm&r=g)
commit 3027a3395975aa740c156008c07abc286e63c3be Author: Tim Biermann <tbier@posteo.de> Date: Tue Aug 22 20:16:21 2023 +0200 ffmpeg: includes a patch for binutils 2.41 diff --git a/ffmpeg/.signature b/ffmpeg/.signature index b4a1baa36..bfee7c3ba 100644 --- a/ffmpeg/.signature +++ b/ffmpeg/.signature @@ -1,7 +1,8 @@ untrusted comment: verify with /etc/ports/opt.pub -RWSE3ohX2g5d/crUTR8P3p9MX3STTqO5EF/dJAANIvJElFi/qcBCUp/ocaDIFQHFdBrECGvh7wjoMUcNx/QevifBSllaucc45wo= -SHA256 (Pkgfile) = d5b445d2a184044821e4d42fa8db955bd65795fc9ef35f8c0230d6116320e052 +RWSE3ohX2g5d/bGR0hndUMMXbYHwkAH/GxsYEAiCsqHzMzF+eQaSXnCCJiCz58Cl9ntO2R34Li7LR83YDjHPdaKqnXROdiQwvgs= +SHA256 (Pkgfile) = 883141bed0b40bafa8d9799a9e323786f46adefa8834f5109d53f634b56607b9 SHA256 (.footprint) = 0716289bd27e88a5a3ed80b7ecd98b9e1589adc3934bc97ed54b5e413be6b4ef SHA256 (ffmpeg-6.0.tar.bz2) = 47d062731c9f66a78380e35a19aac77cebceccd1c7cc309b9c82343ffc430c3d SHA256 (add-av_stream_get_first_dts-for-chromium.patch) = 57e26caced5a1382cb639235f9555fc50e45e7bf8333f7c9ae3d49b3241d3f77 +SHA256 (ffmpeg-6.0-binutils_2.41-1.patch) = cf4e1644af090ba41b357f2ae24937de95feba59508d184bfd4c7cfbb3e6daa6 SHA256 (ffmpeg-x264-10bit.sh) = dde9627c41800235fbcfe0f74d2181be96239a82cd2d0d277715dddb57eb9cb3 diff --git a/ffmpeg/Pkgfile b/ffmpeg/Pkgfile index fc83ab1d2..9b2b8871a 100644 --- a/ffmpeg/Pkgfile +++ b/ffmpeg/Pkgfile @@ -8,74 +8,77 @@ name=ffmpeg version=6.0 release=1 source=(https://ffmpeg.org/releases/$name-$version.tar.bz2 - add-av_stream_get_first_dts-for-chromium.patch - ffmpeg-x264-10bit.sh) + add-av_stream_get_first_dts-for-chromium.patch + ffmpeg-6.0-binutils_2.41-1.patch + ffmpeg-x264-10bit.sh) build() { - cd $name-$version + cd $name-$version - prt-get isinst clang cuda nv-codec-headers && \ - PKGMK_FFMPEG+=' --enable-cuda-llvm --enable-nonfree --enable-cuda-nvcc --enable-libnpp' && \ - PKGMK_FFMPEG+=' --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64' && \ - PATH="$PATH:/opt/cuda/bin" + prt-get isinst clang cuda nv-codec-headers && \ + PKGMK_FFMPEG+=' --enable-cuda-llvm --enable-nonfree --enable-cuda-nvcc --enable-libnpp' && \ + PKGMK_FFMPEG+=' --extra-cflags=-I/opt/cuda/include --extra-ldflags=-L/opt/cuda/lib64' && \ + PATH="$PATH:/opt/cuda/bin" prt-get isinst amf-headers && PKGMK_FFMPEG+=' --enable-amf' - prt-get isinst dav1d && PKGMK_FFMPEG+=' --enable-libdav1d' - prt-get isinst fdk-aac && PKGMK_FFMPEG+=' --enable-libfdk-aac --enable-nonfree' - prt-get isinst freetype && PKGMK_FFMPEG+=' --enable-libfreetype' - prt-get isinst gnutls && PKGMK_FFMPEG+=' --enable-gnutls' || PKGMK_FFMPEG+=' --enable-openssl --enable-nonfree' - prt-get isinst gsm && PKGMK_FFMPEG+=' --enable-libgsm' - prt-get isinst jack && PKGMK_FFMPEG+=' --enable-libjack' - prt-get isinst lame && PKGMK_FFMPEG+=' --enable-libmp3lame' - prt-get isinst libass && PKGMK_FFMPEG+=' --enable-libass' - prt-get isinst libtheora && PKGMK_FFMPEG+=' --enable-libtheora' - prt-get isinst libvdpau && PKGMK_FFMPEG+=' --enable-vdpau' - prt-get isinst libvorbis && PKGMK_FFMPEG+=' --enable-libvorbis' - prt-get isinst libvpx && PKGMK_FFMPEG+=' --enable-libvpx' - prt-get isinst libwebp && PKGMK_FFMPEG+=' --enable-libwebp' - prt-get isinst nv-codec-headers && PKGMK_FFMPEG+=' --enable-nvdec --enable-nvenc' - prt-get isinst opus && PKGMK_FFMPEG+=' --enable-libopus' - prt-get isinst pulseaudio && PKGMK_FFMPEG+=' --enable-libpulse' - prt-get isinst svt-av1 && PKGMK_FFMPEG+=' --enable-libsvtav1' - prt-get isinst x264 && PKGMK_FFMPEG+=' --enable-libx264' - prt-get isinst x265 && PKGMK_FFMPEG+=' --enable-libx265' + prt-get isinst dav1d && PKGMK_FFMPEG+=' --enable-libdav1d' + prt-get isinst fdk-aac && PKGMK_FFMPEG+=' --enable-libfdk-aac --enable-nonfree' + prt-get isinst freetype && PKGMK_FFMPEG+=' --enable-libfreetype' + prt-get isinst gnutls && PKGMK_FFMPEG+=' --enable-gnutls' || PKGMK_FFMPEG+=' --enable-openssl --enable-nonfree' + prt-get isinst gsm && PKGMK_FFMPEG+=' --enable-libgsm' + prt-get isinst jack && PKGMK_FFMPEG+=' --enable-libjack' + prt-get isinst lame && PKGMK_FFMPEG+=' --enable-libmp3lame' + prt-get isinst libass && PKGMK_FFMPEG+=' --enable-libass' + prt-get isinst libtheora && PKGMK_FFMPEG+=' --enable-libtheora' + prt-get isinst libvdpau && PKGMK_FFMPEG+=' --enable-vdpau' + prt-get isinst libvorbis && PKGMK_FFMPEG+=' --enable-libvorbis' + prt-get isinst libvpx && PKGMK_FFMPEG+=' --enable-libvpx' + prt-get isinst libwebp && PKGMK_FFMPEG+=' --enable-libwebp' + prt-get isinst nv-codec-headers && PKGMK_FFMPEG+=' --enable-nvdec --enable-nvenc' + prt-get isinst opus && PKGMK_FFMPEG+=' --enable-libopus' + prt-get isinst pulseaudio && PKGMK_FFMPEG+=' --enable-libpulse' + prt-get isinst svt-av1 && PKGMK_FFMPEG+=' --enable-libsvtav1' + prt-get isinst x264 && PKGMK_FFMPEG+=' --enable-libx264' + prt-get isinst x265 && PKGMK_FFMPEG+=' --enable-libx265' - patch -Np1 -i $SRC/add-av_stream_get_first_dts-for-chromium.patch + patch -Np1 -i $SRC/add-av_stream_get_first_dts-for-chromium.patch - sed -i -e '/check_cflags -fdiagnostics-color=auto/d' configure + sed -i -e '/check_cflags -fdiagnostics-color=auto/d' configure - ./configure ${PKGMK_FFMPEG} \ - --prefix=/usr \ - --optflags="$CFLAGS" \ - --cc=/usr/bin/gcc \ - --cxx=/usr/bin/g++ \ - --ar=/usr/bin/gcc-ar \ - --nm=/usr/bin/gcc-nm \ - --ranlib=/usr/bin/gcc-ranlib \ - --strip=/usr/bin/strip \ - --enable-gpl \ - --enable-version3 \ - --enable-shared \ - --enable-pic \ - --enable-lto \ - --enable-ffplay \ - --enable-avfilter \ - --enable-postproc \ - --enable-pthreads \ - --enable-swresample \ - --disable-debug \ - --disable-doc \ - --disable-libcelt \ - --disable-optimizations \ - --disable-stripping + patch -Np1 -i $SRC/ffmpeg-6.0-binutils_2.41-1.patch - make - make DESTDIR=$PKG install install-man + ./configure ${PKGMK_FFMPEG} \ + --prefix=/usr \ + --optflags="$CFLAGS" \ + --cc=/usr/bin/gcc \ + --cxx=/usr/bin/g++ \ + --ar=/usr/bin/gcc-ar \ + --nm=/usr/bin/gcc-nm \ + --ranlib=/usr/bin/gcc-ranlib \ + --strip=/usr/bin/strip \ + --enable-gpl \ + --enable-version3 \ + --enable-shared \ + --enable-pic \ + --enable-lto \ + --enable-ffplay \ + --enable-avfilter \ + --enable-postproc \ + --enable-pthreads \ + --enable-swresample \ + --disable-debug \ + --disable-doc \ + --disable-libcelt \ + --disable-optimizations \ + --disable-stripping - rm -r $PKG/usr/share/ffmpeg/examples + make + make DESTDIR=$PKG install install-man - if [ -e '/usr/lib/pkgconfig/x264.pc' ]; then - install -m 0755 -D $SRC/ffmpeg-x264-10bit.sh \ - $PKG/usr/bin/ffmpeg-x264-10bit - fi + rm -r $PKG/usr/share/ffmpeg/examples + + if [ -e '/usr/lib/pkgconfig/x264.pc' ]; then + install -m 0755 -D $SRC/ffmpeg-x264-10bit.sh \ + $PKG/usr/bin/ffmpeg-x264-10bit + fi } diff --git a/ffmpeg/ffmpeg-6.0-binutils_2.41-1.patch b/ffmpeg/ffmpeg-6.0-binutils_2.41-1.patch new file mode 100644 index 000000000..fdff7251d --- /dev/null +++ b/ffmpeg/ffmpeg-6.0-binutils_2.41-1.patch @@ -0,0 +1,80 @@ +Submitted By: Bruce Dubbs (bdubbs@linuxfromscratch.org) +Date: 2023-08-06 +Initial Package Version: 6.0 +Origin: Upstream +Upstream Status: Committed +Description: Allow building with binutils-2.41. + +From effadce6c756247ea8bae32dc13bb3e6f464f0eb Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Denis-Courmont?= <remi@remlab.net> +Date: Sun, 16 Jul 2023 18:18:02 +0300 +Subject: [PATCH] avcodec/x86/mathops: clip constants used with shift + instructions within inline assembly + +Fixes assembling with binutil as >= 2.41 + +Signed-off-by: James Almer <jamrial@gmail.com> +--- + libavcodec/x86/mathops.h | 26 +++++++++++++++++++++++--- + 1 file changed, 23 insertions(+), 3 deletions(-) + +diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h +index 6298f5ed1983..ca7e2dffc107 100644 +--- a/libavcodec/x86/mathops.h ++++ b/libavcodec/x86/mathops.h +@@ -35,12 +35,20 @@ + static av_always_inline av_const int MULL(int a, int b, unsigned shift) + { + int rt, dummy; ++ if (__builtin_constant_p(shift)) + __asm__ ( + "imull %3 \n\t" + "shrdl %4, %%edx, %%eax \n\t" + :"=a"(rt), "=d"(dummy) +- :"a"(a), "rm"(b), "ci"((uint8_t)shift) ++ :"a"(a), "rm"(b), "i"(shift & 0x1F) + ); ++ else ++ __asm__ ( ++ "imull %3 \n\t" ++ "shrdl %4, %%edx, %%eax \n\t" ++ :"=a"(rt), "=d"(dummy) ++ :"a"(a), "rm"(b), "c"((uint8_t)shift) ++ ); + return rt; + } + +@@ -113,19 +121,31 @@ __asm__ volatile(\ + // avoid +32 for shift optimization (gcc should do that ...) + #define NEG_SSR32 NEG_SSR32 + static inline int32_t NEG_SSR32( int32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("sarl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("sarl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + + #define NEG_USR32 NEG_USR32 + static inline uint32_t NEG_USR32(uint32_t a, int8_t s){ ++ if (__builtin_constant_p(s)) + __asm__ ("shrl %1, %0\n\t" + : "+r" (a) +- : "ic" ((uint8_t)(-s)) ++ : "i" (-s & 0x1F) + ); ++ else ++ __asm__ ("shrl %1, %0\n\t" ++ : "+r" (a) ++ : "c" ((uint8_t)(-s)) ++ ); + return a; + } + diff --git a/ffmpeg/vmaf-model-path.patch b/ffmpeg/vmaf-model-path.patch deleted file mode 100644 index abd65cdf7..000000000 --- a/ffmpeg/vmaf-model-path.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c -index 249e50c720..9b791e19b1 100644 ---- a/libavfilter/vf_libvmaf.c -+++ b/libavfilter/vf_libvmaf.c -@@ -72,7 +72,7 @@ typedef struct LIBVMAFContext { - #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM - - static const AVOption libvmaf_options[] = { -- {"model_path", "Set the model to be used for computing vmaf.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str="/usr/local/share/model/vmaf_v0.6.1.pkl"}, 0, 1, FLAGS}, -+ {"model_path", "Set the model to be used for computing vmaf.", OFFSET(model_path), AV_OPT_TYPE_STRING, {.str="/usr/share/model/vmaf_v0.6.1.pkl"}, 0, 1, FLAGS}, - {"log_path", "Set the file path to be used to store logs.", OFFSET(log_path), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, - {"log_fmt", "Set the format of the log (xml or json).", OFFSET(log_fmt), AV_OPT_TYPE_STRING, {.str=NULL}, 0, 1, FLAGS}, - {"enable_transform", "Enables transform for computing vmaf.", OFFSET(enable_transform), AV_OPT_TYPE_BOOL, {.i64=0}, 0, 1, FLAGS},
participants (1)
-
crux@crux.nu