summaryrefslogtreecommitdiffstats
path: root/games/freeminer/freeminer.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/freeminer/freeminer.SlackBuild')
-rw-r--r--games/freeminer/freeminer.SlackBuild61
1 files changed, 40 insertions, 21 deletions
diff --git a/games/freeminer/freeminer.SlackBuild b/games/freeminer/freeminer.SlackBuild
index 47781d9f3e..58ec97f5c7 100644
--- a/games/freeminer/freeminer.SlackBuild
+++ b/games/freeminer/freeminer.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for freeminer
@@ -23,11 +23,31 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220302 bkw: Modified by SlackBuilds.org: fix build on 15.0,
+# by updating to latest git (80629f40a85fccafaefea1a490d9ca384f73493f).
+
+# Note to maintainer: *please* don't use only a git hash as a version
+# number. I used 0.4.14.8+20211109_80629f4, which includes the last
+# tag before the commit, the date, and the commit hash. The reason
+# for doing this is so we can tell at a glance which version is newer,
+# when looking at several packages. Also notice the updated download
+# URL in the .info file: it saves the file with the same name,
+# regardless of what the user used to download it (whether or not it
+# respects the Content-disposition header).
+
+# I tested the game to the extent of trying to connect to a server,
+# but one of the servers failed to connect, and the other connected,
+# downloaded some content, then dropped the connection. Hope that's
+# OK.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=freeminer
-VERSION=${VERSION:-git7ad981}
-SRCVER=7ad981638ea568caf0e3495752cb1bc4a3a853dd
+VERSION=${VERSION:-0.4.14.8+20211109_80629f4}
+SRCVER=80629f40a85fccafaefea1a490d9ca384f73493f
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -37,7 +57,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -62,28 +86,27 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$SRCVER
-#tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz
unzip $CWD/$PRGNAM-$SRCVER.zip || unzip $CWD/$SRCVER.zip
cd $PRGNAM-$SRCVER
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 \
+ -o -perm 511 \) -exec chmod 755 {} \+ -o \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-
-# Fix jsoncpp detection.
-sed -i '/find_path/s|)| /usr/include/jsoncpp)|' cmake/Modules/FindJson.cmake
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
-# Fix msgpack-c detection.
-sed -i 's/FIND_LIBRARY(MSGPACK_LIBRARY NAMES msgpack/& msgpackc/' cmake/Modules/FindMsgPack.cmake
+# 20220302 bkw: our json.h is a system header.
+find src -type f | \
+ xargs grep -l '#include.*json/json\.h' | \
+ xargs sed -i 's,"json/json.h",<json/json.h>,'
mkdir -p build
cd build
cmake \
+ -DJSON_INCLUDE_DIR=/usr/include/jsoncpp \
-DRUN_IN_PLACE:BOOL=0 \
- -DENABLE_SYSTEM_JSONCPP:BOOL=1 \
- -DENABLE_SYSTEM_MSGPACK:BOOL=1 \
+ -DENABLE_SYSTEM_JSONCPP:BOOL=ON \
+ -DENABLE_SYSTEM_MSGPACK:BOOL=ON \
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \
@@ -95,13 +118,9 @@ cd build
-DCMAKE_BUILD_TYPE=Release ..
make
- make install DESTDIR=$PKG
+ make install/strip DESTDIR=$PKG
cd ..
-
-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 {} \;
+gzip $PKG/usr/man/man*/*
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE.txt *md $PKG/usr/doc/$PRGNAM-$VERSION
@@ -112,4 +131,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE