summaryrefslogtreecommitdiffstats
path: root/games/cosmic_assault/cosmic_assault.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/cosmic_assault/cosmic_assault.SlackBuild')
-rw-r--r--games/cosmic_assault/cosmic_assault.SlackBuild51
1 files changed, 39 insertions, 12 deletions
diff --git a/games/cosmic_assault/cosmic_assault.SlackBuild b/games/cosmic_assault/cosmic_assault.SlackBuild
index 913365143c..b09074ffd6 100644
--- a/games/cosmic_assault/cosmic_assault.SlackBuild
+++ b/games/cosmic_assault/cosmic_assault.SlackBuild
@@ -1,19 +1,33 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for cosmic_assault
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20230107 bkw: BUILD=3, fix icon size.
+# 20211228 bkw: BUILD=2.
+# - convert .mod music to .ogg, since -current's SDL2_mixer (and thus
+# pygame) utterly lack MOD music support.
+# - use pygame.SCALED to scale the game to the desktop resolution.
+# - new-style icon.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=cosmic_assault
VERSION=${VERSION:-1.1}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
ARCH=noarch
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -29,11 +43,22 @@ rm -rf $PRGNAM
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $PRGNAM
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 \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# 20211228 bkw: this makes the game behave better as a fullscreen app.
+sed -i '/winstyle/s,FULLSCREEN,pygame.SCALED | pygame.FULLSCREEN,' $PRGNAM.py
+
+# 20211228 bkw: no tracker music support in SDL2_mixer (yet?). This
+# workaround is OK, but it bloats the package by 500% (from ~1MB to
+# ~5MB, which is still not so large by modern standards).
+sed -i \
+ -e 's,jene\.mod,jene.ogg,' \
+ -e 's,beyond\.s3m,beyond.ogg,' \
+ $PRGNAM.py
+timidity -Ow1sl -id -o- data/jene.mod | oggenc -Q -b 64 -o data/jene.ogg -
+timidity -Ow1sl -id -o- data/beyond.s3m | oggenc -Q -b 64 -o data/beyond.ogg -
+rm -f data/jene.mod data/beyond.s3m
mkdir -p $PKG/usr/games $PKG/usr/share/games/$PRGNAM
install -m0755 $PRGNAM.py $PKG/usr/share/games/$PRGNAM
@@ -42,8 +67,10 @@ cp -a data $PKG/usr/share/games/$PRGNAM
# icon made from game data image:
# convert -scale 64x64 data/newship.gif cosmic_assault.png
-mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+# ...and then fixed up with the gimp :(
+mkdir -p $PKG/usr/share/icons/hicolor/64x64/apps $PKG/usr/share/pixmaps
+cat $CWD/$PRGNAM.png > $PKG/usr/share/icons/hicolor/64x64/apps/$PRGNAM.png
+ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
# .desktop written for this build
mkdir -p $PKG/usr/share/applications
@@ -59,4 +86,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE