summaryrefslogtreecommitdiff
path: root/games/pioneer/pioneer.SlackBuild
diff options
context:
space:
mode:
authorHunter Sezen <orbea@riseup.net>2019-04-27 04:39:22 +0700
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2019-04-27 04:39:22 +0700
commit513bdd579271ee972218ad7677f54a2396cfdb3f (patch)
treeedee63128b0ffb2ebc3d3563a2ad15431b246fa1 /games/pioneer/pioneer.SlackBuild
parentad8ed24e625c5d57272b25ca6beee828412ebe1c (diff)
downloadslackbuilds-513bdd579271ee972218ad7677f54a2396cfdb3f.tar.gz
games/pioneer: Updated for version 20190203.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/pioneer/pioneer.SlackBuild')
-rw-r--r--games/pioneer/pioneer.SlackBuild78
1 files changed, 33 insertions, 45 deletions
diff --git a/games/pioneer/pioneer.SlackBuild b/games/pioneer/pioneer.SlackBuild
index ab1ca14870..ab07afcbcf 100644
--- a/games/pioneer/pioneer.SlackBuild
+++ b/games/pioneer/pioneer.SlackBuild
@@ -1,8 +1,8 @@
#!/bin/sh
-# Slackware build script for Pioneer
+# Slackware build script for pioneer
-# Copyright 2015-2018 Hunter Sezen California, USA
+# Copyright 2015-2019 Hunter Sezen California, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,7 +24,7 @@
PRGNAM=pioneer
SRCNAM=$(printf %s $PRGNAM | tr [a-z] [A-Z])
-VERSION=${VERSION:-20180203}
+VERSION=${VERSION:-20190203}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -70,56 +70,44 @@ 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 {} \;
-if [ "${DEBUG:-no}" != no ]; then
- debug="--enable-debug \
- --with-no-optimise \
- --with-fno-inline"
+if [ "${DEBUG:=0}" != 0 ]; then
+ RELEASE=Debug
SLKCFLAGS="$(printf %s "$SLKCFLAGS" | sed 's/-O2/-O0/')"
else
- debug='--with-strip'
+ RELEASE=Release
fi
-# Generate the configure file
-./bootstrap
-
-CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
-PIONEER_DATA_DIR="${DATADIR:-/usr/share/games}/$PRGNAM" \
-./configure \
- --prefix=/usr \
- --bindir=/usr/games \
- $debug \
- --build=$ARCH-slackware-linux
-
-make
-make install DESTDIR=$PKG
-
-# Write a desktop file
-mkdir -p $PKG/usr/share/applications
-cat > $PKG/usr/share/applications/$PRGNAM.desktop <<EOF
-[Desktop Entry]
-Name=$SRCNAM
-Exec=$PRGNAM
-Icon=$PRGNAM
-Type=Application
-Comment=$SRCNAM (space adventure game)
-Categories=Game;AdventureGame;
-EOF
-
-# Add missing icons to package
-for pngicon in application-icon/pngs/*.png ; do
- if [ -f "$pngicon" ]; then
- size="$(basename "${pngicon##*-}" .png)"
- install -D -m644 "$pngicon" \
- $PKG/usr/share/icons/hicolor/$size/apps/$PRGNAM.png
- fi
-done
-install -D -m644 application-icon/badge-full.svg \
- $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg
+GLEW=OFF
+LUA=OFF
+
+pkg-config --exists glew && GLEW=ON
+pkg-config --exists lua5.2 && LUA=ON
+
+# pioneer installs the game data directly to the system if
+# using any other directory than /usr/share/pioneer.
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_INSTALL_BINDIR=games \
+ -DPIONEER_DATA_DIR=/usr/share/$PRGNAM \
+ -DUSE_SYSTEM_LIBGLEW=$GLEW \
+ -DUSE_SYSTEM_LIBLUA=$LUA \
+ -DCMAKE_BUILD_TYPE=$RELEASE ..
+ make
+ make install DESTDIR=$PKG
+cd ..
# Remove empty .gitignore files
find $PKG -name '.gitignore' -exec rm -f {} \;
+if [ "$DEBUG" = 0 ]; then
+ 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
+fi
+
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a licenses *.txt README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild