diff options
author | B. Watson <urchlay@slackware.uk> | 2023-08-07 22:11:33 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2023-08-12 08:29:52 +0700 |
commit | a9bfc2f55bb287b96b29bb521cdd0ef3325d4170 (patch) | |
tree | 505155f169517199e74dcc0b1807bb0b791d6031 /games/abuse | |
parent | 508d793fa8633df505797c9191e80fb06e66362e (diff) |
games/abuse: New maintainer, fix segfault.
Signed-off-by: B. Watson <urchlay@slackware.uk>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/abuse')
-rw-r--r-- | games/abuse/README | 12 | ||||
-rw-r--r-- | games/abuse/abuse-0.8-sound_fix.patch | 12 | ||||
-rw-r--r-- | games/abuse/abuse.SlackBuild | 81 | ||||
-rw-r--r-- | games/abuse/abuse.desktop | 6 | ||||
-rw-r--r-- | games/abuse/fix-startup-segfault.diff | 63 | ||||
-rw-r--r-- | games/abuse/icons/128.png | bin | 0 -> 34946 bytes | |||
-rw-r--r-- | games/abuse/icons/16.png | bin | 0 -> 1361 bytes | |||
-rw-r--r-- | games/abuse/icons/160.png | bin | 0 -> 53884 bytes | |||
-rw-r--r-- | games/abuse/icons/22.png | bin | 0 -> 1660 bytes | |||
-rw-r--r-- | games/abuse/icons/32.png | bin | 0 -> 3001 bytes | |||
-rw-r--r-- | games/abuse/icons/48.png | bin | 0 -> 6061 bytes | |||
-rw-r--r-- | games/abuse/icons/64.png | bin | 0 -> 10041 bytes | |||
-rw-r--r-- | games/abuse/mkicons.sh | 20 | ||||
-rw-r--r-- | games/abuse/slack-desc | 6 |
14 files changed, 139 insertions, 61 deletions
diff --git a/games/abuse/README b/games/abuse/README index bac45f340c53..25ecbbe2ec55 100644 --- a/games/abuse/README +++ b/games/abuse/README @@ -1,13 +1,7 @@ +abuse (dark 2D side-scrolling platform game) + Abuse is a dark 2D side-scrolling platform game developed by Crack dot Com in 1995. It features beautiful lighting, realistic animation and nasty alien-like creatures to destroy. -It is now maintained by Sam Hocevar in an attempt to prevent it from -vanishing from the Internet. - -If sound doesn't work for you or it is distorted, apply the supplied -patch with: - -SOUNDFIX=YES ./abuse.SlackBuild -Optionally, for in-game music support you need to install TiMidity++ -(and a set of sound patches for it). +Optional: For in-game music, install either eawpats or freepats. diff --git a/games/abuse/abuse-0.8-sound_fix.patch b/games/abuse/abuse-0.8-sound_fix.patch deleted file mode 100644 index 7fffe3e0a793..000000000000 --- a/games/abuse/abuse-0.8-sound_fix.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -aurp ./src/sdlport/sound.cpp ../abuse-0.8//src/sdlport/sound.cpp ---- ./src/sdlport/sound.cpp 2011-05-09 03:58:30.000000000 -0400 -+++ ../abuse-0.8//src/sdlport/sound.cpp 2011-05-21 20:46:44.487000027 -0400 -@@ -65,7 +65,7 @@ int sound_init( int argc, char **argv ) - } - free( sfxdir ); - -- if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 128) < 0) -+ if (Mix_OpenAudio(44100, AUDIO_S16SYS, 2, 1024) < 0) - { - printf( "Sound: Unable to open audio - %s\nSound: Disabled (error)\n", SDL_GetError() ); - return 0; diff --git a/games/abuse/abuse.SlackBuild b/games/abuse/abuse.SlackBuild index d021fcb05bdd..c6c40eb8828a 100644 --- a/games/abuse/abuse.SlackBuild +++ b/games/abuse/abuse.SlackBuild @@ -1,8 +1,8 @@ #!/bin/bash -# -# Slackware build script for Abuse -# -# Written by Rex Hauser <thundermachinegun[AT]gmail.com> + +# Slackware build script for abuse + +# Written by Rex Hauser, modified and now maintained by B. Watson. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: @@ -21,12 +21,26 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# 20230807 bkw: BUILD=4 +# - take over maintenance. +# - fix segfault on startup. +# - binary in /usr/games. +# - replace icon with the one from Xenoveritas (and prescale it). +# - update .desktop file. + +# Note: there is a maintained fork: https://github.com/Xenoveritas/abuse. +# However, I can't get their 0.9.1 release to work correctly: it +# compiles and starts up, but does not respond to either mouse or +# keyboard no matter what I try. So I'm sticking with the old 0.8 from +# Sam Hocevar, with a patch backported from Xenoveritas to fix the +# segfault on startup (which seems to have been introduced by the new +# g++ in Slackware 15.0). cd $(dirname $0) ; CWD=$(pwd) PRGNAM=abuse VERSION=${VERSION:-0.8} -BUILD=${BUILD:-3} +BUILD=${BUILD:-4} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -38,9 +52,6 @@ if [ -z "$ARCH" ]; then esac fi -# If the variable PRINT_PACKAGE_NAME is set, then this script will report what -# the name of the created package would be, and then exit. This information -# could be useful to other scripts. if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" exit 0 @@ -50,11 +61,6 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -DOCS="AUTHORS COPYING COPYING.GPL COPYING.WTFPL NEWS ChangeLog README TODO" - -# Set this to YES if sound doesn't work -SOUNDFIX=${SOUNDFIX:-NO} - if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -75,42 +81,49 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.?z* +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION 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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; - -if [ "$SOUNDFIX" = "YES" ]; then - patch -p0 < $CWD/$PRGNAM-$VERSION-sound_fix.patch -fi +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} + + +# 20230807 bkw: this fix backported from https://github.com/Xenoveritas/abuse, +# commit 77a34f6. +patch -p1 < $CWD/fix-startup-segfault.diff + +# 20230807 bkw: this used to be an optional patch. always apply it, +# since it doesn't cause any problems (and since the Xenoveritas fork +# does the same). +sed -i '/Mix_OpenAudio/s,128,1024,' src/sdlport/sound.cpp CXXFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ + --bindir=/usr/games \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --mandir=/usr/man \ --build=$ARCH-slackware-linux make -make DESTDIR=$PKG install - -find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ - | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true - -find $PKG/usr/man -type f -exec gzip -9 {} \; -for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done +make install-strip DESTDIR=$PKG +gzip -9 $PKG/usr/man/man*/* mkdir -p $PKG/usr/share/{applications,pixmaps} cat $CWD/abuse.desktop > $PKG/usr/share/applications/abuse.desktop -cat $PKG/usr/share/games/abuse/abuse.png > $PKG/usr/share/pixmaps/abuse.png -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION -cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +for i in $CWD/icons/*.png; do + px="$( basename $i .png )" + sz="${px}x${px}" + dir=$PKG/usr/share/icons/hicolor/$sz/apps + mkdir -p $dir + cat $i > $dir/$PRGNAM.png +done +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png + +PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKGDOC +cp -a AUTHORS COPYING* NEWS ChangeLog README TODO $PKGDOC +cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/games/abuse/abuse.desktop b/games/abuse/abuse.desktop index 75a6d5c6dc57..e59081bf90d2 100644 --- a/games/abuse/abuse.desktop +++ b/games/abuse/abuse.desktop @@ -1,8 +1,8 @@ [Desktop Entry] Name=Abuse -GenericName=Dark 2D side-scrolling platform game -Exec=abuse +Comment=Dark 2D side-scrolling platform game +Exec=/usr/games/abuse Icon=abuse Terminal=false Type=Application -Categories=Game; +Categories=Game;ArcadeGame;ActionGame; diff --git a/games/abuse/fix-startup-segfault.diff b/games/abuse/fix-startup-segfault.diff new file mode 100644 index 000000000000..47a675acfb43 --- /dev/null +++ b/games/abuse/fix-startup-segfault.diff @@ -0,0 +1,63 @@ +diff -Naur abuse-0.8/src/lisp/lisp.cpp abuse-0.8.patched/src/lisp/lisp.cpp +--- abuse-0.8/src/lisp/lisp.cpp 2011-05-02 07:55:06.000000000 -0400 ++++ abuse-0.8.patched/src/lisp/lisp.cpp 2023-08-07 20:52:41.197394085 -0400 +@@ -867,7 +867,7 @@ + size_t ret = 0; + + #ifdef TYPE_CHECKING +- if (this && item_type(this) != (ltype)L_CONS_CELL) ++ if (item_type(this) != (ltype)L_CONS_CELL) + { + Print(); + lbreak(" is not a sequence\n"); +@@ -1275,7 +1275,7 @@ + switch (item_type(this)) + { + case L_CONS_CELL: +- if (!this) ++ if (ptr_is_null(this)) + { + lprint_string("nil"); + } +@@ -3080,7 +3080,7 @@ + + LObject *ret = NULL; + +- if (this) ++ if (!ptr_is_null(this)) + { + switch (item_type(this)) + { +diff -Naur abuse-0.8/src/lisp/lisp.h abuse-0.8.patched/src/lisp/lisp.h +--- abuse-0.8/src/lisp/lisp.h 2011-05-02 07:55:06.000000000 -0400 ++++ abuse-0.8.patched/src/lisp/lisp.h 2023-08-07 20:53:56.765386973 -0400 +@@ -201,7 +201,28 @@ + + static inline LObject *&CAR(void *x) { return ((LList *)x)->car; } + static inline LObject *&CDR(void *x) { return ((LList *)x)->cdr; } +-static inline ltype item_type(void *x) { if (x) return *(ltype *)x; return L_CONS_CELL; } ++ ++#ifdef __GNUC__ ++/* ++ * C++ spec says "this" is always NON-NULL, recent versions of gcc will warn ++ * about this and optimizes the "if (this)" we use in some places away: ++ * "warning: nonnull argument ‘this’ compared to NULL [-Wnonnull-compare]" ++ * We rely on "if (this)" checks in several places and refactoring this is ++ * non trivial. So we use this little helper marked with ++ * __attribute__((optimize("O0"))) to workaround this. ++ */ ++static inline bool __attribute__((optimize("O0"))) ptr_is_null(void *ptr) ++{ ++ return ptr == NULL; ++} ++#else ++static inline bool ptr_is_null(void *ptr) ++{ ++ return ptr == NULL; ++} ++#endif ++ ++static inline ltype item_type(void *x) { if (!ptr_is_null(x)) return *(ltype *)x; return L_CONS_CELL; } + + void perm_space(); + void tmp_space(); diff --git a/games/abuse/icons/128.png b/games/abuse/icons/128.png Binary files differnew file mode 100644 index 000000000000..88bfc88ceca2 --- /dev/null +++ b/games/abuse/icons/128.png diff --git a/games/abuse/icons/16.png b/games/abuse/icons/16.png Binary files differnew file mode 100644 index 000000000000..33ba3ce2b0ca --- /dev/null +++ b/games/abuse/icons/16.png diff --git a/games/abuse/icons/160.png b/games/abuse/icons/160.png Binary files differnew file mode 100644 index 000000000000..2acde9dab975 --- /dev/null +++ b/games/abuse/icons/160.png diff --git a/games/abuse/icons/22.png b/games/abuse/icons/22.png Binary files differnew file mode 100644 index 000000000000..8bbd1de1be8c --- /dev/null +++ b/games/abuse/icons/22.png diff --git a/games/abuse/icons/32.png b/games/abuse/icons/32.png Binary files differnew file mode 100644 index 000000000000..0eea2d5ffd18 --- /dev/null +++ b/games/abuse/icons/32.png diff --git a/games/abuse/icons/48.png b/games/abuse/icons/48.png Binary files differnew file mode 100644 index 000000000000..51f5177d0f88 --- /dev/null +++ b/games/abuse/icons/48.png diff --git a/games/abuse/icons/64.png b/games/abuse/icons/64.png Binary files differnew file mode 100644 index 000000000000..00f829ab97b3 --- /dev/null +++ b/games/abuse/icons/64.png diff --git a/games/abuse/mkicons.sh b/games/abuse/mkicons.sh new file mode 100644 index 000000000000..513cace80b57 --- /dev/null +++ b/games/abuse/mkicons.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +src="$1" +shift +if [ -z "$src" -o ! -e "$src" -o "$*" ]; then + cat 1>&2 <<EOF +Usage: $0 /path/to/icon.png +EOF +fi + +set -e + +mkdir -p icons/ +cat "$src" > icons/160.png + +for i in 16 22 32 48 64 128; do + convert -resize ${i}x${i} "$src" icons/$i.png +done + +exit 0 diff --git a/games/abuse/slack-desc b/games/abuse/slack-desc index 4d6d086d1035..bbf2e2c6d229 100644 --- a/games/abuse/slack-desc +++ b/games/abuse/slack-desc @@ -11,9 +11,9 @@ abuse: abuse: Abuse is a dark 2D side-scrolling platform game developed by Crack dot abuse: Com in 1995. It features beautiful lighting, realistic animation and abuse: nasty alien-like creatures to destroy. -abuse: It is now maintained by Sam Hocevar in an attempt to prevent it from -abuse: vanishing from the Internet. abuse: -abuse: Home page: http://abuse.zoy.org/ +abuse: +abuse: +abuse: abuse: abuse: |