From f5074d701953a3ce6006562b14d3d8ba04942c3b Mon Sep 17 00:00:00 2001 From: ErikKalkoken Date: Sun, 28 Jul 2024 16:28:30 +0200 Subject: [PATCH 1/2] Define Categories in meta file --- FyneApp.toml | 8 +++++++- build_appimage.sh | 4 ---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/FyneApp.toml b/FyneApp.toml index 58e0181..7ad8d09 100644 --- a/FyneApp.toml +++ b/FyneApp.toml @@ -5,4 +5,10 @@ Website = "https://github.com/ErikKalkoken/janice" Name = "Janice" ID = "io.github.erikkalkoken.janice" Version = "0.2.1" - Build = 1 + Build = 2 + +[LinuxAndBSD] + GenericName = "JSON viewer" + Categories = ["Utility"] + Comment = "View large JSON files" + Keywords = ["json", "viewer"] diff --git a/build_appimage.sh b/build_appimage.sh index 5a91b77..6855f0c 100755 --- a/build_appimage.sh +++ b/build_appimage.sh @@ -6,7 +6,6 @@ appname="Janice" packagename="janice" appid="io.github.erikkalkoken.janice" -categories="Utility" dest="temp.Appdir" source="temp.Source" @@ -19,9 +18,6 @@ mkdir "$dest" # Extract application files into appdir folder tar xvfJ "$appname".tar.xz -C "$source" -# Add category to desktop file as required by AppImage -sed -i -- "s/;/\nCategories=$categories;/g" "$source/usr/local/share/applications/$appname.desktop" - # Rename desktop file to match AppStream requirements mv "$source/usr/local/share/applications/$appname.desktop" "$source/usr/local/share/applications/$appid.desktop" From 6ccb11c8bc11ad1073cd2671ce6e5a3a7f7cec4a Mon Sep 17 00:00:00 2001 From: ErikKalkoken Date: Mon, 29 Jul 2024 21:10:53 +0200 Subject: [PATCH 2/2] Extract metadata for build script from FyneApp.toml --- .github/workflows/ci-cd.yml | 3 +++ .gitignore | 4 +++- FyneApp.toml | 2 +- build_appimage.sh | 23 ++++++++++++++++++----- 4 files changed, 25 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-cd.yml b/.github/workflows/ci-cd.yml index 131ab89..204c505 100644 --- a/.github/workflows/ci-cd.yml +++ b/.github/workflows/ci-cd.yml @@ -57,6 +57,9 @@ jobs: - name: Package Fyne app run: fyne package -os linux + - name: Build tools + run: go build ./tools/readmetadata + - name: Set version run: | VERSION=${{ github.ref_name }} diff --git a/.gitignore b/.gitignore index 08ff016..972a135 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,6 @@ tools/generate_json/generate_json test*.json temp.*/ profile*.gif -out*.json \ No newline at end of file +out*.json +readmetadata +tomlvalue diff --git a/FyneApp.toml b/FyneApp.toml index 7ad8d09..4062771 100644 --- a/FyneApp.toml +++ b/FyneApp.toml @@ -4,7 +4,7 @@ Website = "https://github.com/ErikKalkoken/janice" Icon = "icon.png" Name = "Janice" ID = "io.github.erikkalkoken.janice" - Version = "0.2.1" + Version = "0.2.2" Build = 2 [LinuxAndBSD] diff --git a/build_appimage.sh b/build_appimage.sh index 6855f0c..06997fd 100755 --- a/build_appimage.sh +++ b/build_appimage.sh @@ -3,12 +3,24 @@ # This script builds an AppImage from a bundeled Fyne app # for x86_64 architectures with AppStream metadata. -appname="Janice" -packagename="janice" -appid="io.github.erikkalkoken.janice" +set -e + +# Custom variables +buildname="janice" + +# Constants dest="temp.Appdir" source="temp.Source" +# get tomlq +wget https://github.com/ErikKalkoken/tomlq/releases/download/v0.1.0/tomlq-0.1.0-linux-amd64.tar.gz -O tomlq.tar.gz +tar xf tomlq.tar.gz +rm tomlq.tar.gz + +# Use variables from fyne metadata +appname=$(./tomlq -p Details.Name FyneApp.toml) +appid=$(./tomlq -p Details.ID FyneApp.toml) + # Initialize appdir folder rm -rf "$source" mkdir "$source" @@ -28,9 +40,10 @@ cp "$appid.appdata.xml" "$dest/usr/share/metainfo" # Create appimage wget -q https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O linuxdeploy chmod +x linuxdeploy -./linuxdeploy --appdir "$dest" -v 2 -o appimage -e "$source/usr/local/bin/$packagename" -d "$source/usr/local/share/applications/$appid.desktop" -i "$source/usr/local/share/pixmaps/$appname.png" +./linuxdeploy --appdir "$dest" -v 2 -o appimage -e "$source/usr/local/bin/$buildname" -d "$source/usr/local/share/applications/$appid.desktop" -i "$source/usr/local/share/pixmaps/$appname.png" # Cleanup rm -rf "$source" rm -rf "$dest" -rm linuxdeploy \ No newline at end of file +rm linuxdeploy +rm tomlq