summaryrefslogtreecommitdiff
path: root/games/vbam/vbam.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/vbam/vbam.SlackBuild')
-rw-r--r--games/vbam/vbam.SlackBuild32
1 files changed, 24 insertions, 8 deletions
diff --git a/games/vbam/vbam.SlackBuild b/games/vbam/vbam.SlackBuild
index fb3fb9d7aa..4e671377fd 100644
--- a/games/vbam/vbam.SlackBuild
+++ b/games/vbam/vbam.SlackBuild
@@ -20,10 +20,19 @@
PRGNAM=vbam
VERSION=r856
-ARCH=${ARCH:-i486}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
@@ -38,29 +47,36 @@ elif [ "$ARCH" = "i686" ]; then
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
fi
+set -e
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
-cd $TMP || exit 1
+cd $TMP
rm -rf $PRGNAM-$VERSION
-tar -xjvf $CWD/$PRGNAM-$VERSION.tar.bz2 || exit 1
-cd $PRGNAM-$VERSION || exit 1
+tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
+cd $PRGNAM-$VERSION
chown -R root:root .
find . \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
-exec chmod 755 {} \; -o \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
+# Fix an invalid conversion from const char to char
+patch -p1 < $CWD/vbam-r856-debugger.cpp.diff
+
cmake . \
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX="/usr" \
- -DNO_GTK=1 \
- || exit 1
+ -DNO_GTK=1
-make || exit 1
-make install DESTDIR=$PKG || exit 1
+make
+make install DESTDIR=$PKG
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true