Add distribution scripts for Arch linux and appimage

This commit is contained in:
Jack Andersen 2019-11-20 17:56:33 -10:00
parent a6965d5f14
commit 875c0fb9fd
2 changed files with 141 additions and 0 deletions

View File

@ -0,0 +1,88 @@
#!/bin/bash
###############################################################
# Uses LXD to create an Ubuntu Xenial container and produce #
# a reasonably portable AppImage of PrimeWorldEditor. #
###############################################################
set -e
CMAKE_VERSION=3.15.5
CONTAINER_NAME=pwe-ci
# Set up container, deleting existing if necessary
if lxc info $CONTAINER_NAME >& /dev/null
then
lxc delete $CONTAINER_NAME --force
fi
lxc init ubuntu:16.04 $CONTAINER_NAME
# Inject build script
lxc file push - $CONTAINER_NAME/root/dobuild.sh <<END
#!/bin/bash
set -e
# PWE build script for Ubuntu 16.04 LTS (Xenial)
# Install build dependencies
apt update
apt -y install build-essential software-properties-common python-software-properties
add-apt-repository -y ppa:ubuntu-toolchain-r/test
add-apt-repository -y ppa:jonathonf/python-3.6
add-apt-repository -y ppa:beineri/opt-qt-5.12.3-xenial
apt update
apt -y install g++-8 curl git ninja-build libclang-6.0-dev python3.6 python3-pip zlib1g-dev qt512tools qt512svg libglu1-mesa-dev
# Expose Qt 5.12
export PATH=$PATH:/bin:/opt/qt512/bin
# Doing everything in root is fine
cd /
# Install recent CMake
curl -OL https://github.com/Kitware/CMake/releases/download/v$CMAKE_VERSION/cmake-$CMAKE_VERSION-Linux-x86_64.sh
sh cmake-$CMAKE_VERSION-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir
# Get linuxdeployqt
curl -OL https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage
chmod +x linuxdeployqt-continuous-x86_64.AppImage
/linuxdeployqt-continuous-x86_64.AppImage --appimage-extract
# Cleanup
rm -rf PrimeWorldEditor{-build,-appdir,}
# Clone repository
git clone https://github.com/AxioDL/PrimeWorldEditor
pushd PrimeWorldEditor
git submodule update --recursive --init
popd
# Build
mkdir -p PrimeWorldEditor{-build,-appdir}
pushd PrimeWorldEditor-build
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=gcc-8 -DCMAKE_CXX_COMPILER=g++-8 \
-DPWE_PUBLIC_RELEASE=On -DCMAKE_INSTALL_PREFIX=/PrimeWorldEditor-appdir/usr \
/PrimeWorldEditor
ninja install
popd
strip -s /PrimeWorldEditor-appdir/usr/bin/PrimeWorldEditor
cp PrimeWorldEditor-appdir/usr/share/icons/hicolor/256x256/apps/PrimeWorldEditor.png PrimeWorldEditor-appdir/
cp PrimeWorldEditor-appdir/usr/share/applications/io.github.arukibree.PrimeWorldEditor.desktop PrimeWorldEditor-appdir/
/squashfs-root/usr/bin/linuxdeployqt /PrimeWorldEditor-appdir/usr/bin/PrimeWorldEditor -appimage
END
# Start container
lxc start $CONTAINER_NAME
# Wait for network
lxc exec $CONTAINER_NAME -- bash -c "while ! systemctl status network.target; do sleep 1; done"
# Run build script
lxc exec $CONTAINER_NAME -t -- bash /root/dobuild.sh
# Retrieve AppImage
lxc file pull $CONTAINER_NAME/Prime_World_Editor-x86_64.AppImage .
# Cleanup
lxc delete $CONTAINER_NAME --force

53
dist/linux-arch/PKGBUILD vendored Normal file
View File

@ -0,0 +1,53 @@
# Maintainer: Jack Andersen <jackoalan@gmail.com>
pkgbase=pwe-git
pkgname=$pkgbase
pkgver=v1.2.5.r3.56ecceb9
pkgrel=1
pkgdesc='An editor for games by Retro Studios'
arch=('x86_64')
url='https://github.com/arukibree/PrimeWorldEditor'
license=('MIT')
depends=('qt5-base' 'zlib')
makedepends=('clang' 'python' 'ninja')
source=('git+https://github.com/AxioDL/PrimeWorldEditor.git'
'git+https://github.com/AxioDL/LibCommon.git'
'git+https://github.com/AxioDL/CodeGen.git')
sha256sums=('SKIP' 'SKIP' 'SKIP')
pkgver() {
cd PrimeWorldEditor
git describe | sed 's/-/.r/; s/-g/./'
}
prepare() {
if [[ -d build ]]; then
rm -rf build
fi
mkdir build
ln -s $startdir/LibCommon $startdir/LibCommon.git
ln -s $startdir/CodeGen $startdir/CodeGen.git
cd PrimeWorldEditor
git submodule init
git config submodule.LibCommon.url $srcdir/LibCommon
git submodule update
cd externals/LibCommon
git submodule init
git config submodule.CodeGen.url $srcdir/CodeGen
git submodule update
}
build() {
cd build
cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX='/usr' ../PrimeWorldEditor
ninja
}
package() {
DESTDIR="${pkgdir}" ninja -C build install
}