summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorM0Rf302017-08-24 17:09:23 +0200
committerM0Rf302017-08-24 17:09:23 +0200
commit2bc2dbc0f912025169e793ace4c4ef72a15b14f6 (patch)
tree5eb1885eff410a1303f31200acd509df944ac606
downloadaur-2bc2dbc0f912025169e793ace4c4ef72a15b14f6.tar.gz
xash3d-git: first commit
-rw-r--r--.SRCINFO19
-rw-r--r--PKGBUILD44
-rwxr-xr-xxash3d.sh54
3 files changed, 117 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..5a0ac9a21504
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+# Generated by mksrcinfo v8
+# Thu Aug 24 15:09:12 UTC 2017
+pkgbase = xash3d-git
+ pkgdesc = A custom Gold Source engine rewritten from scratch
+ pkgver = v0.19.r4.g18eb06d
+ pkgrel = 1
+ url = http://xash.su/
+ arch = i686
+ arch = x86_64
+ license = GPL3
+ makedepends = gcc-multilib
+ depends = lib32-sdl2
+ source = xash3d-git::git+https://github.com/FWGS/xash3d.git
+ source = xash3d.sh
+ md5sums = SKIP
+ md5sums = 3ef06bad6df82f714b57ce2f35cf7903
+
+pkgname = xash3d-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..896a4b153d8e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,44 @@
+# Maintainer: M0Rf30
+
+pkgname=xash3d-git
+pkgver=v0.19.r4.g18eb06d
+pkgrel=1
+pkgdesc="A custom Gold Source engine rewritten from scratch"
+arch=(i686 x86_64)
+url="http://xash.su/"
+license=('GPL3')
+depends=('lib32-sdl2')
+makedepends=('gcc-multilib')
+install=
+source=("$pkgname::git+https://github.com/FWGS/xash3d.git"
+ xash3d.sh)
+
+pkgver() {
+ cd $srcdir/$pkgname
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
+}
+
+prepare() {
+ cd $srcdir/$pkgname
+ git submodule init && git submodule update
+ mkdir -p build
+ cp ../xash3d.sh .
+}
+build() {
+ cd $srcdir/$pkgname
+ cd build
+ cmake ../. -DHL_SDK_DIR=../hlsdk -DXASH_SDL=yes -DXASH_VGUI=yes \
+ -DCMAKE_C_FLAGS="-m32" -DCMAKE_CXX_FLAGS="-m32" \
+ -DCMAKE_EXE_LINKER_FLAGS="-m32" \
+ -DCMAKE_INSTALL_PREFIX=/usr
+ make
+}
+
+package() {
+ cd $srcdir/$pkgname/
+ cd build
+ make DESTDIR="$pkgdir" install
+}
+
+md5sums=('SKIP'
+ '3ef06bad6df82f714b57ce2f35cf7903')
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