summaryrefslogtreecommitdiff
path: root/games/solarwolf
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2021-12-28 14:46:32 -0500
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-01-04 07:55:38 +0700
commit21a28ca3db27f3d69e5c120009193b212b22c7a5 (patch)
treeea6fcee43137865c3e246c87031fff0c687dc261 /games/solarwolf
parent05cc9a566d50e97766d64c886d4de71dc2c998c2 (diff)
downloadslackbuilds-21a28ca3db27f3d69e5c120009193b212b22c7a5.tar.gz
games/solarwolf: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/solarwolf')
-rw-r--r--games/solarwolf/doinst.sh6
-rw-r--r--games/solarwolf/solarwolf.SlackBuild37
-rw-r--r--games/solarwolf/solarwolf.info2
3 files changed, 42 insertions, 3 deletions
diff --git a/games/solarwolf/doinst.sh b/games/solarwolf/doinst.sh
index 5fb28930db..3e5691a052 100644
--- a/games/solarwolf/doinst.sh
+++ b/games/solarwolf/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
diff --git a/games/solarwolf/solarwolf.SlackBuild b/games/solarwolf/solarwolf.SlackBuild
index 372ff15ecd..f9195a65f0 100644
--- a/games/solarwolf/solarwolf.SlackBuild
+++ b/games/solarwolf/solarwolf.SlackBuild
@@ -6,11 +6,28 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211228 bkw: BUILD=2.
+# SDL2_mixer on -current utterly lacks support for tracker music
+# (.mod, .it, .xm, etc). This game's music is in .xm format... so
+# unless/until Pat adds support in SDL2_mixer, this script works
+# around it by using timidity to convert the .xm music to .ogg, which
+# SDL2_mixer can handle.
+# Add TiMidity++ as a dep, to make this work. It's really only
+# build-time, not runtime.
+# Also, new-style icon.
+
+# TODO: when running in windowed mode, clicking the window's close
+# button does close the window, but leaves the game process running.
+# using the Quit option from the main menu works correctly.
+
+# TODO: scaling in fullscreen mode. our pygame is built with SDL2,
+# this should be possible.
+
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=solarwolf
VERSION=${VERSION:-1.5}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -63,10 +80,24 @@ find . -name .xvpics -print0 | xargs -0 rm -rf
mkdir -p \
$PKG/usr/games \
$PKG/usr/share/games/$PRGNAM \
+ $PKG/usr/share/icons/hicolor/64x64/apps \
$PKG/usr/share/pixmaps \
$PKG/usr/share/applications \
$PKG/usr/man/man6
+# 20211228 bkw: convert the music to .ogg. Use separate oggenc instead
+# of timidity's -Ov, so we can set the bitrate to 64k (to match the
+# one .ogg file shipped with the source). This bloats the package by
+# 30%, but it still comes out to less than 4MB total, so no problem.
+for i in data/music/*.xm; do
+ out="data/music/$( basename $i .xm ).ogg"
+ timidity -Ow1sl -id -o- $i | oggenc -Q -b 64 -o $out -
+ rm -f $i
+done
+
+# 20211228 bkw: make the game play the converted .ogg music.
+sed -i 's,\.xm,.ogg,g' code/game*.py
+
# the code is all python, keep in /usr/share along with the game data.
sed -i "s,usr/lib/games/$PRGNAM,usr/share/games/$PRGNAM/code," $PRGNAM.py
@@ -76,7 +107,9 @@ install -oroot -groot -m0755 $PRGNAM.py $PKG/usr/games/$PRGNAM
# original .desktop file don't validate, use our own
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
-cat dist/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+cat dist/$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
+
cat dist/$PRGNAM.6.gz > $PKG/usr/man/man6/$PRGNAM.6.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
diff --git a/games/solarwolf/solarwolf.info b/games/solarwolf/solarwolf.info
index 39a7cbb779..62e2c50666 100644
--- a/games/solarwolf/solarwolf.info
+++ b/games/solarwolf/solarwolf.info
@@ -5,6 +5,6 @@ DOWNLOAD="https://www.pygame.org/shredwheat/solarwolf/solarwolf-1.5.tar.gz"
MD5SUM="52fbed0a33c3c4c08d9dc0e533f90f8c"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="pygame"
+REQUIRES="TiMidity++ pygame"
MAINTAINER="B. Watson"
EMAIL="yalhcru@gmail.com"