From ee612d3f39b32b9518bfcc472e872642dfe91981 Mon Sep 17 00:00:00 2001 From: Nathan Anderson Date: Sat, 1 Jun 2024 16:05:40 -0600 Subject: [PATCH] Added flatpak files --- build-flatpak.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ com.rluv.client.yml | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 80 insertions(+) create mode 100644 build-flatpak.sh create mode 100644 com.rluv.client.yml diff --git a/build-flatpak.sh b/build-flatpak.sh new file mode 100644 index 0000000..9c17fa7 --- /dev/null +++ b/build-flatpak.sh @@ -0,0 +1,45 @@ +#!/usr/env/bash + + +# Convert the archive of the Flutter app to a Flatpak. + + +# Exit if any command fails +set -e + +# Echo all commands for debug purposes +set -x + + +# No spaces in project name. +projectName=RluvClient +projectId=com.rluv.client +executableName=rluv + + +# ------------------------------- Build Flatpak ----------------------------- # + +# Extract portable Flutter build. +mkdir -p $projectName +tar -xf $projectName-Linux-Portable.tar.gz -C $projectName + +# Copy the portable app to the Flatpak-based location. +cp -r $projectName /app/ +chmod +x /app/$projectName/$executableName +mkdir -p /app/bin +ln -s /app/$projectName/$executableName /app/bin/$executableName + +# Install the icon. +iconDir=/app/share/icons/hicolor/scalable/apps +mkdir -p $iconDir +cp -r assets/icons/$projectId.svg $iconDir/ + +# Install the desktop file. +desktopFileDir=/app/share/applications +mkdir -p $desktopFileDir +cp -r packaging/linux/$projectId.desktop $desktopFileDir/ + +# Install the AppStream metadata file. +metadataDir=/app/share/metainfo +mkdir -p $metadataDir +cp -r packaging/linux/$projectId.metainfo.xml $metadataDir/ diff --git a/com.rluv.client.yml b/com.rluv.client.yml new file mode 100644 index 0000000..da1b054 --- /dev/null +++ b/com.rluv.client.yml @@ -0,0 +1,35 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/flatpak/flatpak-builder/main/data/flatpak-manifest.schema.json + +--- +app-id: com.rluv.client +runtime: org.freedesktop.Platform +runtime-version: "22.08" +sdk: org.freedesktop.Sdk +command: rluv +separate-locales: false +finish-args: + - --share=ipc + - --socket=fallback-x11 + - --socket=wayland + - --device=dri + - --socket=pulseaudio + - --share=network +modules: + # FlutterApp + - name: FlutterApp + buildsystem: simple + only-arches: + - aarch64 + build-commands: + - "./build-flatpak.sh" + sources: + - type: file + url: https://github.com/Merrit/flutter_flatpak_example/releases/download/v1.0.0/FlutterApp-Linux-Portable.tar.gz + sha256: 5dc57e4f5b84e6527098cb1e011ef50413c660147f5da7dfbfb507527e44eb83 + - type: dir + path: ../rluv-client + # - type: git + # url: https://github.com/Merrit/flutter_flatpak_example.git + # branch: main + - type: file + path: build-flatpak.sh