summaryrefslogtreecommitdiff
path: root/.tools
diff options
context:
space:
mode:
Diffstat (limited to '.tools')
-rwxr-xr-x.tools/downloadlib.sh22
-rwxr-xr-x.tools/manaplus.sh33
-rwxr-xr-x.tools/retry.sh15
3 files changed, 70 insertions, 0 deletions
diff --git a/.tools/downloadlib.sh b/.tools/downloadlib.sh
new file mode 100755
index 00000000..b9a50d73
--- /dev/null
+++ b/.tools/downloadlib.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+export zipname="lib.zip"
+export libname="$1_$2"
+
+mkdir libdownload
+cd libdownload
+rm "${zipname}"
+../client-data/.tools/retry.sh wget -O "${zipname}" "https://gitlab.com/simplepackagemanager/spm/builds/artifacts/$1/download?job=${libname}"
+unzip "${zipname}"
+cp -r "bin/${libname}" ..
+cd ..
+
+rm -rf /usr/local/spm/bin/${libname}
+mkdir -p /usr/local/spm/bin
+
+cp -r libdownload/bin/${libname} /usr/local/spm/bin/
+ls /usr/local/spm/bin/${libname}
+if [ "$?" != 0 ]; then
+ echo "Library $1 $2 unpack failed"
+ exit 1
+fi
diff --git a/.tools/manaplus.sh b/.tools/manaplus.sh
new file mode 100755
index 00000000..aeb39a86
--- /dev/null
+++ b/.tools/manaplus.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+source ./.tools/init.sh
+
+clientdata_init
+
+aptget_update
+aptget_install gcc g++ \
+ make autoconf automake autopoint gettext \
+ libxml2-dev libcurl4-gnutls-dev libpng-dev \
+ libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-net1.2-dev libsdl-ttf2.0-dev \
+ wget unzip
+
+pwd
+ls
+
+./clientdata/.tools/downloadlib.sh manaplus master || exit 1
+
+export HOME=`pwd`/clientdata/shared
+
+cd manaplus_master || exit 1
+export SDL_VIDEODRIVER=dummy
+./bin/manaplus --validate -u -d ../clientdata || exit 1
+
+ls "${HOME}/.local/share/mana/manaplus.log" || exit 1
+grep -A 10 "Assert:" "${HOME}/.local/share/mana/manaplus.log"
+
+if [ "$?" == 0 ]; then
+ echo "Asserts found"
+ exit 1
+fi
+
+cd ..
diff --git a/.tools/retry.sh b/.tools/retry.sh
new file mode 100755
index 00000000..aaa50e98
--- /dev/null
+++ b/.tools/retry.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+n=0
+
+while true; do
+ $*
+ if [ "$?" == 0 ]; then
+ exit 0
+ fi
+ if [[ $n -ge 10 ]]; then
+ exit -1
+ fi
+ sleep 5s
+ n=$((n+1))
+done