forked from moonlight-stream/moonlight-qt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-steamlink-app.sh
executable file
·51 lines (42 loc) · 1.45 KB
/
build-steamlink-app.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
BUILD_CONFIG="release"
QT_514_COMMIT="609d4aaccb503298e7fa9cef45e0ddc4c4afd63c"
fail()
{
echo "$1" 1>&2
exit 1
}
if [ "$STEAMLINK_SDK_PATH" == "" ]; then
fail "You must set STEAMLINK_SDK_PATH to build for Steam Link"
fi
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`
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 Initializing Steam Link SDK
source $STEAMLINK_SDK_PATH/setenv.sh || fail "SL SDK initialization failed!"
echo Configuring the project
pushd $BUILD_FOLDER
qmake $SOURCE_ROOT/moonlight-qt.pro QMAKE_CFLAGS_ISYSTEM= || 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 Creating app bundle
mkdir -p $DEPLOY_FOLDER/steamlink/apps/moonlight/bin
cp $BUILD_FOLDER/app/moonlight $DEPLOY_FOLDER/steamlink/apps/moonlight/bin/ || fail "Binary copy failed!"
cp $SOURCE_ROOT/app/deploy/steamlink/* $DEPLOY_FOLDER/steamlink/apps/moonlight/ || fail "Metadata copy failed!"
pushd $DEPLOY_FOLDER
zip -r $INSTALLER_FOLDER/Moonlight-SteamLink-$VERSION.zip . || fail "Zip failed!"
popd
echo Build completed