summaryrefslogtreecommitdiff
path: root/games/srb2
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2018-12-21 22:20:54 -0900
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-12-21 22:20:54 -0900
commit5a0f7639dba6f7078e10e70967f247f358f5a065 (patch)
tree3e8fed999ac1b42482419cb76fe2ab71c83ad326 /games/srb2
parent2952d214f2d3384add7a5f36751cc233716ad7f5 (diff)
downloadslackbuilds-5a0f7639dba6f7078e10e70967f247f358f5a065.tar.gz
games/srb2: Added (Sonic Robo Blast 2 game).
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/srb2')
-rw-r--r--games/srb2/README14
-rw-r--r--games/srb2/doinst.sh4
-rw-r--r--games/srb2/slack-desc19
-rw-r--r--games/srb2/srb2.SlackBuild128
-rw-r--r--games/srb2/srb2.desktop9
-rw-r--r--games/srb2/srb2.info22
6 files changed, 196 insertions, 0 deletions
diff --git a/games/srb2/README b/games/srb2/README
new file mode 100644
index 0000000000..61de91f456
--- /dev/null
+++ b/games/srb2/README
@@ -0,0 +1,14 @@
+srb2 (Sonic Robo Blast 2 game)
+
+Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog fangame
+built using a modified version of the Doom Legacy port of Doom. SRB2 is
+closely inspired by the original Sonic games from the Sega Genesis, and
+attempts to recreate the design in 3D. While SRB2 isn't fully completed,
+it already features tons of levels, enemies, speed, and quite a lot of
+the fun that the original Sonic games provided.
+
+libgme is an optional dependency for srb2. It will be autodetected if
+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...
diff --git a/games/srb2/doinst.sh b/games/srb2/doinst.sh
new file mode 100644
index 0000000000..696d35bad7
--- /dev/null
+++ b/games/srb2/doinst.sh
@@ -0,0 +1,4 @@
+
+if [ -x /usr/bin/update-desktop-database ]; then
+ /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1
+fi
diff --git a/games/srb2/slack-desc b/games/srb2/slack-desc
new file mode 100644
index 0000000000..cb086a6ba6
--- /dev/null
+++ b/games/srb2/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+srb2: srb2 (Sonic Robo Blast 2 game)
+srb2:
+srb2: Sonic Robo Blast 2 is a 3D open-source Sonic the Hedgehog fangame
+srb2: built using a modified version of the Doom Legacy port of Doom. SRB2
+srb2: is closely inspired by the original Sonic games from the Sega Genesis,
+srb2: and attempts to recreate the design in 3D. While SRB2 isn't fully
+srb2: completed, it already features tons of levels, enemies, speed,
+srb2: and quite a lot of the fun that the original Sonic games provided.
+srb2:
+srb2:
+srb2:
diff --git a/games/srb2/srb2.SlackBuild b/games/srb2/srb2.SlackBuild
new file mode 100644
index 0000000000..26fb5abb25
--- /dev/null
+++ b/games/srb2/srb2.SlackBuild
@@ -0,0 +1,128 @@
+#!/bin/sh
+
+# Slackware build script for srb2
+
+# Written by B. Watson (yalhcru@gmail.com)
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+PRGNAM=srb2
+VERSION=${VERSION:-2.1.21}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
+
+set -e
+
+rm -rf $PKG
+mkdir -p $TMP/$PRGNAM $PKG $OUTPUT
+cd $TMP/$PRGNAM
+rm -rf SRB2-SRB2_release_$VERSION
+
+# There's a lot of stuff in the source that we don't need. All the
+# --exclude stuff saves 182MB of space in $TMP.
+tar xvf $CWD/SRB2-SRB2_release_$VERSION.tar.gz \
+ --exclude '*/libs' \
+ --exclude '*/android' \
+ --exclude '*/windows-installer' \
+ --exclude '*/bin' \
+ --exclude '*/objs' \
+ --exclude '*/tools'
+
+cd SRB2-SRB2_release_$VERSION
+
+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
+
+# 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
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS -DNDEBUG" \
+ -DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS -DNDEBUG" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX=${LIBDIRSUFFIX} \
+ -DMAN_INSTALL_DIR=/usr/man \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make VERBOSE=1
+ #make install/strip DESTDIR=$PKG # don't bother, it's broken
+cd ..
+
+# 'make install' puts all the files in the same dir, so manual install:
+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
+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
+done
+echo
+
+# desktop file is a modified version of debian/srb2.desktop. I took out
+# the absolute paths.
+cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
+
+# dev and modding docs in doc/, config files for cwiid and various doom
+# level editors in extras/. We don't need yet another copy of the GPL
+# in doc/, so:
+rm -f doc/.gitignore doc/copying
+cp -a doc extras $PKG/usr/doc/$PRGNAM-$VERSION
+cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+
+mkdir -p $PKG/install
+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}
diff --git a/games/srb2/srb2.desktop b/games/srb2/srb2.desktop
new file mode 100644
index 0000000000..240596a7df
--- /dev/null
+++ b/games/srb2/srb2.desktop
@@ -0,0 +1,9 @@
+[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
+Terminal=false
+Type=Application
+StartupNotify=false
+Categories=Game;
diff --git a/games/srb2/srb2.info b/games/srb2/srb2.info
new file mode 100644
index 0000000000..bffae6cbe0
--- /dev/null
+++ b/games/srb2/srb2.info
@@ -0,0 +1,22 @@
+PRGNAM="srb2"
+VERSION="2.1.21"
+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_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES="SDL2_mixer"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"