games/odamex: Add SDL2 option.

Signed-off-by: B. Watson <yalhcru@gmail.com>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
B. Watson 2022-01-01 15:24:55 -05:00 committed by Willy Sudiarto Raharjo
parent c6825afff4
commit 5cc94cee5d
No known key found for this signature in database
GPG key ID: 3F617144D7238786

View file

@ -6,6 +6,10 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
# 20211231 bkw: BUILD=2.
# - the SDL2 segfault will likely be fixed soon (reported to PV, along
# with a patch). add SDL2 environment variable, default to no.
# 20211028 bkw: update for v0.9.5.
# - had to switch to SDL 1 to avoid SDL2_Mixer-related segfaults.
# unfortunately I can't get the music to work with SDL 1...
@ -28,7 +32,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=odamex
VERSION=${VERSION:-0.9.5}
BUILD=${BUILD:-1}
BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -40,9 +44,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
@ -89,6 +90,14 @@ chown -R root:root .
find . -type f -exec chmod 644 {} \+
find . -type d -exec chmod 755 {} \+
SDL12ARG=ON
[ "${SDL2:-no}" = "yes" ] && SDL12ARG=OFF
# 20220101 bkw: do not use systemwide install of portmidi, if it exists.
# This is to avoid a hidden portmidi dependency breaking the odamex
# binary when portmidi gets removed or upgraded.
patch -p1 < $CWD/use_bundled_portmidi.diff
# Make the launcher look in /usr/games for the odamex binary rather
# than the current directory. User can override with the settings
# dialog, this just sets the default.
@ -105,7 +114,7 @@ cd build
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_BINDIR=games \
-DwxWidgets_CONFIG_EXECUTABLE=$WXCONFIG \
-DUSE_SDL12=ON \
-DUSE_SDL12=$SDL12ARG \
-DCMAKE_BUILD_TYPE=Release ..
make VERBOSE=1
cd ..