summaryrefslogtreecommitdiff
path: root/games/megaglest
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja[at]gmail[dot]com>2012-12-21 11:37:41 +0100
committerMatteo Bernardini <ponce@slackbuilds.org>2012-12-21 21:27:23 +0100
commit519123ffd3eb52bf78df35b16e888da02ad485f3 (patch)
tree27ab9266bc946ae0715790a93f506c0408c0cd6e /games/megaglest
parent4fc41ff2e82edb299bc36eda26fb49d30634d681 (diff)
downloadslackbuilds-519123ffd3eb52bf78df35b16e888da02ad485f3.tar.gz
games/megaglest: Updated for version 3.7.1.
Noted the optional dependency vlc Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Diffstat (limited to 'games/megaglest')
-rw-r--r--games/megaglest/README7
-rw-r--r--games/megaglest/gcc-4.7.patch28
-rw-r--r--games/megaglest/megaglest-3.6.0.2-help2man.patch11
-rw-r--r--games/megaglest/megaglest.SlackBuild11
-rw-r--r--games/megaglest/megaglest.info14
-rw-r--r--games/megaglest/xvfb-run172
6 files changed, 202 insertions, 41 deletions
diff --git a/games/megaglest/README b/games/megaglest/README
index 39510170d2..4e77e64e9f 100644
--- a/games/megaglest/README
+++ b/games/megaglest/README
@@ -4,5 +4,8 @@ Magic, Egyptians, Indians, Norsemen, Persian or Romans. The game
is setup in one of 16 naturally looking settings, which (like the
unit models) are crafted with great appreciation for detail.
-Optional dependencies are libircclient and miniupnpc, as well as
-help2man if you want to build manual pages.
+Optional dependencies are libircclient, miniupnpc and vlc, as well
+as help2man if you want to build man pages.
+
+Note to parallel builders: don't user more than 2 jobs or build
+will break.
diff --git a/games/megaglest/gcc-4.7.patch b/games/megaglest/gcc-4.7.patch
deleted file mode 100644
index 3d118b1a9c..0000000000
--- a/games/megaglest/gcc-4.7.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- trunk/source/shared_lib/sources/util/util.cpp 2012/04/14 21:21:09 3244
-+++ trunk/source/shared_lib/sources/util/util.cpp 2012/05/01 14:55:06 3279
-@@ -22,6 +22,8 @@
-
- #ifdef WIN32
- #include <io.h> // for open()
-+#else
-+ #include <unistd.h>
- #endif
-
- #include <sys/stat.h> // for open()
---- trunk/source/shared_lib/include/graphics/math_util.h 2012/04/16 20:15:57 3252
-+++ trunk/source/shared_lib/include/graphics/math_util.h 2012/05/01 14:55:06 3279
-@@ -184,10 +184,10 @@
-
- Rect2<T> computeBoundingRect() const{
- return Rect2i(
-- min(p[0].x, p[1].x),
-- min(p[0].y, p[2].y),
-- max(p[2].x, p[3].x),
-- max(p[1].y, p[3].y));
-+ std::min(p[0].x, p[1].x),
-+ std::min(p[0].y, p[2].y),
-+ std::max(p[2].x, p[3].x),
-+ std::max(p[1].y, p[3].y));
- }
-
- bool isInside(const Vec2<T> &pt) const{
diff --git a/games/megaglest/megaglest-3.6.0.2-help2man.patch b/games/megaglest/megaglest-3.6.0.2-help2man.patch
new file mode 100644
index 0000000000..6c71b8afe5
--- /dev/null
+++ b/games/megaglest/megaglest-3.6.0.2-help2man.patch
@@ -0,0 +1,11 @@
+--- megaglest-3.6.0.2/source/g3d_viewer/CMakeLists.txt.orig 2012-01-01 12:28:16.744930699 -0200
++++ megaglest-3.6.0.2/source/g3d_viewer/CMakeLists.txt 2012-01-01 12:29:41.693429413 -0200
+@@ -157,7 +157,7 @@ IF(BUILD_MEGAGLEST_MODEL_VIEWER)
+ MESSAGE("***-- Found xvfb-run: ${XVFB_EXEC} about to build manpage with it.")
+
+ add_custom_target(${TARGET_NAME_MANPAGE} ALL
+- COMMAND ${XVFB_EXEC} --auto-servernum --server-num=770 ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME_MANPAGE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}
++ COMMAND ${XVFB_EXEC} --auto-servernum ${HELP2MAN} --name='${MG_MANPAGE_DESCRIPTION}' --section=6 -N -o ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME_MANPAGE} ${EXECUTABLE_OUTPUT_PATH}/${TARGET_NAME}
+ DEPENDS ${TARGET_NAME})
+ ELSE()
+ add_custom_target(${TARGET_NAME_MANPAGE} ALL
diff --git a/games/megaglest/megaglest.SlackBuild b/games/megaglest/megaglest.SlackBuild
index 6501b9b28e..0bb57a7de9 100644
--- a/games/megaglest/megaglest.SlackBuild
+++ b/games/megaglest/megaglest.SlackBuild
@@ -5,8 +5,8 @@
# Written by Larry Hajali <larryhaj[at]gmail[dot]com>
PRGNAM=megaglest
-VERSION=${VERSION:-3.6.0.3}
-BUILD=${BUILD:-2}
+VERSION=${VERSION:-3.7.1}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
@@ -62,8 +62,11 @@ find . \
sed -i "/^const string glestVersionString/ s|=.*|= \"v${VERSION}\";|" \
source/glest_game/facilities/game_util.cpp
-# From upstream. Fixes gcc 4.7.x compile issues.
-patch -p1 < $CWD/gcc-4.7.patch
+# Fix megaglest help2man when no X display is available. Use a wrapper
+# script from upstream for Xvfb that create a temporary *fake* framebuffer
+install -m 0755 -D $CWD/xvfb-run $TMP/$SRCDIR/bin/xvfb-run
+export PATH="$PATH:$TMP/$SRCDIR/bin"
+patch -p1 < $CWD/megaglest-3.6.0.2-help2man.patch
mkdir build
cd build
diff --git a/games/megaglest/megaglest.info b/games/megaglest/megaglest.info
index 6cb80237c6..156c10c265 100644
--- a/games/megaglest/megaglest.info
+++ b/games/megaglest/megaglest.info
@@ -1,12 +1,12 @@
PRGNAM="megaglest"
-VERSION="3.6.0.3"
+VERSION="3.7.1"
HOMEPAGE="http://megaglest.org/"
-DOWNLOAD="http://downloads.sourceforge.net/megaglest/megaglest-source-3.6.0.3.tar.xz \
- http://downloads.sourceforge.net/megaglest/megaglest-data-3.6.0.3.tar.xz \
- http://downloads.sourceforge.net/megaglest/megaglest-source-embedded-3.6.0.3.tar.xz"
-MD5SUM="5a4a2429435031d9f9cc5d9535a9de9d \
- 63f360b52ad000af3fc71c33fc52106a \
- 200be8b61dbe3a9a2c1aaa008e3dc432"
+DOWNLOAD="http://downloads.sourceforge.net/megaglest/megaglest-source-3.7.1.tar.xz \
+ http://downloads.sourceforge.net/megaglest/megaglest-data-3.7.1.tar.xz \
+ http://downloads.sourceforge.net/megaglest/megaglest-source-embedded-3.7.1.tar.xz"
+MD5SUM="e7a960ec73784aa0f7b951d2ad963456 \
+ a73205fe02b684547dfe1fedc2d712b2 \
+ 9852ab186c23580950a2dfe995e3b9b6"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="xerces-c OpenAL lua ftgl wxPython"
diff --git a/games/megaglest/xvfb-run b/games/megaglest/xvfb-run
new file mode 100644
index 0000000000..9dd1d919f2
--- /dev/null
+++ b/games/megaglest/xvfb-run
@@ -0,0 +1,172 @@
+#!/bin/sh
+
+# This script starts an instance of Xvfb, the "fake" X server, runs a command
+# with that server available, and kills the X server when done. The return
+# value of the command becomes the return value of this script.
+#
+# If anyone is using this to build a Debian package, make sure the package
+# Build-Depends on xvfb, xbase-clients, and xfonts-base.
+
+set -e
+
+PROGNAME=xvfb-run
+SERVERNUM=99
+AUTHFILE=
+ERRORFILE=/dev/null
+STARTWAIT=3
+XVFBARGS="-screen 0 640x480x8"
+LISTENTCP="-nolisten tcp"
+XAUTHPROTO=.
+
+PATH=$PATH:/usr/bin/X11:/usr/X11R6/bin
+
+# Query the terminal to establish a default number of columns to use for
+# displaying messages to the user. This is used only as a fallback in the event
+# the COLUMNS variable is not set. ($COLUMNS can react to SIGWINCH while the
+# script is running, and this cannot, only being calculated once.)
+DEFCOLUMNS=$(stty size 2>/dev/null | awk '{print $2}') || true
+if ! expr "$DEFCOLUMNS" : "[[:digit:]]\+$" >/dev/null 2>&1; then
+ DEFCOLUMNS=80
+fi
+
+# Display a message, wrapping lines at the terminal width.
+message () {
+ echo "$PROGNAME: $*" | fmt -t -w ${COLUMNS:-$DEFCOLUMNS}
+}
+
+# Display an error message.
+error () {
+ message "error: $*" >&2
+}
+
+# Display a usage message.
+usage () {
+ if [ -n "$*" ]; then
+ message "usage error: $*"
+ fi
+ cat <<EOF
+Usage: $PROGNAME [OPTION ...] COMMAND
+Run COMMAND (usually an X client) in a virtual X server environment.
+Options:
+-a --auto-servernum try to get a free server number, starting at
+ --server-num
+-e FILE --error-file=FILE file used to store xauth errors and Xvfb
+ output (default: $ERRORFILE)
+-f FILE --auth-file=FILE file used to store auth cookie
+ (default: ./.Xauthority)
+-h --help display this usage message and exit
+-n NUM --server-num=NUM server number to use (default: $SERVERNUM)
+-l --listen-tcp enable TCP port listening in the X server
+-p PROTO --xauth-protocol=PROTO X authority protocol name to use
+ (default: xauth command's default)
+-s ARGS --server-args=ARGS arguments (other than server number and
+ "-nolisten tcp") to pass to the Xvfb server
+ (default: "$XVFBARGS")
+-w DELAY --wait=DELAY delay in seconds to wait for Xvfb to start
+ before running COMMAND (default: $STARTWAIT)
+EOF
+}
+
+# Find a free server number by looking at .X*-lock files in /tmp.
+find_free_servernum() {
+ # Sadly, the "local" keyword is not POSIX. Leave the next line commented in
+ # the hope Debian Policy eventually changes to allow it in /bin/sh scripts
+ # anyway.
+ #local i
+
+ i=$SERVERNUM
+ while [ -f /tmp/.X$i-lock ]; do
+ i=$(($i + 1))
+ done
+ echo $i
+}
+
+# Parse the command line.
+ARGS=$(getopt --options +ae:f:hn:lp:s:w: \
+ --long auto-servernum,error-file:auth-file:,help,server-num:,listen-tcp,xauth-protocol:,server-args:,wait: \
+ --name "$PROGNAME" -- "$@")
+GETOPT_STATUS=$?
+
+if [ $GETOPT_STATUS -ne 0 ]; then
+ error "internal error; getopt exited with status $GETOPT_STATUS"
+ exit 6
+fi
+
+eval set -- "$ARGS"
+
+while :; do
+ case "$1" in
+ -a|--auto-servernum) SERVERNUM=$(find_free_servernum) ;;
+ -e|--error-file) ERRORFILE="$2"; shift ;;
+ -f|--auth-file) AUTHFILE="$2"; shift ;;
+ -h|--help) SHOWHELP="yes" ;;
+ -n|--server-num) SERVERNUM="$2"; shift ;;
+ -l|--listen-tcp) LISTENTCP="" ;;
+ -p|--xauth-protocol) XAUTHPROTO="$2"; shift ;;
+ -s|--server-args) XVFBARGS="$2"; shift ;;
+ -w|--wait) STARTWAIT="$2"; shift ;;
+ --) shift; break ;;
+ *) error "internal error; getopt permitted \"$1\" unexpectedly"
+ exit 6
+ ;;
+ esac
+ shift
+done
+
+if [ "$SHOWHELP" ]; then
+ usage
+ exit 0
+fi
+
+if [ -z "$*" ]; then
+ usage "need a command to run" >&2
+ exit 2
+fi
+
+if ! which xauth >/dev/null; then
+ error "xauth command not found"
+ exit 3
+fi
+
+# If the user did not specify an X authorization file to use, set up a temporary
+# directory to house one.
+if [ -z "$AUTHFILE" ]; then
+ XVFB_RUN_TMPDIR="${TMPDIR:-/tmp}/$PROGNAME.$$"
+ if ! mkdir -p -m 700 "$XVFB_RUN_TMPDIR"; then
+ error "temporary directory $XVFB_RUN_TMPDIR already exists"
+ exit 4
+ fi
+ AUTHFILE=$(tempfile -n "$XVFB_RUN_TMPDIR/Xauthority")
+fi
+
+# Start Xvfb.
+MCOOKIE=$(mcookie)
+XAUTHORITY=$AUTHFILE xauth add ":$SERVERNUM" "$XAUTHPROTO" "$MCOOKIE" \
+ >"$ERRORFILE" 2>&1
+XAUTHORITY=$AUTHFILE Xvfb ":$SERVERNUM" $XVFBARGS $LISTENTCP >"$ERRORFILE" \
+ 2>&1 &
+XVFBPID=$!
+sleep "$STARTWAIT"
+
+# Start the command and save its exit status.
+set +e
+DISPLAY=:$SERVERNUM XAUTHORITY=$AUTHFILE "$@" 2>&1
+RETVAL=$?
+set -e
+
+# Kill Xvfb now that the command has exited.
+kill $XVFBPID
+
+# Clean up.
+XAUTHORITY=$AUTHFILE xauth remove ":$SERVERNUM" >"$ERRORFILE" 2>&1
+if [ -n "$XVFB_RUN_TMPDIR" ]; then
+ if ! rm -r "$XVFB_RUN_TMPDIR"; then
+ error "problem while cleaning up temporary directory"
+ exit 5
+ fi
+fi
+
+# Return the executed command's exit status.
+exit $RETVAL
+
+# vim:set ai et sts=4 sw=4 tw=80: