update flatpak

This commit is contained in:
Denis-Cosmin Nutiu 2024-11-17 22:11:29 +02:00
parent 1d4e451d09
commit fbbf698aea
5 changed files with 30 additions and 20 deletions

3
flatpak/build.sh Executable file
View file

@ -0,0 +1,3 @@
# Script to debug the Flatpak application.
flatpak-builder --user --install --force-clean build-dir dev.nuculabs.ImageTagger.yaml
flatpak run dev.nuculabs.ImageTagger

View file

@ -1,3 +0,0 @@
# Script to debug the Flatpak application.
flatpak-builder --sandbox --user --install --force-clean build-dir dev.nuculabs.ImageTagger.yaml
flatpak run dev.nuculabs.ImageTagger

View file

@ -1,6 +1,6 @@
[Desktop Entry]
Name=ImageTagger
Exec=/app/bin/image/bin/ImageTagger
Exec=/app/bin/ImageTagger/bin/ImageTagger
Terminal=false
Type=Application
Icon=dev.nuculabs.ImageTagger

View file

@ -2,13 +2,15 @@ id: dev.nuculabs.ImageTagger
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
command: /app/bin/image/bin/ImageTagger
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17
command: /app/bin/ImageTagger/bin/ImageTagger
finish-args:
# X11 + XShm access
- --share=ipc
- --socket=fallback-x11
# Wayland access
# - --socket=wayland
- --socket=wayland
# GPU acceleration if needed
- --device=dri
# Needs to save files locally
@ -16,24 +18,31 @@ finish-args:
modules:
- name: ImageTagger
buildsystem: simple
build-options:
env:
PATH: /app/bin:/usr/bin:/usr/lib/sdk/openjdk17/bin
JAVA_HOME: /usr/lib/sdk/openjdk17/jvm/openjdk-17
build-args:
- --share=network
build-commands:
- mkdir -p /app/bin/image/
- cp -R bin /app/bin/image/
- cp -R lib /app/bin/image/
- cp -R conf /app/bin/image/
- cp -R legal /app/bin/image/
- cp -R release /app/bin/image/
- cp prediction.onnx img-ai/src/main/resources/dev/nuculabs/imagetagger/ai/
- cp prediction_categories.txt img-ai/src/main/resources/dev/nuculabs/imagetagger/ai/
- gradle jpackageImage
- mkdir -p /app/bin/
# Copy ImageTagger folder to /app/bin
- ls img-ui/build/jpackage
- cp -R img-ui/build/jpackage/ImageTagger /app/bin/
- ls /app/bin/
# Desktop Integration
- chmod +x /app/bin/image/lib/jexec
- chmod +x /app/bin/image/lib/jspawnhelper
- mkdir -p bin /app/share/{applications,icons/hicolor/512x512/apps,metainfo}
- mv ${FLATPAK_ID}.desktop /app/share/applications/${FLATPAK_ID}.desktop
- mv ${FLATPAK_ID}.png /app/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png
sources:
- type: git
url: https://github.com/dnutiu/ImageTagger
- type: archive
path: ../img-ui/build/distributions/ImageTagger-linux.zip
# url: "https://github.com/dnutiu/ImageTagger/releases/download/v1.3/ImageTagger-linux-1.3.zip"
# sha256: 0f086e6a738b3d59e3d05cce9174316d95886e50278c03e5b452a67fd264ea40
url: https://github.com/dnutiu/ImageTagger/releases/download/v1/AIModels.zip
sha256: "bbe80bf135621897bc6186d8f17b889064717ed3b9951702b33be869e522321c"
- type: file
path: dev.nuculabs.ImageTagger.png
- type: file

View file

@ -49,16 +49,17 @@ To run:
gradlew run
```
### Building the FlatPak
### Building the Flatpak
To build the Flatpak run the following commands:
```shell
gradlew jlinkZip
cd flatpak
flatpak-builder --sandbox --user --install --force-clean build-dir dev.nuculabs.ImageTagger.yaml
./build.sh
```
It will build the flatpak using the latest sources from this repo.
### Building a package (Fedora Example)
To build a package run