summarylogtreecommitdiffstats
path: root/xash3d.sh
diff options
context:
space:
mode:
authorM0Rf302017-08-24 17:09:23 +0200
committerM0Rf302017-08-24 17:09:23 +0200
commit2bc2dbc0f912025169e793ace4c4ef72a15b14f6 (patch)
tree5eb1885eff410a1303f31200acd509df944ac606 /xash3d.sh
downloadaur-2bc2dbc0f912025169e793ace4c4ef72a15b14f6.tar.gz
xash3d-git: first commit
Diffstat (limited to 'xash3d.sh')
-rwxr-xr-xxash3d.sh54
1 files changed, 54 insertions, 0 deletions
diff --git a/xash3d.sh b/xash3d.sh
new file mode 100755
index 000000000000..7661218ce1b6
--- /dev/null
+++ b/xash3d.sh
@@ -0,0 +1,54 @@
+#!/bin/sh
+
+SCRIPT_DIR=${PWD##*/}
+IS64BIT=$(getconf LONG_BIT)
+
+if [ "$IS64BIT" == "64" ]; then
+ LIBPREFIX="lib32"
+else
+ LIBPREFIX="lib"
+fi
+
+if [ "$SCRIPT_DIR" == "bin" ]; then
+# Xash3D SDL is installed in system, so run it from lib/xash3d/ directory with Steam HL basedir if XASH3D_BASEDIR is not set
+ if [ -z "$XASH3D_BASEDIR" ]; then
+ export XASH3D_BASEDIR="$HOME/.steam/steam/steamapps/common/Half-Life/"
+ fi
+ echo "Xash3D SDL is installed in system."
+fi
+ GAMEROOT=/usr/lib/xash3d
+
+
+#determine platform
+UNAME=`uname`
+if [ "$UNAME" == "Darwin" ]; then
+ # prepend our lib path to LD_LIBRARY_PATH
+ export DYLD_LIBRARY_PATH=${GAMEROOT}:$DYLD_LIBRARY_PATH
+elif [ "$UNAME" == "Linux" ]; then
+ # prepend our lib path to LD_LIBRARY_PATH
+ export LD_LIBRARY_PATH=${GAMEROOT}:$LD_LIBRARY_PATH
+elif [ "$UNAME" == "FreeBSD" ]; then
+ export LD_LIBRARY_PATH=${GAMEROOT}:$LD_LIBRARY_PATH
+fi
+
+if [ -z $GAMEEXE ]; then
+ if [ "$UNAME" == "Darwin" ]; then
+ GAMEEXE=xash3d
+ elif [ "$UNAME" == "Linux" ]; then
+ GAMEEXE=xash3d
+ elif [ "$UNAME" == "FreeBSD" ]; then
+ GAMEEXE=xash3d
+ fi
+fi
+
+ulimit -n 2048
+
+# and launch the game
+cd "$GAMEROOT"
+
+STATUS=42
+while [ $STATUS -eq 42 ]; do
+ ${DEBUGGER} "${GAMEROOT}"/${GAMEEXE} $@
+ STATUS=$?
+done
+exit $STATUS