From 2924ebb04405c138941c594a80647cfb28a057a2 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 25 May 2022 22:22:48 +0300 Subject: [PATCH 13/13] Add flatpak packaging See osdn #44463 Signed-off-by: Marko Lindqvist --- Makefile.am | 2 ++ flatpak/build_flatpak.sh | 11 +++++++++++ flatpak/org.freeciv.gtk322.yml | 22 ++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100755 flatpak/build_flatpak.sh create mode 100644 flatpak/org.freeciv.gtk322.yml diff --git a/Makefile.am b/Makefile.am index 56fd7f17f3..4d505fade5 100644 --- a/Makefile.am +++ b/Makefile.am @@ -72,6 +72,8 @@ EXTRA_DIST = autogen.sh \ m4/web-client.m4 \ m4/winsock2.m4 \ m4/testmatic.m4 \ + flatpak/build_flatpak.sh \ + flatpak/org.freeciv.gtk322.yml \ scripts/mapimg2anim \ scripts/setup_auth_server.sh \ scripts/diff_ignore \ diff --git a/flatpak/build_flatpak.sh b/flatpak/build_flatpak.sh new file mode 100755 index 0000000000..163c857ef2 --- /dev/null +++ b/flatpak/build_flatpak.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +FCVER=$(../fc_version) + +if ! flatpak-builder --user --repo=repo --force-clean build org.freeciv.gtk322.yml || + ! flatpak build-update-repo repo || + ! flatpak build-bundle repo "freeciv-gtk3.22-${FCVER}.flatpak" org.freeciv.gtk322 +then + echo "FAILURE" >&2 + exit 1 +fi diff --git a/flatpak/org.freeciv.gtk322.yml b/flatpak/org.freeciv.gtk322.yml new file mode 100644 index 0000000000..6a3507fa47 --- /dev/null +++ b/flatpak/org.freeciv.gtk322.yml @@ -0,0 +1,22 @@ +app-id: org.freeciv.gtk322 +runtime: org.freedesktop.Platform +runtime-version: '21.08' +sdk: org.freedesktop.Sdk +command: freeciv-gtk3.22 +rename-icon: freeciv-client +modules: + - name: freeciv-gtk3.22 + buildsystem: simple + build-commands: + # On git clone, regenerate configure with autogen.sh + - if test -f ./.git && test -x ./autogen.sh ; then ./autogen.sh --no-configure-run ; fi + - mkdir build + - cd build && ../configure --prefix=/app --disable-fcmp --disable-freeciv-manual && make -j$(nproc) && make install + sources: + - type: dir + path: .. +finish-args: + - --socket=x11 + - --share=network + - --socket=pulseaudio + - --filesystem=home -- 2.35.1