aboutsummaryrefslogtreecommitdiff
path: root/multimedia/HandBrake/HandBrake.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'multimedia/HandBrake/HandBrake.SlackBuild')
-rw-r--r--multimedia/HandBrake/HandBrake.SlackBuild92
1 files changed, 88 insertions, 4 deletions
diff --git a/multimedia/HandBrake/HandBrake.SlackBuild b/multimedia/HandBrake/HandBrake.SlackBuild
index caddf70ddc..a3e330fb51 100644
--- a/multimedia/HandBrake/HandBrake.SlackBuild
+++ b/multimedia/HandBrake/HandBrake.SlackBuild
@@ -34,11 +34,24 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=HandBrake
-VERSION=${VERSION:-1.9.2}
+VERSION=${VERSION:-1.10.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
+# A lot of versions to define...
+amfVER=${amfVER:-1.4.36}
+svtVER=${svtVER:-3.1.0}
+dav1dVER=${dav1dVER:-1.5.1}
+fdkVER=${fdkVER:-2.0.3}
+ffmpegVER=${ffmpegVER:-7.1.1}
+blurayVER=${blurayVER:-1.3.4}
+dvdnavVER=${dvdnavVER:-6.1.1}
+dvdreadVER=${dvdreadVER:-6.1.3}
+vplVER=${vplVER:-2.15.0}
+x265VER=${x265VER:-20250729-13276}
+zimgVER=${zimgVER:-20250624}
+
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i686 ;;
@@ -79,7 +92,18 @@ rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION-source.tar.bz2
cd $PRGNAM-$VERSION
mkdir -p download
-cp -r $CWD/*.tar.{gz,bz2} download/
+cp -a $CWD/AMF-${amfVER}-slim.tar.gz \
+ $CWD/SVT-AV1-v${svtVER}.tar.gz \
+ $CWD/dav1d-${dav1dVER}.tar.bz2 \
+ $CWD/fdk-aac-${fdkVER}.tar.gz \
+ $CWD/ffmpeg-${ffmpegVER}.tar.bz2 \
+ $CWD/libbluray-${blurayVER}.tar.bz2 \
+ $CWD/libdvdnav-${dvdnavVER}.tar.bz2 \
+ $CWD/libdvdread-${dvdreadVER}.tar.bz2 \
+ $CWD/libvpl-${vplVER}.tar.gz \
+ $CWD/x265-snapshot-${x265VER}.tar.gz \
+ $CWD/zimg-snapshot-${zimgVER}.tar.gz \
+ download/
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
@@ -88,13 +112,68 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
# Correct dependency tarball naming inconsistency
-mv download/AMF-1.4.35-slim.tar.gz download/AMF-1.4.35.tar.gz
+mv download/AMF-${amfVER}-slim.tar.gz download/AMF-${amfVER}.0.tar.gz
-# Disable 10/12bit x265 on 32bit since it fails compilation
+# x265 support on i?86 is not officially supported anymore.
+# https://github.com/HandBrake/HandBrake/issues/6111
+# I will keep trying to support it until I come across the roadblock
+# I can't fix :)
if echo "$ARCH" | grep -q "i.86"; then
+ # Disable 10/12bit x265 on 32bit since it fails compilation
sed -i '/1[02]bit/d' make/include/main.defs
sed -i '/1[02]bit/d;s|main.a \\|main.a|' contrib/x265/module.defs
sed -i 's|-DEXTRA_LIB="x265_main10.a;x265_main12.a" -DEXTRA_LINK_FLAGS=-L. -DLINKED_10BIT=ON -DLINKED_12BIT=ON ||' contrib/x265_8bit/module.defs
+
+ # x265 compilation was broken on i?86 when UNIX64 was replaced with FORMAT_ELF
+ # Reverting that change allows compilation to occur.
+ cat << EOF > contrib/x265/A09-Fix-compilation-on-x86.patch
+diff --git a/source/common/x86/cpu-a.asm b/source/common/x86/cpu-a.asm
+index 747b921f7..2f469f6ec 100644
+--- a/source/common/x86/cpu-a.asm
++++ b/source/common/x86/cpu-a.asm
+@@ -177,7 +177,7 @@ cglobal safe_intel_cpu_indicator_init
+ %if WIN64
+ lea rax, [intel_cpu_indicator_init]
+ call rax
+-%elif FORMAT_ELF
++%elif UNIX64
+ call [rel intel_cpu_indicator_init wrt ..plt]
+ %else
+ call intel_cpu_indicator_init
+diff --git a/source/common/x86/pixel-util8.asm b/source/common/x86/pixel-util8.asm
+index 6ad2852d3..6d25c4112 100644
+--- a/source/common/x86/pixel-util8.asm
++++ b/source/common/x86/pixel-util8.asm
+@@ -8485,7 +8485,7 @@ cglobal costCoeffNxN, 6,11,6
+ ; r5 - scanFlagMask
+ ; r6 - sum
+
+-%if FORMAT_ELF
++%if UNIX64
+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]
+ %else
+ lea r0, [private_prefix %+ _entropyStateBits]
+@@ -8670,7 +8670,7 @@ cglobal costCoeffNxN, 6,10,5
+ ; r6 - sum
+ ; {r3,r4} - ctxSig[15-0]
+ ; r8m - (numNonZero != 0) || (subPosBase == 0)
+-%if FORMAT_ELF
++%if UNIX64
+ mov r0, [private_prefix %+ _entropyStateBits wrt ..gotpc]
+ %else
+ lea r0, [private_prefix %+ _entropyStateBits]
+@@ -8914,7 +8914,7 @@ cglobal costC1C2Flag, 4,12,2
+ or r11d, 0x100 ; default value setting to 8
+ bsf r11d, r11d
+
+-%if FORMAT_ELF
++%if UNIX64
+ mov r5, [private_prefix %+ _entropyStateBits wrt ..gotpc]
+ %else
+ lea r5, [private_prefix %+ _entropyStateBits]
+--
+2.49.0
+EOF
fi
# Make the GUI optional
@@ -102,6 +181,11 @@ if [ "$GUI" == "no" ]; then
GTK_GUI="--disable-gtk"
else
GTK_GUI="--enable-gtk"
+ # Officially supported HandBrake distros no longer have gtk lower
+ # than 4.6, so they removed gtk-4.4 support. Reverting this patch
+ # until it breaks.
+ # https://github.com/HandBrake/HandBrake/pull/7090
+ patch -Rp1 < $CWD/revert-gtk-4.6-switch.patch
fi
# libdovi and nvdec/nvenc currently don't compile successfully on my