diff options
-rw-r--r-- | games/cosmic_assault/cosmic_assault.SlackBuild | 27 | ||||
-rw-r--r-- | games/cosmic_assault/doinst.sh | 6 |
2 files changed, 30 insertions, 3 deletions
diff --git a/games/cosmic_assault/cosmic_assault.SlackBuild b/games/cosmic_assault/cosmic_assault.SlackBuild index a6782f51ce..de2e209fc6 100644 --- a/games/cosmic_assault/cosmic_assault.SlackBuild +++ b/games/cosmic_assault/cosmic_assault.SlackBuild @@ -6,11 +6,17 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 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} @@ -39,6 +45,20 @@ chown -R root:root . 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 install -m0755 $CWD/$PRGNAM.sh $PKG/usr/games/$PRGNAM @@ -46,8 +66,9 @@ 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 +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 diff --git a/games/cosmic_assault/doinst.sh b/games/cosmic_assault/doinst.sh index 5fb28930db..3e5691a052 100644 --- a/games/cosmic_assault/doinst.sh +++ b/games/cosmic_assault/doinst.sh @@ -1,3 +1,9 @@ if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi |