diff options
author | B. Watson <yalhcru@gmail.com> | 2017-02-14 19:44:12 -0500 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-02-18 07:54:15 +0700 |
commit | ae160a0f651aefef0e7be9d0d40994fc1b03c379 (patch) | |
tree | a4eb183dff4a51152e70135bb58843d66de34869 /games/mame/mame.SlackBuild | |
parent | 19fae7d51cfbb92e5fdaf6b6aa259198655115be (diff) |
games/mame: Support optional GroovyMAME patch.
Diffstat (limited to 'games/mame/mame.SlackBuild')
-rw-r--r-- | games/mame/mame.SlackBuild | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/games/mame/mame.SlackBuild b/games/mame/mame.SlackBuild index fb9aba91a40e..94fb72b0cead 100644 --- a/games/mame/mame.SlackBuild +++ b/games/mame/mame.SlackBuild @@ -53,9 +53,12 @@ # 20170128 bkw: # - Updated for v0.182. +# 20170214 bkw: +# - Add support for GroovyMAME patch. + PRGNAM=mame VERSION=${VERSION:-0.182} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -164,6 +167,25 @@ else WITHQT="without" fi +# Now, let's check for GroovyMAME. All the user has to do is place +# the .diff in the SlackBuild's directory. The filename always starts +# with the MAME version number, minus its dots. If we find multiple +# files matching this, sort them lexically and use the last (hopefully +# this is the one with the highest version number). +GROOVYDIFF="$( ls $CWD/${VERSION/./}_groovymame_*.diff 2>/dev/null | tail -1 )" +if [ -e "$GROOVYDIFF" ]; then + GROOVYVER="$( basename $GROOVYDIFF .diff | cut -d_ -f3- | sed 's,-,_,g' )" + + # .diffs are shipped with CRLF endings, fix: + sed 's,\r,,g' "$GROOVYDIFF" > groovy.diff + + patch -p0 < groovy.diff + + echo "GROOVYDIFF $GROOVYDIFF" + echo "GROOVYVER $GROOVYVER" +fi + + # Having ARCH set in the env will break the build, hence ARCH="" make USE_QTDEBUG=$QTOPT \ @@ -225,6 +247,11 @@ cat $CWD/${PRGNAM}.SlackBuild > $PKG/usr/doc/${PRGNAM}-$VERSION/${PRGNAM}.SlackB mkdir -p $PKG/install sed "s,@WITHQT@,$WITHQT," $CWD/slack-desc > $PKG/install/slack-desc + +[ -n "$GROOVYVER" ] && \ + sed -i "19s,\$, This package was patched with GroovyMAME $GROOVYVER.," \ + $PKG/install/slack-desc + cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG |