summaryrefslogtreecommitdiff
path: root/games/haxima-nazghul/haxima-nazghul.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/haxima-nazghul/haxima-nazghul.SlackBuild')
-rw-r--r--games/haxima-nazghul/haxima-nazghul.SlackBuild40
1 files changed, 27 insertions, 13 deletions
diff --git a/games/haxima-nazghul/haxima-nazghul.SlackBuild b/games/haxima-nazghul/haxima-nazghul.SlackBuild
index d1ac8c62cf..b936cd36a3 100644
--- a/games/haxima-nazghul/haxima-nazghul.SlackBuild
+++ b/games/haxima-nazghul/haxima-nazghul.SlackBuild
@@ -22,12 +22,17 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220220 bkw: Modified by SlackBuilds.org, BUILD=2:
+# - fix build on 15.0.
+# - fix .desktop so it validates and has correct paths.
+# - move the nazghul binary to libexec, since it doesn't run on its own.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=haxima-nazghul
SRCNAM=$(echo $PRGNAM | cut -c8-14)
VERSION=${VERSION:-0.7.1}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -39,9 +44,6 @@ if [ -z "$ARCH" ]; then
esac
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
@@ -76,30 +78,42 @@ cd $SRCNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
DOCS="doc/GHULSCRIPT doc/USERS_GUIDE doc/GAME_RULES doc/MAP_HACKERS_GUIDE \
doc/world_building/*.txt"
-sed -i 's/Exec\=haxima/Exec\=haxima.sh/' haxima.desktop
+
+# 20220220 bkw: source defines its own min() max() distance() macros,
+# which conflict with the ones in the modern STL. just renaming them
+# works.
+sed -i -e 's,\<max *(,Max(,g' \
+ -e 's,\<min *(,Min(,g' \
+ -e 's,\<distance *(,Distance(,g' \
+ src/*
CFLAGS="$SLKCFLAGS" \
-CXXFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS -std=gnu++98" \
./configure \
--prefix=/usr \
- --datadir=/usr/share/games \
+ --bindir=/usr/libexec/$PRGNAM \
+ --datadir=/usr/share/games/$PRGNAM \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make
-make install DESTDIR=$PKG
+make install-strip DESTDIR=$PKG
-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
+mkdir -p $PKG/usr/games
+sed "s,/usr/bin/,/usr/libexec/$PRGNAM/," \
+ < $PKG/usr/libexec/$PRGNAM/haxima.sh \
+ > $PKG/usr/games/haxima.sh
+rm -f $PKG/usr/libexec/$PRGNAM/haxima.sh
+chmod 755 $PKG/usr/games/haxima.sh
mkdir -p $PKG/usr/share/applications
-install -D -m644 haxima.desktop $PKG/usr/share/applications/$PRGNAM.desktop
+install -D -m644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop
mkdir -p $PKG/usr/share/pixmaps/
install -D -m644 icons/haxima.png $PKG/usr/share/pixmaps/haxima.png