diff options
author | B. Watson <yalhcru@gmail.com> | 2016-10-15 21:33:20 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2016-10-22 08:47:29 +0700 |
commit | 96c08b02ebd24f2bb62c2a5bb5f6991b58a5a9b1 (patch) | |
tree | b493d0d939265bf053f315e7568c13dd45362b20 /games/supermariowar/supermariowar.SlackBuild | |
parent | 9c6c81d52ce439dc091fb336578eed2e121ceb83 (diff) |
games/supermariowar: Updated for version 2.0beta1.
Diffstat (limited to 'games/supermariowar/supermariowar.SlackBuild')
-rw-r--r-- | games/supermariowar/supermariowar.SlackBuild | 88 |
1 files changed, 41 insertions, 47 deletions
diff --git a/games/supermariowar/supermariowar.SlackBuild b/games/supermariowar/supermariowar.SlackBuild index c5acc1d39737..794fc93a78d5 100644 --- a/games/supermariowar/supermariowar.SlackBuild +++ b/games/supermariowar/supermariowar.SlackBuild @@ -7,7 +7,7 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. PRGNAM=supermariowar -VERSION=${VERSION:-r16} +VERSION=${VERSION:-2.0beta1} BUILD=${BUILD:-2} TAG=${TAG:-_SBo} @@ -24,6 +24,8 @@ TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} +TARVER="$( echo "$VERSION" | sed 's,beta,-beta.,' )" + if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" @@ -43,9 +45,9 @@ set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz -cd $PRGNAM-$VERSION +rm -rf $PRGNAM-$TARVER +tar xvf $CWD/$PRGNAM-$TARVER.tar.gz || tar xvf $CWD/v$TARVER.tar.gz +cd $PRGNAM-$TARVER chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -53,52 +55,44 @@ 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 {} \; -# C++ is a fast-moving target, code from 2009, compiler from 2014 or so. -# Also, the code got refactored and the VC++ projects updated, but the -# Makefile hadn't been (so I had to parse the VC++ project file, ugh). -zcat $CWD/compilefixes.diff.gz | patch -p1 - -# Patch for libpng16 (-current) thanks to Arch Linux -# (this is gzipped to preserve CRLF line endings) -zcat $CWD/libpng.patch.gz | patch -p0 - -# the configure script isn't autoconf (yay), but it has CRLFs (boo) -sed -i 's,\r,,g' configure - -# 20151122 bkw: PNG screenshots stopped working in -current, let's check -# for it. When this is disabled, screenshots get saved as BMP instead. -[ "$( pkg-config --modversion libpng | cut -d. -f1,2 )" != "1.4" ] && \ - PNGOPT="--no-png-save" - -sh configure $PNGOPT -sed -i "/^CFLAGS/s,$, $SLKCFLAGS -fpermissive," configuration - -make - -# 'make install' installs maps/worlds a+w, don't want. We use -# setgid games executables instead. -mkdir -p $PKG/usr/games $PKG/usr/share/games/smw/ -install -s -m0755 smw $PKG/usr/games -install -s -m2755 -g games leveledit $PKG/usr/games/smw-leveledit -install -s -m2755 -g games worldedit $PKG/usr/games/smw-worldedit -cp -r gfx maps music sfx tours worlds $PKG/usr/share/games/smw -chown -R root:games $PKG/usr/share/games/smw -chmod -R 0775 $PKG/usr/share/games/smw - -# icons extracted from _src/icons/*.ico with icotool. -# .desktop files written for this build. -# No man pages, since none of the executables take any options. -mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps -for i in $PKG/usr/games/*; do - exe=$(basename $i) - cat $CWD/icons/$exe.png > $PKG/usr/share/pixmaps/$exe.png - cat $CWD/desktop/$exe.desktop > $PKG/usr/share/applications/$exe.desktop -done +# upstream ships these as zip files, but 'make install' expects them +# to be unzipped. +unzip data.zip +unzip testmaps.zip + +# cmake defines a SMW_DATADIR but the code doesn't actually use it. +sed -i \ + '/RootDataDirectory *= *"data"/s,"data",SMW_DATADIR,' \ + src/common/global.cpp + +# -DUSE_PNG_SAVE=ON is listed in CMakeLists.txt, but isn't actually +# implemented in 2.0beta1... screenshots still work, they're saved as +# .bmp instead. + +# -DUSE_SDL2_LIBS=ON will be supported in the future. + +mkdir -p build +cd build + cmake \ + -DBUILD_STATIC_LIBS=OFF \ + -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DLIB_SUFFIX=${LIBDIRSUFFIX} \ + -DMAN_INSTALL_DIR=/usr/man \ + -DCMAKE_BUILD_TYPE=Release .. + make VERBOSE=1 + make install/strip DESTDIR=$PKG +cd .. + +# for some reason, the executables are being installed without +# the executable bits set... +chmod 0755 $PKG/usr/games/* mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION # get rid of the CRLFs in the docs -for i in *.html *.html *.txt; do - sed 's,\r,,g' "$i" > $PKG/usr/doc/$PRGNAM-$VERSION/"$i" +for i in CHANGELOG CREDITS README.md docs/*.html docs/*.txt; do + sed 's,\r,,g' "$i" > $PKG/usr/doc/$PRGNAM-$VERSION/"$( basename "$i" )" done cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild |