summaryrefslogtreecommitdiffstats
path: root/games/hedgewars/hedgewars.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/hedgewars/hedgewars.SlackBuild')
-rw-r--r--games/hedgewars/hedgewars.SlackBuild71
1 files changed, 47 insertions, 24 deletions
diff --git a/games/hedgewars/hedgewars.SlackBuild b/games/hedgewars/hedgewars.SlackBuild
index 70ea97aafa..5a004ef5f1 100644
--- a/games/hedgewars/hedgewars.SlackBuild
+++ b/games/hedgewars/hedgewars.SlackBuild
@@ -2,7 +2,7 @@
# SlackBuild script for Hedgewars.
-# Rubén Llorente <porting@use.startmail.com>
+# Original author: Rubén Llorente
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -22,6 +22,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20230902 bkw: update for v1.0.2.
+
+# 20230808 bkw: BUILD=2
+# - take over maintenance.
+# - binary in /usr/games.
+# - strip bin and shared lib.
+# - fix permission on appdata.
+# - include prescaled icons.
+
+# 20220320 bkw: Modified by SlackBuilds.org: fix 32-bit build.
+# The deps are different on 32-bit and 64-bit; see README.
+
# 20210905 bkw: Modified by SlackBuilds.org:
# - add fpc-3.2.0.patch for recent fpc upgrade
# - add include.qpainterpath.diff to fix compile on -current
@@ -29,7 +41,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=hedgewars
-VERSION=${VERSION:-1.0.0}
+VERSION=${VERSION:-1.0.2}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -42,9 +54,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
-# the name of the created package would be, and then exit. This information
-# could be useful to other scripts.
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
exit 0
@@ -77,14 +86,10 @@ rm -rf $PRGNAM-src-$VERSION
tar xvjf $CWD/$PRGNAM-src-$VERSION.tar.bz2
cd $PRGNAM-src-$VERSION
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 \
- \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find . -type f -a -exec chmod 644 {} + \
+ -o -type d -a -exec chmod 755 {} +
-patch -p1 < $CWD/fpc-3.2.0.patch
-patch -p1 < $CWD/include.qpainterpath.diff
+SLKCFLAGS+=" -fcommon"
mkdir -p build
cd build
@@ -93,24 +98,42 @@ cd build
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
- -DNOVIDEOREC=1 \
- -DPHYSFS_SYSTEM=off \
- -DNOSERVER=1 \
+ -DNOVIDEOREC=ON \
+ -DNOSERVER=ON \
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
- make install DESTDIR=$PKG
+ make install/strip DESTDIR=$PKG
cd ..
-# Include the man page.
-mkdir -p $PKG/usr/man/man6
-cp $TMP/$PRGNAM-src-$VERSION/man/hedgewars.6 $PKG/usr/man/man6
+# It's a game, so:
+mv $PKG/usr/bin $PKG/usr/games
-find $PKG/usr/man -type f -exec gzip -9 {} \;
-for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
+# Cleanup on aisle 6:
+strip $PKG/usr/games/*
+sed -i '/^Exec/s,=,=/usr/games/,' $PKG/usr/share/applications/$PRGNAM.desktop
+chmod -x $PKG/usr/share/appdata/*
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a COPYING INSTALL.md CREDITS README.md Fonts_LICENSE.txt ChangeLog.txt $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# Include the man page.
+mkdir -p $PKG/usr/man/man6
+gzip -9c < man/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
+
+# Don't need tiny XPM icon.
+rm -f $PKG/usr/share/pixmaps/*
+
+# Icons extracted from share/Icon.icns with icns2png.
+for i in $CWD/icons/*.png; do
+ px="$( basename $i .png )"
+ sz="${px}x${px}"
+ dir=$PKG/usr/share/icons/hicolor/$sz/apps
+ mkdir -p $dir
+ cat $i > $dir/$PRGNAM.png
+done
+ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a COPYING CREDITS README.md Fonts_LICENSE.txt ChangeLog.txt $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc