mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #7957 from TheAssassin/appimage
Add build scripts to create an AppImage.
This commit is contained in:
commit
82107e5666
|
@ -0,0 +1,12 @@
|
|||
#! /bin/bash
|
||||
|
||||
set -ex
|
||||
|
||||
REPO_ROOT=$(readlink -f $(dirname "$0")/../..)
|
||||
|
||||
docker run --rm -it -e NO_CLEANUP=1 -e CI=1 --device /dev/fuse:mrw -v $(readlink -f .):/ws openrct2/openrct2:ubuntu_amd64 bash -xc "
|
||||
cd /ws
|
||||
apt-get update
|
||||
apt-get install -y wget libcairo2
|
||||
bash -xe scripts/linux/build-appimage.sh
|
||||
"
|
|
@ -0,0 +1,41 @@
|
|||
#! /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
|
||||
|
||||
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"
|
||||
|
||||
# standard linuxdeploy pattern
|
||||
#see https://docs.appimage.org/packaging-guide/from-source/index.html for more information
|
||||
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -G Ninja -DCMAKE_BUILD_TYPE=Release
|
||||
|
||||
ninja -v
|
||||
DESTDIR=AppDir ninja install
|
||||
|
||||
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||
chmod +x linuxdeploy*.AppImage
|
||||
|
||||
./linuxdeploy*.AppImage --appimage-extract-and-run --appdir AppDir/ --output appimage
|
||||
|
||||
mv OpenRCT2*.AppImage "$OLD_CWD"/
|
|
@ -117,19 +117,24 @@ namespace Platform
|
|||
path = Path::Combine(exeDirectory, "data");
|
||||
if (!Path::DirectoryExists(path))
|
||||
{
|
||||
// 3. Try standard system app directories
|
||||
path = FindInstallPath();
|
||||
if (path.empty())
|
||||
// 3. Try ${exeDir}/../share/openrct2
|
||||
path = Path::Combine(exeDirectory, "../share/openrct2");
|
||||
if (!Path::DirectoryExists(path))
|
||||
{
|
||||
// 4. Fallback to ${cwd}/data
|
||||
path = GetCurrentWorkingDirectory();
|
||||
if (!path.empty())
|
||||
// 4. Try standard system app directories
|
||||
path = FindInstallPath();
|
||||
if (path.empty())
|
||||
{
|
||||
path = Path::Combine(path, "data");
|
||||
}
|
||||
else
|
||||
{
|
||||
return "/";
|
||||
// 5. Fallback to ${cwd}/data
|
||||
path = GetCurrentWorkingDirectory();
|
||||
if (!path.empty())
|
||||
{
|
||||
path = Path::Combine(path, "data");
|
||||
}
|
||||
else
|
||||
{
|
||||
return "/";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue