diff options
-rw-r--r-- | games/z26/statify.sh | 22 | ||||
-rw-r--r-- | games/z26/z26.SlackBuild | 28 | ||||
-rw-r--r-- | games/z26/z26.info | 6 |
3 files changed, 48 insertions, 8 deletions
diff --git a/games/z26/statify.sh b/games/z26/statify.sh new file mode 100644 index 000000000000..91a0abd094b1 --- /dev/null +++ b/games/z26/statify.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# z26 is written partly in x86 (32-bit) assembly, so it can't be built +# for 64-bit. So the solution for running it on pure 64-bit systems is +# to use a static binary that doesn't require any 32-bit libs. + +# Run this script on a 32-bit host *with VDSO disabled*, to generate +# the binary used for the 64-bit build. + +# Notes: +# - libgcc_s.so has to be included or else z26 dumps core on exit. +# - libaoss and libasound are needed because z26 doesn't use SDL's +# sound API, it talks directly to OSS via /dev/dsp. +# - libudev is needed for SDL to detect the mouse. +# - If you run "file" on the statified binary, it looks dynamic: +# $ file /usr/games/z26 +# /usr/games/z26: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, stripped +# ...but ldd says it's "not a dynamic executable". This is normal +# for statified binaries. +# - Do not attempt to strip the statified binary. It will break. + +statifier --set=LD_PRELOAD=/usr/lib/libudev.so:/usr/lib/libaoss.so:/usr/lib/libasound.so:/usr/lib/libgcc_s.so /usr/games/z26 z26.static diff --git a/games/z26/z26.SlackBuild b/games/z26/z26.SlackBuild index d33236660e65..e981519c8586 100644 --- a/games/z26/z26.SlackBuild +++ b/games/z26/z26.SlackBuild @@ -7,9 +7,14 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20180123 bkw: +# - move binary to /usr/games, man page to section 6 +# - 64-bit support via statified binary (see statify.sh) +# - BUILD=2 + PRGNAM=z26 VERSION=${VERSION:-2.13} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} # The distribution tarball is actually a snapshot that got @@ -38,7 +43,9 @@ if [ "$ARCH" = "i586" ]; then elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "$ARCH" = "x86_64" ]; then - echo "Can't build on x86_64, sorry" + echo "=== $ARCH detected, using statified binary" +else + echo "Can't build on $ARCH, sorry" exit 1 fi @@ -57,13 +64,22 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -make linux CFLAGS="$SLKCFLAGS" +# man page belongs in section 6 +sed -i '/pod2man -c/s,-c,-s6 -c,' Makefile + +if [ "$ARCH" = "x86_64" ]; then + xz -d < $CWD/$PRGNAM.static.xz > $PRGNAM + chmod 755 $PRGNAM + cp conf/config_linux-static.mak config.mak +else + make linux CFLAGS="$SLKCFLAGS" +fi make $PRGNAM.man make docs -mkdir -p $PKG/usr/bin $PKG/usr/man/man1 -install -m0755 -o root -g root $PRGNAM $PKG/usr/bin -gzip -9c $PRGNAM.man > $PKG/usr/man/man1/$PRGNAM.1.gz +mkdir -p $PKG/usr/games $PKG/usr/man/man6 +install -m0755 -o root -g root $PRGNAM $PKG/usr/games +gzip -9c $PRGNAM.man > $PKG/usr/man/man6/$PRGNAM.6.gz rm -rf doc/CVS mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION diff --git a/games/z26/z26.info b/games/z26/z26.info index e7d2978a8965..1b0730ce204d 100644 --- a/games/z26/z26.info +++ b/games/z26/z26.info @@ -3,8 +3,10 @@ VERSION="2.13" HOMEPAGE="http://www.whimsey.com" DOWNLOAD="http://www.whimsey.com/z26/z26v213.tar.gz" MD5SUM="0b0b9b42f203f6defca74a85f071f7c8" -DOWNLOAD_x86_64="UNSUPPORTED" -MD5SUM_x86_64="" +DOWNLOAD_x86_64="http://www.whimsey.com/z26/z26v213.tar.gz \ + http://urchlay.naptime.net/~urchlay/src/z26.static.xz" +MD5SUM_x86_64="0b0b9b42f203f6defca74a85f071f7c8 \ + e3e0ba119fef0a9494759a731ceb2183" REQUIRES="" MAINTAINER="B. Watson" EMAIL="yalhcru@gmail.com" |