diff options
author | Eric Hameleers <alien@slackware.com> | 2021-08-12 12:29:00 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2021-08-12 12:29:00 +0000 |
commit | 7c4618933325852f83cc5c2deb8b47b2d58dd457 (patch) | |
tree | 99bca9b7a4e598889a13ee31547e65bc5be0fdc1 | |
parent | 37060a8dcc1c72a96f1b5a053d9e23b781c5efd4 (diff) | |
download | asb-7c4618933325852f83cc5c2deb8b47b2d58dd457.tar.gz asb-7c4618933325852f83cc5c2deb8b47b2d58dd457.tar.xz |
handbrake: make 1.4 compile on Slackware 14.2
-rwxr-xr-x | handbrake/build/handbrake.SlackBuild | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/handbrake/build/handbrake.SlackBuild b/handbrake/build/handbrake.SlackBuild index e1a9a394..82b97e64 100755 --- a/handbrake/build/handbrake.SlackBuild +++ b/handbrake/build/handbrake.SlackBuild @@ -29,7 +29,7 @@ # Descr: video transcoder and ripper # URL: http://handbrake.fr/ # Build needs:(Slackware 14.2 only): -# meson, python3, python3-setuptools, newer nasm. +# meson, python3, python3-setuptools, clang >= 8, nasm >= 2.13.02. # Needs: vlc or libdvdcss (to read encrypted DVD's) # Changelog: # r2606-1: 23/Jun/2009 by Eric Hameleers, Eindhoven, NL @@ -401,6 +401,13 @@ echo "++" echo "|| $PRGNAM-$VERSION" echo "++" +# On Slackware 14.2 we need to use clang from the updated llvm package in /extra +# since the stock gcc or clang fail to compile handbrake 1.4.x: +if [ $(cat /etc/slackware-version |cut -d' ' -f2- |cut -d. -f1) -lt 15 ]; then + export CC=clang + export CXX=clang++ +fi + cd $TMP/tmp-$PRGNAM # @@ -450,6 +457,13 @@ if [ "${ARCH}" != "x86_64" ]; then contrib/x265_12bit/module.defs fi +# Add '--build' to configure to prevent 'alignas: requested alignment +# is not a power of 2' compilation error on 32bit: +if [ $(cat /etc/slackware-version |cut -d' ' -f2- |cut -d. -f1) -lt 15 ]; then + sed -i -e 's/^ZIMG.CONFIGURE.extra *+= .*$/& --build='$TARGET'/' \ + contrib/zimg/module.defs +fi + if [ "$WITH_GUI" = "YES" -o "$WITH_GUI" = "yes" ]; then GUI_OPTS="--disable-gtk-update-checks" else @@ -486,8 +500,13 @@ HBDEPSDIR="$TMP/tmp-$PRGNAM/HandBrake-$VERSION/build/contrib" # against libfribidi.a on 32bit. # The '-lm' is required to make speex link: # The '-lpthreead' is needed to make dav1d link: -export CFLAGS="-I$HBDEPSDIR/include -fno-aggressive-loop-optimizations -fno-strict-aliasing $SLKCFLAGS" -export CXXFLAGS="-I$HBDEPSDIR/include -fno-aggressive-loop-optimizations -fno-strict-aliasing $SLKCFLAGS" +export CFLAGS="-I$HBDEPSDIR/include -fno-strict-aliasing $SLKCFLAGS" +export CXXFLAGS="-I$HBDEPSDIR/include -fno-strict-aliasing $SLKCFLAGS" +if [ "$CC" != "clang" ] ; then + # '-fno-aggressive-loop-optimizations' is incompatible with clang: + export CFLAGS="$CFLAGS -fno-aggressive-loop-optimizations" + export CXXFLAGS="$CXXFLAGS -fno-aggressive-loop-optimizations" +fi export LDFLAGS="-L$HBDEPSDIR/lib -lglib-2.0 -lm -lpthread $SLKLDFLAGS" export PATH="$HBDEPSDIR/bin:$PATH" export PKG_CONFIG_PATH="$HBDEPSDIR/lib/pkgconfig" |