flatpak packaging

This commit is contained in:
Miraty 2024-05-07 00:30:01 +02:00
parent f3fbee81c0
commit 8531e4d0be
7 changed files with 119 additions and 1 deletions

2
.gitignore vendored
View file

@ -1 +1,3 @@
/target
/.flatpak-builder
/flatpak-sources.json

12
README.md Normal file
View file

@ -0,0 +1,12 @@
# ServNest Client
## Installation
### Flatpak
```shell
flatpak-cargo-generator Cargo.lock -o flatpak-sources.json # Part of Flatpak Builder Tools <https://github.com/flatpak/flatpak-builder-tools/>
flatpak install --user org.gnome.Sdk
flatpak install --user org.freedesktop.Sdk.Extension.rust-stable
flatpak-builder --user --install repo flatpak.yaml --force-clean
```

35
flatpak.yaml Normal file
View file

@ -0,0 +1,35 @@
app-id: re.niv.servnest.client
runtime: org.gnome.Platform
runtime-version: '45'
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
command: sn-client
finish-args:
- --share=network # Connect to ServNest installations
# Display
- --socket=wayland # Wayland
- --socket=fallback-x11 # X11 if Wayland is unavailable
# System integration
- --filesystem=xdg-config/gtk-4.0:ro # Use system theme
# Performance
- --share=ipc # X11 shared memory extension
- --device=dri # Hardware acceleration
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/sn-client/cargo
modules:
- name: sn-client
buildsystem: simple
build-commands:
- cargo --offline fetch --manifest-path Cargo.toml --verbose
- cargo --offline build --release --verbose
- install -Dm755 ./target/release/sn-client -t /app/bin/
- install -Dm644 ./meta/metainfo.xml /app/share/metainfo/${FLATPAK_ID}.metainfo.xml
- install -Dm644 ./meta/entry.desktop /app/share/applications/${FLATPAK_ID}.desktop
- install -Dm644 ./meta/icon.svg /app/share/icons/hicolor/scalable/apps/${FLATPAK_ID}.svg
sources:
- type: dir
path: ./
- flatpak-sources.json

11
meta/entry.desktop Normal file
View file

@ -0,0 +1,11 @@
[Desktop Entry]
Name=ServNest Client
Name[fr]=Client ServNest
Comment=GTK client for ServNest
Comment[fr]=Client GTK pour ServNest
Type=Application
Exec=sn-client
Terminal=false
Categories=Network;Development;GTK;WebDevelopment
StartupNotify=true
Icon=re.niv.servnest.client

6
meta/icon.svg Normal file
View file

@ -0,0 +1,6 @@
<?xml version="1.0"?>
<!-- Empty icon for now -->
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 1 1"
/>

After

Width:  |  Height:  |  Size: 113 B

52
meta/metainfo.xml Normal file
View file

@ -0,0 +1,52 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop-application">
<id>re.niv.servnest.client</id>
<name>ServNest Client</name>
<name xml:lang="fr">Client ServNest</name>
<summary>GTK client for ServNest</summary>
<summary xml:lang="fr">Client GTK pour ServNest</summary>
<url type="homepage">https://servnest.niv.re/</url>
<metadata_license>CC0-1.0</metadata_license>
<description>
<p>
Manage ServNest services through a GTK user interface.
</p>
<p xml:lang="fr">
Gérer les services de ServNest par une interface utilisatrice en GTK.
</p>
</description>
<launchable type="desktop-id">re.niv.servnest.client.desktop</launchable>
<icon type="stock">re.niv.servnest.client</icon>
<categories>
<category>Network</category>
<category>Development</category>
<category>GTK</category>
<category>WebDevelopment</category>
</categories>
<provides>
<binary>sn-client</binary>
</provides>
<requires>
<internet>always</internet>
</requires>
<!-- Generated using https://hughsie.github.io/oars/generate.html -->
<content_rating type="oars-1.1">
<content_attribute id="social-chat">moderate</content_attribute>
<content_attribute id="social-info">mild</content_attribute>
</content_rating>
<developer id="re.niv.miraty">
<name>Miraty</name>
</developer>
</component>

View file

@ -11,7 +11,7 @@ use i18n_embed::{
use i18n_embed_fl::fl;
use rust_embed::RustEmbed;
const APP_ID: &str = "re.niv.servnest.sn-client";
const APP_ID: &str = "re.niv.servnest.client";
#[derive(RustEmbed)]
#[folder = "locales"]