diff options
Diffstat (limited to 'source/l/ffmpeg/ffmpeg.SlackBuild')
-rwxr-xr-x | source/l/ffmpeg/ffmpeg.SlackBuild | 76 |
1 files changed, 58 insertions, 18 deletions
diff --git a/source/l/ffmpeg/ffmpeg.SlackBuild b/source/l/ffmpeg/ffmpeg.SlackBuild index 49bfcc602..1553821b0 100755 --- a/source/l/ffmpeg/ffmpeg.SlackBuild +++ b/source/l/ffmpeg/ffmpeg.SlackBuild @@ -2,8 +2,8 @@ # Slackware build script for ffmpeg -# Copyright 2010-2017 Heinz Wiesinger, Amsterdam, The Netherlands -# Copyright 2017, 2018 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2010-2024 Heinz Wiesinger, Amsterdam, The Netherlands +# Copyright 2017, 2018, 2022, 2024 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -46,10 +46,10 @@ PKG=$TMP/package-$PKGNAM NUMJOBS=${NUMJOBS:-" -j$(expr $(nproc) + 1) "} if [ "$ARCH" = "i586" ]; then - SLKCFLAGS="-O2 -march=i586 -mtune=i686" + SLKCFLAGS="-O2 -march=i586 -mtune=i686 -fPIC" LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" + SLKCFLAGS="-O2 -march=i686 -mtune=i686 -fPIC" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" @@ -89,13 +89,25 @@ fi # - xz # - zlib +# Select one of these for HTTPS support +ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \ + { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; } +gnutls="" ; [ "${GNUTLS:-yes}" != "no" ] && gnutls="--enable-gnutls" + +# Select one of these for RTMP[E] support +librtmp="" ; [ "${RTMP:-no}" != "no" ] && librtmp="--enable-librtmp" +gmp="" ; [ "${GMP:-no}" != "no" ] && gmp="--enable-gmp" +libgcrypt="" ; [ "${GCRYPT:-yes}" != "no" ] && libgcrypt="--enable-gcrypt" + +# Select one of these for GLSL->SPIRV compilation (Required for Vulkan support) +libglslang="" ; [ "${GLSLANG:-no}" != "no" ] && libglslang="--enable-libglslang" +shaderc="" ; [ "${SHADERC:-yes}" != "no" ] && libshaderc="--enable-libshaderc" + libx264="" ; [ "${X264:-no}" != "no" ] && libx264="--enable-libx264" libcelt="" ; [ "${CELT:-no}" != "no" ] && libcelt="--enable-libcelt" libdc1394="" ; [ "${DC1394:-no}" != "no" ] && libdc1394="--enable-libdc1394" libgsm="" ; [ "${GSM:-no}" != "no" ] && libgsm="--enable-libgsm" -librtmp="" ; [ "${RTMP:-no}" != "no" ] && librtmp="--enable-librtmp" libxvid="" ; [ "${XVID:-no}" != "no" ] && libxvid="--enable-libxvid" -libass="" ; [ "${ASS:-no}" != "no" ] && libass="--enable-libass" libiec61883=""; [ "${IEC61883:-no}" != "no" ] && libiec61883="--enable-libiec61883" libilbc="" ; [ "${ILBC:-no}" != "no" ] && libilbc="--enable-libilbc" libmodplug="" ; [ "${MODPLUG:-no}" != "no" ] && libmodplug="--enable-libmodplug" @@ -104,7 +116,6 @@ ladspa="" ; [ "${LADSPA:-no}" != "no" ] && ladspa="--enable-ladspa" libflite="" ; [ "${FLITE:-no}" != "no" ] && libflite="--enable-libflite" libx265="" ; [ "${X265:-no}" != "no" ] && libx265="--enable-libx265" libzvbi="" ; [ "${ZVBI:-no}" != "no" ] && libzvbi="--enable-libzvbi" -libopencv="" ; [ "${OPENCV:-no}" != "no" ] && libopencv="--enable-libopencv" libgme="" ; [ "${GME:-no}" != "no" ] && libgme="--enable-libgme" libsnappy="" ; [ "${SNAPPY:-no}" != "no" ] && libsnappy="--enable-libsnappy" libzmq="" ; [ "${ZMQ:-no}" != "no" ] && libzmq="--enable-libzmq" @@ -126,20 +137,28 @@ opencore_amr="" ; [ "${OPENCORE:-no}" != "no" ] && \ opencore_amr="--enable-libopencore-amrnb --enable-libopencore-amrwb" fdk="" ; [ "${FDK_AAC:-no}" != "no" ] && \ { fdk="--enable-libfdk-aac"; non_free="--enable-nonfree" ; } -ssl="" ; [ "${OPENSSL:-no}" != "no" ] && \ - { ssl="--enable-openssl" ; non_free="--enable-nonfree" ; } decklink="" ; [ "${DECKLINK:-no}" != "no" ] && \ { decklink="--enable-decklink" ; \ SLKCFLAGS="$SLKCFLAGS -I/usr/include/decklink" ; } -vulkan="" ; [ "${VULKAN:-no}" != "no" ] && vulkan="--enable-vulkan" -libglslang="" ; [ "${GLSLANG:-no}" != "no" ] && libglslang="--enable-libglslang" +libaribb24="" ; [ "${ARIBB24:-no}" != "no" ] && libaribb24="--enable-libaribb24" +libjxl="" ; [ "${JXL:-no}" != "no" ] && libjxl="--enable-libjxl" +librist="" ; [ "${RIST:-no}" != "no" ] && librist="--enable-librist" +libshine="" ; [ "${SHINE:-no}" != "no" ] && libshine="--enable-libshine" +svtav1="" ; [ "${SVTAV1:-no}" != "no" ] && svtav1="--enable-libsvtav1" +libmysofa="" ; [ "${MYSOFA:-no}" != "no" ] && libmysofa="--enable-libmysofa" +libxavs2="" ; [ "${XAVS2:-no}" != "no" ] && libxavs2="--enable-libxavs2" +libvmaf="" ; [ "${VMAF:-no}" != "no" ] && libvmaf="--enable-libvmaf" + +# Needs older opencv than we ship. See https://trac.ffmpeg.org/ticket/7059 +libopencv="" ; [ "${OPENCV:-no}" != "no" ] && libopencv="--enable-libopencv" + +# Needs newer lensfun than we ship. See https://trac.ffmpeg.org/ticket/9112 liblensfun="" ; [ "${LENSFUN:-no}" != "no" ] && liblensfun="--enable-liblensfun" # Default enabled features: fontconfig="" ; [ "${FONTCONFIG:-yes}" != "no" ] && fontconfig="--enable-libfontconfig" freetype="" ; [ "${FREETYPE:-yes}" != "no" ] && freetype="--enable-libfreetype" fribidi="" ; [ "${FRIBIDI:-yes}" != "no" ] && fribidi="--enable-libfribidi" -gnutls="" ; [ "${GNUTLS:-yes}" != "no" ] && gnutls="--enable-gnutls" libbluray="" ; [ "${BLURAY:-yes}" != "no" ] && libbluray="--enable-libbluray" libcaca="" ; [ "${CACA:-yes}" != "no" ] && libcaca="--enable-libcaca" libcdio="" ; [ "${LIBCDIO:-yes}" != "no" ] && libcdio="--enable-libcdio" @@ -163,6 +182,10 @@ libvidstab="" ; [ "${VIDSTAB:-yes}" != "no" ] && libvidstab="--enable-libvid libxml2="" ; [ "${LIBXML2:-yes}" != "no" ] && libxml2="--enable-libxml2" librsvg="" ; [ "${LIBRSVG:-yes}" != "no" ] && librsvg="--enable-librsvg" libdrm="" ; [ "${LIBDRM:-yes}" != "no" ] && libdrm="--enable-libdrm" +vulkan="" ; [ "${VULKAN:-yes}" != "no" ] && vulkan="--enable-vulkan" +libass="" ; [ "${ASS:-yes}" != "no" ] && libass="--enable-libass" +libplacebo="" ; [ "${PLACEBO:-yes}" != "no" ] && libplacebo="--enable-libplacebo" +lcms2="" ; [ "${LCMS2:-yes}" != "no" ] && lcms2="--enable-lcms2" # No default patent encumbered features: aac="" ; [ "${AAC:-no}" = "no" ] && aac="--disable-encoder=aac" @@ -171,7 +194,7 @@ rm -rf $PKG mkdir -p $TMP $PKG cd $TMP rm -rf $PKGNAM-$VERSION -tar xvf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1 +tar xf $CWD/$PKGNAM-$VERSION.tar.xz || exit 1 cd $PKGNAM-$VERSION || exit 1 chown -R root:root . @@ -181,9 +204,14 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ -# Fix linking with flite: -sed -i "s| -lflite\"| -lflite -lm -lasound\"|" \ - ./configure +# Restore missing function needed by Chromium and qt-webengine: +zcat $CWD/add-av_stream_get_first_dts-for-chromium.patch.gz | patch -p1 --verbose || exit 1 + +# Build against recent Vulkan: +zcat $CWD/ffmpeg.vulkan.diff.gz | patch -p1 --verbose || exit 1 + +# Fix ctx memory leak: +zcat $CWD/250471ea1745fc703eb346a2a662304536a311b1.patch | patch -p1 --verbose || exit 1 CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ @@ -198,7 +226,6 @@ CXXFLAGS="$SLKCFLAGS" \ --disable-static \ --enable-gpl \ --enable-version3 \ - --enable-avresample \ --arch=$ARCH \ $non_free \ $aac \ @@ -268,7 +295,20 @@ CXXFLAGS="$SLKCFLAGS" \ $libsoxr \ $libsrt \ $libzimg \ - $vapoursynth || exit 1 + $vapoursynth \ + $libshaderc \ + $libgcrypt \ + $libplacebo \ + $lcms2 \ + $gmp \ + $libaribb24 \ + $libjxl \ + $librist \ + $libshine \ + $svtav1 \ + $libmysofa \ + $libxavs2 \ + $libvmaf || exit 1 make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 |