summaryrefslogtreecommitdiffstats
path: root/games/srb2
diff options
context:
space:
mode:
Diffstat (limited to 'games/srb2')
-rw-r--r--games/srb2/README4
-rw-r--r--games/srb2/doinst.sh7
-rw-r--r--games/srb2/srb2.SlackBuild92
-rw-r--r--games/srb2/srb2.desktop4
-rw-r--r--games/srb2/srb2.info24
5 files changed, 84 insertions, 47 deletions
diff --git a/games/srb2/README b/games/srb2/README
index 61de91f456..73f6f2db87 100644
--- a/games/srb2/README
+++ b/games/srb2/README
@@ -12,3 +12,7 @@ installed. I'm not 100% sure what libgme does for srb2: it's a "game
music emulation" library, but the game music doesn't sound different to
me when srb2 is built with libgme, and I don't see any config settings
to enable it. I haven't played the entire game yet though...
+
+Note for users upgrading from version 2.1.x to 2.2.x: I had to
+delete my old config (rm -rf ~/.srb2) to get the game to run without
+segfaulting.
diff --git a/games/srb2/doinst.sh b/games/srb2/doinst.sh
index 696d35bad7..65c7e2eeb9 100644
--- a/games/srb2/doinst.sh
+++ b/games/srb2/doinst.sh
@@ -1,4 +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 -f usr/share/icons/hicolor >/dev/null 2>&1
+ fi
+fi
diff --git a/games/srb2/srb2.SlackBuild b/games/srb2/srb2.SlackBuild
index 26fb5abb25..526ac57f9a 100644
--- a/games/srb2/srb2.SlackBuild
+++ b/games/srb2/srb2.SlackBuild
@@ -1,15 +1,23 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for srb2
-# 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.
+# 20230714 bkw: updated for v2.2.11.
+# - new deps (see .info file).
+# - cmake sed stuff to allow building without net access.
+# - new-style icons.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=srb2
-VERSION=${VERSION:-2.1.21}
+VERSION=${VERSION:-2.2.11}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -19,7 +27,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-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}
@@ -61,23 +73,34 @@ 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 {} \+
-# Assets (actually WAD files) aren't found in the source, have to download
-# them separately. The build actually checks for them & refuses to compile
-# if they're missing, which is kinda unfair since it doesn't ship with
-# the damn things... To save 208MB of space in $TMP, we symlink the files.
-# Can't just touch them, since the md5sums of the files get hardcoded
-# into the binary (and it'll refuse to run if they don't match).
-DATAFILES="srb2.srb zones.dta player.dta rings.dta music.dta patch.dta"
-for i in $DATAFILES; do
- ln -s $CWD/$i assets/$i
-done
+# Assets (actually WAD and pk3 aka zip files) aren't found in the
+# source, have to download them separately. The build actually checks
+# for them & refuses to compile if they're missing, which is kinda
+# unfair since it doesn't ship with the damn things... so we have to
+# extract them from the 'full' zip file. Can't just touch them, since
+# the md5sums of the files get hardcoded into the binary (and it'll
+# refuse to run if they don't match).
+( cd assets
+ mkdir installer
+ cd installer
+
+ # upstream release a 2.2.8 followed by a 229, handle either.
+ ZIPFILE="$CWD/SRB2-v$VERSION-Full.zip"
+ [ -e "$ZIPFILE" ] || ZIPFILE="$CWD/SRB2-v${VERSION//.}-Full.zip"
+ unzip "$ZIPFILE" '*.dta' '*.pk3'
+)
# As shipped, the path /usr/games/SRB2 is hardcoded in various places
# in the source (no cmake variable to change it). It should be in
# /usr/share/games, not /usr/games, so sed-fest:
sed -i 's,usr/games,usr/share/games,g' \
- src/sdl/i_system.c src/sdl/i_ttf.c \
- src/sdl12/i_system.c src/sdl12/i_ttf.c
+ src/sdl/i_system.c src/sdl/i_ttf.c
+
+# 20230714 bkw: cmake silliness. it wants to download Ccache.cmake to
+# support ccache on Linux. on Windows, it seems to support ccache
+# without external dependency... and it turns out, this support works
+# on Linux as well. So:
+sed -i '/CMAKE_HOST_SYSTEM_NAME/s,STREQ.*,MATCHES Linux),' CMakeLists.txt
mkdir -p build
cd build
@@ -87,6 +110,7 @@ cd build
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-DMAN_INSTALL_DIR=/usr/man \
+ -DUSE_CCACHE=ON \
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
#make install/strip DESTDIR=$PKG # don't bother, it's broken
@@ -96,21 +120,35 @@ cd ..
mkdir -p $PKG/usr/games $PKG/usr/share/games/SRB2 \
$PKG/usr/share/pixmaps $PKG/usr/share/applications \
$PKG/usr/doc/$PRGNAM-$VERSION
-install -s -m0755 build/bin/$PRGNAM-$VERSION $PKG/usr/games
-ln -s $PRGNAM-$VERSION $PKG/usr/games/$PRGNAM
+# as of 2.2.8 the binary's name changed.
+# 20230714 bkw: ...and it changed again in 2.2.11.
+[ -x build/bin/lsdl$PRGNAM-$VERSION ] || mv build/bin/lsdl$PRGNAM build/bin/lsdl$PRGNAM-$VERSION
+install -s -m0755 build/bin/lsdl$PRGNAM-$VERSION $PKG/usr/games
+ln -s lsdl$PRGNAM-$VERSION $PKG/usr/games/lsdl$PRGNAM
+ln -s lsdl$PRGNAM-$VERSION $PKG/usr/games/$PRGNAM
install -m0644 assets/LICENSE* assets/README* $PKG/usr/doc/$PRGNAM-$VERSION
-install -m0644 $PRGNAM.png $PKG/usr/share/pixmaps
-# Install data files from $CWD, not the symlinks in assets/
-echo -n "Copying data files: "
-for i in $DATAFILES; do
- echo -n "$i "
- cat $CWD/$i > $PKG/usr/share/games/SRB2/$i
+hicolor=$PKG/usr/share/icons/hicolor
+for px in 16 22 32 48 64 128 256; do
+ sz=${px}x${px}
+ dir=$hicolor/$sz/apps
+ mkdir -p $dir
+ convert -resize $sz $PRGNAM.png $dir/$PRGNAM.png
done
+
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+echo -n "Copying data files: "
+( cd assets/installer
+ for i in *; do
+ echo -n "$i "
+ cat $i > $PKG/usr/share/games/SRB2/$i
+ done
+)
echo
-# desktop file is a modified version of debian/srb2.desktop. I took out
-# the absolute paths.
+# desktop file is a modified version of debian/srb2.desktop. I fixed
+# the absolute paths and got it to validate.
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
# dev and modding docs in doc/, config files for cwiid and various doom
@@ -125,4 +163,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
diff --git a/games/srb2/srb2.desktop b/games/srb2/srb2.desktop
index 240596a7df..7675458e95 100644
--- a/games/srb2/srb2.desktop
+++ b/games/srb2/srb2.desktop
@@ -1,8 +1,8 @@
[Desktop Entry]
Name=Sonic Robo Blast 2
Comment=A free 3D Sonic the Hedgehog fangame closely inspired by the original Sonic games on the Sega Genesis.
-Exec=srb2
-Icon=srb2
+Exec=/usr/games/srb2
+Icon=/usr/share/pixmaps/srb2.png
Terminal=false
Type=Application
StartupNotify=false
diff --git a/games/srb2/srb2.info b/games/srb2/srb2.info
index bffae6cbe0..4fc21718b3 100644
--- a/games/srb2/srb2.info
+++ b/games/srb2/srb2.info
@@ -1,22 +1,12 @@
PRGNAM="srb2"
-VERSION="2.1.21"
+VERSION="2.2.11"
HOMEPAGE="https://www.srb2.org/"
-DOWNLOAD="https://github.com/STJr/SRB2/archive/SRB2_release_2.1.21/SRB2-SRB2_release_2.1.21.tar.gz \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/music.dta \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/patch.dta \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/player.dta \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/rings.dta \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/srb2.srb \
- http://alam.srb2.org/SRB2/2.1.21-Final/Resources/zones.dta"
-MD5SUM="69c97da9638e3daedec5a8c7be76b5ab \
- 2a4b6ae74a84e990d6e6c81ad0c1309f \
- dbbf8bc6121618ee3be2d5b14650429b \
- cfca0f1c73023cbbd8f844f45480f799 \
- 85901ad4bf94637e5753d2ac2c03ea26 \
- c1b9577687f8a795104aef4600720ea7 \
- 303838c6c534d9540288360fa49cca60"
+DOWNLOAD="https://github.com/STJr/SRB2/archive/SRB2_release_2.2.11/SRB2-SRB2_release_2.2.11.tar.gz \
+ https://github.com/STJr/SRB2/releases/download/SRB2_release_2.2.11/SRB2-v2211-Full.zip"
+MD5SUM="bcb3493b8668dadd8f9bfb10d3325fd6 \
+ d356b7e3db4520355b142b39c51cc8a8"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="SDL2_mixer"
+REQUIRES="libgme libopenmpt"
MAINTAINER="B. Watson"
-EMAIL="yalhcru@gmail.com"
+EMAIL="urchlay@slackware.uk"