mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-08-16 16:36:01 +00:00
Add build script to generate AppImage
This commit is contained in:
parent
4794f44a6d
commit
caca491943
48
scripts/build-appimage.sh
Executable file
48
scripts/build-appimage.sh
Executable file
@ -0,0 +1,48 @@
|
|||||||
|
BUILD_CONFIG="release"
|
||||||
|
|
||||||
|
fail()
|
||||||
|
{
|
||||||
|
echo "$1" 1>&2
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
BUILD_ROOT=$PWD/build
|
||||||
|
SOURCE_ROOT=$PWD
|
||||||
|
BUILD_FOLDER=$BUILD_ROOT/build-$BUILD_CONFIG
|
||||||
|
DEPLOY_FOLDER=$BUILD_ROOT/deploy-$BUILD_CONFIG
|
||||||
|
INSTALLER_FOLDER=$BUILD_ROOT/installer-$BUILD_CONFIG
|
||||||
|
VERSION=`cat $SOURCE_ROOT/app/version.txt`
|
||||||
|
|
||||||
|
command -v qmake >/dev/null 2>&1 || fail "Unable to find 'qmake' in your PATH!"
|
||||||
|
command -v linuxdeployqt >/dev/null 2>&1 || fail "Unable to find 'linuxdeployqt' in your PATH!"
|
||||||
|
|
||||||
|
echo Cleaning output directories
|
||||||
|
rm -rf $BUILD_FOLDER
|
||||||
|
rm -rf $DEPLOY_FOLDER
|
||||||
|
rm -rf $INSTALLER_FOLDER
|
||||||
|
mkdir $BUILD_ROOT
|
||||||
|
mkdir $BUILD_FOLDER
|
||||||
|
mkdir $DEPLOY_FOLDER
|
||||||
|
mkdir $INSTALLER_FOLDER
|
||||||
|
|
||||||
|
echo Configuring the project
|
||||||
|
pushd $BUILD_FOLDER
|
||||||
|
qmake $SOURCE_ROOT/moonlight-qt.pro PREFIX=$DEPLOY_FOLDER/usr || fail "Qmake failed!"
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo Compiling Moonlight in $BUILD_CONFIG configuration
|
||||||
|
pushd $BUILD_FOLDER
|
||||||
|
make -j$(nproc) $(echo "$BUILD_CONFIG" | tr '[:upper:]' '[:lower:]') || fail "Make failed!"
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo Deploying to staging directory
|
||||||
|
pushd $BUILD_FOLDER
|
||||||
|
make install || fail "Make install failed!"
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo Creating AppImage
|
||||||
|
pushd $INSTALLER_FOLDER
|
||||||
|
VERSION=$VERSION linuxdeployqt $DEPLOY_FOLDER/usr/share/applications/com.moonlight_stream.Moonlight.desktop -qmldir=$SOURCE_ROOT/app/gui -appimage || fail "linuxdeployqt failed!"
|
||||||
|
popd
|
||||||
|
|
||||||
|
echo Build successful
|
Loading…
x
Reference in New Issue
Block a user