summaryrefslogtreecommitdiff
path: root/games/odamex/odamex.SlackBuild
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2013-06-30 11:00:08 -0300
committerErik Hanson <erik@slackbuilds.org>2013-07-02 16:06:51 -0500
commit7ad32b6c040691b6a049a98ce49f32aadde26c20 (patch)
treee94156ef205963b10553de360bc09394176874ae /games/odamex/odamex.SlackBuild
parent2db11e1838e0c066b2bef216ac9c7254e4201afe (diff)
downloadslackbuilds-7ad32b6c040691b6a049a98ce49f32aadde26c20.tar.gz
games/odamex: Updated for version 0.6.3.
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'games/odamex/odamex.SlackBuild')
-rw-r--r--games/odamex/odamex.SlackBuild65
1 files changed, 40 insertions, 25 deletions
diff --git a/games/odamex/odamex.SlackBuild b/games/odamex/odamex.SlackBuild
index 7bcdc256bb..278f0869d8 100644
--- a/games/odamex/odamex.SlackBuild
+++ b/games/odamex/odamex.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
# Slackware build script for odamex
@@ -7,8 +7,8 @@
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
PRGNAM=odamex
-VERSION=${VERSION:-0.5.6}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-0.6.3}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -38,6 +38,11 @@ else
LIBDIRSUFFIX=""
fi
+# This is a dirty hack that should let odalaunch compile with versions of
+# wx(GTK|Python) 2.8.x where x < 12. Uncomment the following line and
+# cross your fingers:
+#SLKCFLAGS="$SLKCFLAGS -DwxIntPtr=long"
+
set -e
rm -rf $PKG
@@ -53,29 +58,39 @@ find . \
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
-exec chmod 644 {} \;
-sed -i "s/-g -Wall -O2/$SLKCFLAGS/" Makefile
-
-patch -p1 < $CWD/gcc47.diff
-
-# N.B. we want the game to look in /usr/share/games/doom for wad files,
-# to match the already-existing zdoom and prboom slackbuilds. Makefile
-# adds the /doom part to RESDIR itself. The patch adds this dir to the
-# default wad search path (otherwise we have to always run the game with
-# the -waddir option).
-
-patch -p1 < $CWD/waddir.diff
-
-make INSTALLDIR=/usr/games RESDIR=/usr/share/games
-make install INSTALLDIR=$PKG/usr/games RESDIR=$PKG/usr/share/games
-strip $PKG/usr/games/*
+# Make the game look in /usr/share/games/doom for wad files,
+# like the already-existing zdoom, prboom, gzdoom builds.
+sed -i 's,getenv("HOME"),"/usr/share/games/doom",' common/d_main.cpp
+
+# 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.
+sed -i \
+ '/launchercfg_s.odamex_directory *= */s,wxGetCwd(),wxString::FromAscii("/usr/games"),' \
+ odalaunch/src/dlg_main.cpp
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DCMAKE_BUILD_TYPE=Release ..
+ make VERBOSE=1
+cd ..
+
+# cmake-based odamex lacks a 'make install' target, do it manually.
+mkdir -p $PKG/usr/games
+install -s -m0755 build/client/$PRGNAM $PKG/usr/games
+install -s -m0755 build/server/odasrv $PKG/usr/games
+install -s -m0755 build/odalaunch/odalaunch $PKG/usr/games
+
+mkdir -p $PKG/usr/share/games/doom
+install -m0644 $PRGNAM.wad $PKG/usr/share/games/doom
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/tech
-
-# The distributed docs are DOS CRLF text files, and they're executable. Ugh.
-for doc in CHANGELOG LICENSE MAINTAINERS README TODO odasrv.cfg; do
- sed 's/\r//' < $doc > $PKG/usr/doc/$PRGNAM-$VERSION/$doc
-done
-mv $PKG/usr/doc/$PRGNAM-$VERSION/odasrv.cfg $PKG/usr/doc/$PRGNAM-$VERSION/odasrv.cfg.sample
+cp -a CHANGELOG LICENSE MAINTAINERS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
+cat odasrv.cfg > $PKG/usr/doc/$PRGNAM-$VERSION/odasrv.cfg.sample
install -m0644 doc/tech/* $PKG/usr/doc/$PRGNAM-$VERSION/tech
# Man page created for this slackbuild
@@ -83,7 +98,7 @@ mkdir -p $PKG/usr/man/man6
gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
# Desktop stuff
-mkdir -p $PKG/usr/share/{applications,pixmaps}
+mkdir -p $PKG/usr/share/applications $PKG/usr/share/pixmaps
for exe in $PRGNAM odasrv odalaunch; do
sed -e '/^Encoding/d' -e 's,/usr/share/doom,/usr/share/games/doom,' \
< installer/arch/$exe.desktop \