summaryrefslogtreecommitdiffstats
path: root/games/gzdoom/gzdoom.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/gzdoom/gzdoom.SlackBuild')
-rw-r--r--games/gzdoom/gzdoom.SlackBuild102
1 files changed, 69 insertions, 33 deletions
diff --git a/games/gzdoom/gzdoom.SlackBuild b/games/gzdoom/gzdoom.SlackBuild
index 509485b06d..0a599804e2 100644
--- a/games/gzdoom/gzdoom.SlackBuild
+++ b/games/gzdoom/gzdoom.SlackBuild
@@ -1,11 +1,24 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for gzdoom
-# Written by B. Watson (yalhcru@gmail.com)
+# Written by B. Watson (urchlay@slackware.uk)
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20230810 bkw: add patch to fix build on -current (does no harm on 15.0).
+# 20230109 bkw: Updated for 4.10.0. Many thanks to fourtysixandtwo for
+# testing this on more capable hardware than I have, and for finding
+# the "-glversion 3.3" argument.
+# 20201115 bkw: Add missing fix_zipdir.diff. Dammit.
+# 20201107 bkw: Updated for 4.5.0.
+# 20201027 bkw:
+# - Updated for 4.4.2.
+# - Add new zmusic dep.
+# - Use 'make install/strip' now that it's supported.
+# - Use upstream's icon, multiple sizes in /usr/share/icons.
+# 20200302 bkw: Updated for 4.3.3.
+# 20191201 bkw: Updated for 4.2.4.
# 20181022 bkw: Updated for 3.6.0.
# 20180827 bkw: Updated for 3.5.1.
# 20180801 bkw: Updated for 3.5.0.
@@ -24,10 +37,13 @@
# - Stop supporting old versions of gzdoom. The old versions are now
# supported as "gzdoom-legacy" for those that need them.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=gzdoom
-VERSION=${VERSION:-3.6.0}
+VERSION=${VERSION:-4.10.0}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -37,7 +53,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,59 +82,75 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-g$VERSION $PRGNAM-$VERSION
-tar xvf $CWD/$PRGNAM-g$VERSION.tar.gz || \
- tar xvf $CWD/g$VERSION.tar.gz || \
- tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || \
- tar xvf $CWD/$VERSION.tar.gz
+tar xvf $CWD/$PRGNAM-g$VERSION.tar.gz
cd $PRGNAM-g$VERSION || cd $PRGNAM-$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 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
- -exec chmod 644 {} \+
-
-# gzdoom in windowed mode wants to display its git tag and hash as part
-# of the window title. For releases this shows up as "<unknown version> 0",
-# which doesn't hurt anything but is ugly.
-# This makes the window title appear as e.g. "GZDOOM 2.1.1 (Aug 3 2016)". The
-# date is the build date.
-patch -p1 < $CWD/window_title_version.diff
-sed -i "/#define *VERSIONSTR/s,GIT_DESCRIPTION,\"$VERSION\"," src/version.h
-
-# This isn't currently used, but was in the past, and will be again I'm sure.
-[ -e $CWD/compilefix.$VERSION.diff ] && \
- patch -p1 < $CWD/compilefix.$VERSION.diff
+find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# 20230810 bkw: patch for gcc 13 (Slackware -current), from AUR, by
+# way of biker_rat on LQ, delivered C/O ponce.
+patch -p1 < $CWD/gcc13-missing-includes.diff
+
+# 20201027 bkw: fix the '<unknown version>' in the window title. This
+# used to be done in an uglier way (with a patch that occasionally broke
+# when applied against new gzdooms).
+sed -i '/COMMAND.*UpdateRevision/s,^,# ,' src/CMakeLists.txt
+( echo "#define GIT_DESCRIPTION \"$VERSION\""
+ echo "#define GIT_HASH \"release\""
+ echo "#define GIT_TIME __DATE__" ) > src/gitinfo.h
# 3.1.0 started needing -DNDEBUG. Using ld.gold speeds up the final link
# enough to be worth using (saves 17+ sec on my test box).
SLKCFLAGS="$SLKCFLAGS -DNDEBUG -fuse-ld=gold"
+# 20200302 bkw: gcc 5.5 needs this, not sure it's required by the C++ spec
+sed -i '1i#include <cmath>' \
+ src/rendering/swrenderer/drawers/r_draw.cpp \
+ src/rendering/swrenderer/viewport/r_spritedrawer.cpp
+
+# 20220318 bkw: gzdoom requires SSE2. not a problem for x86_64, but we
+# have to explicitly set the flags for the 32-bit build to succeed.
+SLKCFLAGS+=" -msse -msse2"
+
mkdir -p build
cd build
cmake \
-DCMAKE_C_FLAGS_RELEASE:STRING="$SLKCFLAGS -DSHARE_DIR=\\\"/usr/share/games/doom\\\"" \
-DCMAKE_CXX_FLAGS_RELEASE:STRING="$SLKCFLAGS -DSHARE_DIR=\\\"/usr/share/games/doom\\\"" \
+ -DINSTALL_DOCS_PATH=doc/$PRGNAM-$VERSION \
+ -DINSTALL_PATH=games \
-DCMAKE_INSTALL_PREFIX=/usr \
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
-DMAN_INSTALL_DIR=/usr/man \
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
- mkdir -p $PKG/usr/games $PKG/usr/share/games/doom
- install -m0755 -s $PRGNAM $PKG/usr/games/$PRGNAM
- install -m0644 *.pk3 $PKG/usr/share/games/doom/
+ make install/strip DESTDIR=$PKG
cd ..
+if fgrep -q '<unknown' src/gitinfo.h; then
+ echo "*** BREAKAGE: gitinfo.h got regenerated with <unknown version>" 1>&2
+ echo "*** Fix it, or get the maintainer to." 1>&2
+ echo "*** Press ^C to abort or wait 5 seconds for the build to continue" 1>&2
+ sleep 5
+fi
+
# .desktop written for this SlackBuild
mkdir -p $PKG/usr/share/applications
cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
-# PNG converted from Windows icon
+# New-school desktop-ey icons.
+for i in 16 22 32 48 64 128 256; do
+ SIZE=${i}x${i}
+ DIR=$PKG/usr/share/icons/hicolor/$SIZE/apps
+ mkdir -p $DIR
+ convert src/posix/zdoom.xpm -resize $SIZE $DIR/$PRGNAM.png
+done
+
+# Old-school windowmanagerish icon.
mkdir -p $PKG/usr/share/pixmaps
-cat $CWD/$PRGNAM.png > $PKG/usr/share/pixmaps/$PRGNAM.png
+ln -s ../icons/hicolor/64x64/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a docs/* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
cat $CWD/README_SBo.txt > $PKG/usr/doc/$PRGNAM-$VERSION/README_SBo.txt
@@ -126,4 +162,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