-
Notifications
You must be signed in to change notification settings - Fork 127
/
build-bundle.sh
executable file
·34 lines (28 loc) · 1.03 KB
/
build-bundle.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
#!/bin/bash -xe
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
MANIFEST=com.freerdp.FreeRDP
BUILD_BASE=$(mktemp -d)
if [ $# -gt 0 ];
then
BUILD_BASE=$1
fi
echo "Using $BUILD_BASE as temporary build directory"
REPO=$BUILD_BASE/repo
BUILD=$BUILD_BASE/build
STATE=$BUILD_BASE/state
BUILDER=$(which flatpak-builder)
if [ ! -x "$BUILDER" ];
then
echo "command 'flatpak-builder' could not be found, please install and add to PATH"
exit 1
fi
FLATPAK=$(which flatpak)
if [ ! -x "$FLATPAK" ];
then
echo "command 'flatpak' could not be found, please install and add to PATH"
exit 1
fi
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo --user
flatpak-builder -v --repo=$REPO --state-dir=$STATE $BUILD $SCRIPT_DIR/$MANIFEST.json --force-clean --user --install-deps-from=flathub
flatpak build-bundle -v $REPO $MANIFEST.flatpak $MANIFEST --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
flatpak run --command=flatpak-builder-lint org.flatpak.Builder --exceptions repo $REPO