summaryrefslogtreecommitdiffstats
path: root/games/opendune
diff options
context:
space:
mode:
author B. Watson2021-10-26 22:58:30 +0200
committer Willy Sudiarto Raharjo2021-10-29 12:07:24 +0200
commitb1e728b46a082463fac7020e82f26c6ef3acec3c (patch)
tree0c4ca3fbe2632c930262e210ccac10b64606d7f8 /games/opendune
parent6639ea9752682c6640f1d0462603f2466c03a451 (diff)
downloadslackbuilds-b1e728b46a082463fac7020e82f26c6ef3acec3c.tar.gz
games/opendune: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/opendune')
-rw-r--r--games/opendune/README27
-rw-r--r--games/opendune/gcc10fix.diff27
-rw-r--r--games/opendune/opendune.SlackBuild32
-rw-r--r--games/opendune/opendune.desktop2
-rw-r--r--games/opendune/slack-desc2
5 files changed, 65 insertions, 25 deletions
diff --git a/games/opendune/README b/games/opendune/README
index 06f584319b..cd3469eeac 100644
--- a/games/opendune/README
+++ b/games/opendune/README
@@ -14,16 +14,23 @@ data files. Copy or symlink the .PAK files from the original game to
"/usr/share/games/opendune/data". The filenames can be uppercase or
lowercase.
-If you're building a package for a very old x86 system (that doesn't
-support MMX), on a newer system (that does support MMX), set MMX=no in
-the script's environment. If you're building on the same system you'll
-install the package on, you don't have to worry about this (MMX will
-be autodetected).
+Note: the first time you run opendune, it'll show the intro movie,
+with no way to skip it. Be patient.
-Optional dependencies:
+Optional dependencies: TiMidity++ and eawpats. Install these to hear
+the in-game music.
-If SDL2 and SDL2_image are installed, opendune will use them rather than
-SDL 1. To avoid this (to always build with SDL 1), set SDL2=no in the
-script's environment.
+Build options:
-To hear the in-game music, install TiMidity++ and eawpats.
+PULSE: if you don't want to use PulseAudio for the sound, export
+PULSE=no in the script's environment. This will use plain ALSA for
+the sound.
+
+SDL2: opendune is built with SDL2 by default. If you prefer SDL1 for
+some reason, export SDL2=no in the script's environment.
+
+MMX: If you're building a package for a very old x86 system (that
+doesn't support MMX), on a newer system (that does support MMX), set
+MMX=no in the script's environment. If you're building on the same
+system you'll install the package on, you don't have to worry about
+this (MMX will be autodetected).
diff --git a/games/opendune/gcc10fix.diff b/games/opendune/gcc10fix.diff
new file mode 100644
index 0000000000..a5878852f6
--- /dev/null
+++ b/games/opendune/gcc10fix.diff
@@ -0,0 +1,27 @@
+diff --git a/config.lib b/config.lib
+index 7824dfc2..757bda4a 100644
+--- a/config.lib
++++ b/config.lib
+@@ -605,7 +605,7 @@ make_compiler_cflags() {
+
+ if [ `basename $1 | cut -c 1-3` = "icc" ]; then
+ # Enable some things only for certain ICC versions
+- cc_version=`$1 -dumpversion | cut -c 1-4 | sed s@\\\.@@g`
++ cc_version=`$1 -dumpversion | cut -d. -f 1-2 | sed s@\\\.@@g`
+
+ flags="$flags -rdynamic"
+ ldflags="$ldflags -rdynamic"
+@@ -736,8 +736,11 @@ make_compiler_cflags() {
+ ldflags="$ldflags -rdynamic"
+ else
+ # Enable some things only for certain GCC versions
+- cc_version=`$1 -dumpversion | cut -c 1,3`
+- if [ $(echo -n "$cc_version" | wc -c) -eq 1 ] ; then
++ cc_version=`$1 -dumpversion | cut -d. -f 1-2`
++ if echo "$cc_version" | grep -q '\.' ; then
++ # remove the dot
++ cc_version=`echo "$cc_version" | sed s@\\\.@@g`
++ else
+ # add a 0 if the version had only one digit
+ cc_version="${cc_version}0"
+ fi
diff --git a/games/opendune/opendune.SlackBuild b/games/opendune/opendune.SlackBuild
index 31212e13fc..ae32068b31 100644
--- a/games/opendune/opendune.SlackBuild
+++ b/games/opendune/opendune.SlackBuild
@@ -6,6 +6,9 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+# 20211026 bkw: BUILD=2
+# - fix build on -current
+# - document PULSE=no option
# 20180612 bkw: update for v0.9, script can no longer build 0.8
# 20170531 bkw: BUILD=2, fix build on x86
# 20170302 bkw: use long-format github URL
@@ -14,7 +17,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=opendune
VERSION=${VERSION:-0.9}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -26,9 +29,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
@@ -65,11 +65,12 @@ rm -rf $SRCNAM-$VERSION
tar xvf $CWD/$SRCNAM-$VERSION.tar.gz
cd $SRCNAM-$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 -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+
+# 20211026 bkw: patch from upstream git, fixes gcc version detection
+# for versions >= 10.x.
+patch -p1 < $CWD/gcc10fix.diff
# 20170531 bkw: upstream uses #if defined(__i386__) to test for MMX,
# which is wrong (should be checking __MMX__ instead). This only affects
@@ -101,8 +102,10 @@ sed -i "/\"data\//s,data,/usr/share/games/$PRGNAM," src/inifile.c
# Allow building with ALSA instead of pulseaudio. There's no way to switch
# between ALSA and Pulse at runtime, and many users prefer to avoid Pulse.
+WITHPULSE="with"
if [ "${PULSE:-yes}" = "no" -o ! -x /usr/bin/pulseaudio ]; then
PULSEOPT="--without-pulse"
+ WITHPULSE="without"
fi
# The configure script autodetects SDL 2, but it doesn't check for
@@ -110,13 +113,13 @@ fi
# SDL2 but not SDL2_image, the build will fail. Fix:
if [ "${SDL2:-yes}" = "no" ]; then
SDLOPT="--without-sdl2"
- SDLVER=1
+ SDLVER=1.2
elif pkg-config --exists sdl2 && pkg-config --exists SDL2_image; then
SDLOPT="--with-sdl2"
- SDLVER=2
+ SDLVER=2.0
else
SDLOPT="--without-sdl2"
- SDLVER=1
+ SDLVER=1.2
fi
# N.B. non-standard (non-autoconf) configure options here!
@@ -154,7 +157,10 @@ cat $CWD/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
-sed "s,@S@,$SDLVER," $CWD/slack-desc > $PKG/install/slack-desc
+sed -e "s,@S@,$SDLVER," \
+ -e "s,@P@,$WITHPULSE," \
+ $CWD/slack-desc \
+ > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
diff --git a/games/opendune/opendune.desktop b/games/opendune/opendune.desktop
index 3c6b0ee0d6..d44b3af276 100644
--- a/games/opendune/opendune.desktop
+++ b/games/opendune/opendune.desktop
@@ -1,7 +1,7 @@
[Desktop Entry]
Name=OpenDUNE
Comment=Dune II remake
-Exec=opendune
+Exec=/usr/games/opendune
Icon=opendune
Type=Application
Categories=Game;StrategyGame;
diff --git a/games/opendune/slack-desc b/games/opendune/slack-desc
index cc4f4ffeb5..8ed8098e27 100644
--- a/games/opendune/slack-desc
+++ b/games/opendune/slack-desc
@@ -14,6 +14,6 @@ opendune: Entertainment. It attempts to re-create the original game and apply
opendune: modern technology to it to allow it to be run natively on most
opendune: operating systems.
opendune:
-opendune: This package was built with SDL @S@.
+opendune: This package was built with SDL @S@ and @P@ PulseAudio.
opendune:
opendune: