From fc887196e5bc5ae9c6f607d583ea97f76a6ae595 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 21 Sep 2022 15:29:50 +0200 Subject: [PATCH] Add flatpak bundle build script * Builds the flatpak manifest (uses a temporary directory for intermediate files) * Bundles the flatpak and writes it to the current directory --- packaging/flatpak/build-bundle.sh | 32 +++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100755 packaging/flatpak/build-bundle.sh diff --git a/packaging/flatpak/build-bundle.sh b/packaging/flatpak/build-bundle.sh new file mode 100755 index 000000000..3afb9c33d --- /dev/null +++ b/packaging/flatpak/build-bundle.sh @@ -0,0 +1,32 @@ +#!/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-builder -v --repo=$REPO --state-dir=$STATE $BUILD $SCRIPT_DIR/$MANIFEST.json --force-clean +flatpak build-bundle -v $REPO $MANIFEST.flatpak $MANIFEST --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo