diff options
Diffstat (limited to 'multimedia/uavs3d/uavs3d.SlackBuild')
-rw-r--r-- | multimedia/uavs3d/uavs3d.SlackBuild | 42 |
1 files changed, 19 insertions, 23 deletions
diff --git a/multimedia/uavs3d/uavs3d.SlackBuild b/multimedia/uavs3d/uavs3d.SlackBuild index 91029aad2258c..141e072f29e20 100644 --- a/multimedia/uavs3d/uavs3d.SlackBuild +++ b/multimedia/uavs3d/uavs3d.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for uavs3d -# Copyright 2022-23 Vijay Marcel +# Copyright 2022-24 Vijay Marcel # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -25,19 +25,18 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=uavs3d -VERSION=${VERSION:-20220911_0133ee4} -COMMIT=${COMMIT:-0133ee4b4bbbef7b88802e7ad019b14b9b852c2b} +VERSION=${VERSION:-1.1} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} +sys_arch=${sys_arch:-$(uname -m)} -if [ -z "$ARCH" ]; then - case "$( uname -m )" in - i?86) export ARCH=i586 ;; - arm*) export ARCH=arm ;; - *) export ARCH=$( uname -m ) ;; - esac -fi +case "$sys_arch" in + i586) export ARCH=i586 ;; + i686) export ARCH=i686 ;; + x86_64) export ARCH=x86_64 ;; + *) echo "This program will not build on $sys_arch platform" && exit 1 ;; +esac TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -53,13 +52,9 @@ elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fPIC" LIBDIRSUFFIX="64" else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" + echo "This program will not build on $sys_arch platform" && exit 1 fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -71,9 +66,9 @@ trap 'echo "$0 FAILED at line $LINENO!" | tee -a $OUTPUT/error-${PRGNAM}.log' ER rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$COMMIT -tar xvf $CWD/$PRGNAM-$COMMIT.tar.gz -cd $PRGNAM-$COMMIT +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION chown -R root:root . find -L . \ @@ -82,13 +77,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 {} \; +patch -p1 --verbose --unified < $CWD/fix-build-issue.patch cd source -patch --verbose --unified < $CWD/cmakelist.patch +patch --verbose --unified < $CWD/fix-libdir-in-cmakelists.patch cd .. mkdir -pv build/linux -cmake -B build/linux -S $TMP/$PRGNAM-$COMMIT \ +cmake -B build/linux -S $TMP/$PRGNAM-$VERSION \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_BUILD_TYPE:STRING=Release \ @@ -99,12 +95,12 @@ cmake -B build/linux -S $TMP/$PRGNAM-$COMMIT \ cmake --build build/linux -make -C $TMP/$PRGNAM-$COMMIT/build/linux DESTDIR="$PKG" install +make -C $TMP/$PRGNAM-$VERSION/build/linux DESTDIR="$PKG" install -install -D -m755 $TMP/$PRGNAM-$COMMIT/build/linux/uavs3dec -t "$PKG/usr/bin" +install -D -m755 $TMP/$PRGNAM-$VERSION/build/linux/uavs3dec -t "$PKG/usr/bin" find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" \ - | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded --remove-section=.comment --remove-section=.note 2> /dev/null || true # Don't ship .la files: rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la |