From 13da4faba855a7c6709c976e45794be8ab7cf30c Mon Sep 17 00:00:00 2001 From: Larry Hajali Date: Tue, 9 Aug 2016 09:19:16 -0700 Subject: games/trigger-rally: Updated for version 0.6.4. Signed-off-by: Larry Hajali --- games/trigger-rally/hiscore1.h.patch | 44 +++++++++++++++++++ games/trigger-rally/trigger-rally.SlackBuild | 66 ++++++++++++---------------- games/trigger-rally/trigger-rally.info | 60 ++++++++++++++++++++++--- 3 files changed, 126 insertions(+), 44 deletions(-) create mode 100644 games/trigger-rally/hiscore1.h.patch (limited to 'games/trigger-rally') diff --git a/games/trigger-rally/hiscore1.h.patch b/games/trigger-rally/hiscore1.h.patch new file mode 100644 index 0000000000..4441ae2437 --- /dev/null +++ b/games/trigger-rally/hiscore1.h.patch @@ -0,0 +1,44 @@ +diff -rupN src/include/hiscore1.h src_patched/include/hiscore1.h +--- src/include/hiscore1.h 2016-04-08 20:58:38.000000000 +0200 ++++ src_patched/include/hiscore1.h 2016-04-28 15:27:43.763427992 +0200 +@@ -41,6 +41,17 @@ + return InputStream; \ + } else (void)0 + ++ ++// TODO: remove duplicate code ++#define GETLINE_SKIP_EMPTY_LINES_B(InputStream, String) if (true) { \ ++ while (std::getline(InputStream, String)) { \ ++ if (!String.empty()) \ ++ break; \ ++ } \ ++ if (String.empty()) \ ++ return static_cast (InputStream); \ ++} else (void)0 ++ + /// + /// @brief Basic structure to load and save race results. + /// +@@ -724,19 +735,19 @@ private: + std::istringstream sspdata(decrypt(pdata)); + #undef decrypt + +- GETLINE_SKIP_EMPTY_LINES(sspdata, ts); ++ GETLINE_SKIP_EMPTY_LINES_B(sspdata, ts); + nu = std::stoul(ts); + + while (nu-- != 0) + { +- GETLINE_SKIP_EMPTY_LINES(sspdata, ts); ++ GETLINE_SKIP_EMPTY_LINES_B(sspdata, ts); + allunlocks[pname].insert(ts); + } + + while (sspdata >> rd) + alltimes.insert({rd.mapname, rd}); + +- return sspdata; ++ return static_cast (sspdata); + } + + /// diff --git a/games/trigger-rally/trigger-rally.SlackBuild b/games/trigger-rally/trigger-rally.SlackBuild index 56cafb1ff4..688574dada 100644 --- a/games/trigger-rally/trigger-rally.SlackBuild +++ b/games/trigger-rally/trigger-rally.SlackBuild @@ -2,7 +2,7 @@ # Slackware build script for trigger-rally -# Copyright 2015 Larry Hajali +# Copyright 2015-2016 Larry Hajali # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -23,7 +23,7 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. PRGNAM=trigger-rally -VERSION=${VERSION:-0.6.2} +VERSION=${VERSION:-0.6.4} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -60,12 +60,9 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION-src.tar.bz2 -cd $PRGNAM-$VERSION-src -tar xvf $CWD/$PRGNAM-$VERSION-data.tar.bz2 -# Fix permissions. -find . -type f -exec chmod -x '{}' \; -chmod +x configure +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +for i in $CWD/*.zip;do cp $i data/plugins;done chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -73,28 +70,24 @@ 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 {} \; -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --bindir=/usr/games \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --mandir=/usr/man \ - --docdir=/usr/doc/$PRGNAM-$VERSION \ - --datadir=/usr/share/$PRGNAM \ - --build=$ARCH-slackware-linux - -jam -dx -qa - -# Manually install the binary and data files. -mkdir -p $PKG/usr/games $PKG/usr/share/$PRGNAM -install -m 0755 trigger $PKG/usr/games/$PRGNAM -cd $PRGNAM-$VERSION-data -find . -maxdepth 1 -type d -exec cp -ar '{}' $PKG/usr/share/$PRGNAM \; -cp trigger.config.defs $PKG/usr/share/$PRGNAM -cd - +# Fix end-of-line encoding +for j in doc/*; do + sed -e 's/\r//' $i > ${i}.new + touch -r $i ${i}.new + mv ${i}.new $i +done + +# Fix for gcc >= 5.x +# https://sourceforge.net/p/trigger-rally/discussion/527953/thread/e1cde947/ +patch -p0 < $CWD/hiscore1.h.patch + +OPTIMS="$SLKCFLAGS" \ +make -C src + +make -C src install \ + DESTDIR=$PKG \ + prefix=/usr \ + docdir=/usr/doc/$PRGNAM-$VERSION 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 @@ -102,19 +95,16 @@ find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | gr mkdir $PKG/usr/share/applications install -m 0644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications for i in 16 22 24 32 36 48 64 72 96 128 192 256; do - install -D -m 0644 $PRGNAM-$VERSION-data/icon/trigger-${i}.png \ + mkdir -p $PKG/usr/share/icons/hicolor/${i}x${i}/apps + ln -s /usr/share/games/$PRGNAM/icon/trigger-${i}.png \ $PKG/usr/share/icons/hicolor/${i}x${i}/apps/$PRGNAM.png done -install -D -m 0644 $PRGNAM-$VERSION-data/icon/$PRGNAM-icons.svg \ - $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.png +mkdir -p $PKG/usr/share/icons/hicolor/scalable/apps +ln -s /usr/share/games/$PRGNAM/icons/trigger-${i}-icons.svg \ + $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a doc/* $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild -# Fix permissions. -find $PKG -type d -exec chmod 0755 '{}' \; - mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh diff --git a/games/trigger-rally/trigger-rally.info b/games/trigger-rally/trigger-rally.info index 1dc4d7f06c..49060fe630 100644 --- a/games/trigger-rally/trigger-rally.info +++ b/games/trigger-rally/trigger-rally.info @@ -1,12 +1,60 @@ PRGNAM="trigger-rally" -VERSION="0.6.2" +VERSION="0.6.4" HOMEPAGE="http://trigger-rally.sourceforge.net" -DOWNLOAD="http://downloads.sourceforge.net/trigger-rally/trigger-rally-0.6.2-src.tar.bz2 \ - http://downloads.sourceforge.net/trigger-rally/trigger-rally-0.6.2-data.tar.bz2" -MD5SUM="f1c6b7e37e692441d36114297047317a \ - ec1d417e229bae8107f1b44d932b4e67" +DOWNLOAD="https://downloads.sourceforge.net/trigger-rally/trigger-rally-0.6.4.tar.gz \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-volcanic.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-delta.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-desertrush.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-ghats.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-greengrounds.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-helicoil.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-icypeak.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-labrally.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-marsspirit.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-monza.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-mountainclimbing.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-mountainpass.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-pistol.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-pulp.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-roundhouse.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-santa.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-serpentine.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-snowlevel.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-snowyhills.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-tea.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-tobago.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/event-rscup.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/event-westernchallenge.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-banana.zip \ + https://sourceforge.net/projects/trigger-rally/files/plugins/plugins-0.6.4/map-crossmountain.zip" +MD5SUM="551c964bd96e308eecf8c416bbd46287 \ + 03f17ff67f19b979461e2d5308970350 \ + b036667b4242da7df08db1ca5bd93eb6 \ + dc05c2fddd90f88ab49036083108da58 \ + 55d22fef0f38c718443cd341f591524d \ + cb24d43b1d0ce1ecd7fad927ac6c5729 \ + ff9719e33d0c155da30c7d0a634dbe9e \ + 12bccc8f4ed517b1d50f898b1285c018 \ + abc74fd1281201356f2eb8409bfeef33 \ + 5196f0dc2fc91855eaa13f9cf981f244 \ + a875e7e34ff28392e1c9e1fab74adae5 \ + 8e4cdc1565eeea896f5ec37db4a2aa24 \ + 1dc69423acc8fddc09cb4122893843ff \ + 99cffbc41841dd3aceded54f9e9b4507 \ + 029d468650f5479c64a3dcc79858818e \ + e55a8d93648571bb8c90e52055be23ee \ + bb66d3fff48a62e323a77a1b09cd642f \ + 158e628c122e4db886c791df62ad9528 \ + c8ebfd0b2b9cce351d4474cfcc2006a6 \ + 38522c921d734467a7d7133d08c0aece \ + a7f83cf58f60ff15646993264b96e28c \ + ae44d813c3108d11eb9e54b155c09a44 \ + 6d3bf46e9d756db05fac9a069cdc6694 \ + f6dba6c135a0df234f53a8312456cfa2 \ + 9cbd3414caca1a9300c5fd0ed43efdce \ + 351bd5afb5c82c889408690d208f6430" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="freealut physfs jam" +REQUIRES="freealut physfs" MAINTAINER="Larry Hajali" EMAIL="larryhaja[at]gmail[dot]com" -- cgit v1.2.3