OpenRCT2/scripts/linux/build-appimage.sh

42 lines
978 B
Bash
Raw Normal View History

#! /bin/bash
set -e
set -x
# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
2018-08-29 22:05:57 +02:00
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" OpenRCT2-appimage-build-XXXXXX)
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
[ "$NO_CLEANUP" == "" ] && trap cleanup EXIT
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
OLD_CWD=$(readlink -f .)
pushd "$BUILD_DIR"
2018-08-29 22:05:57 +02:00
# standard linuxdeploy pattern
#see https://docs.appimage.org/packaging-guide/from-source/index.html for more information
2018-09-29 15:00:30 +02:00
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -G Ninja -DCMAKE_BUILD_TYPE=Release
2018-08-29 22:32:43 +02:00
ninja -v
2018-08-29 22:23:53 +02:00
DESTDIR=AppDir ninja install
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy*.AppImage
2018-08-29 22:05:57 +02:00
./linuxdeploy*.AppImage --appimage-extract-and-run --appdir AppDir/ --output appimage
mv OpenRCT2*.AppImage "$OLD_CWD"/