diff --git a/.gitignore b/.gitignore index 2616f94e70..23d04ed5ff 100644 --- a/.gitignore +++ b/.gitignore @@ -182,8 +182,8 @@ desktopApp/packaging/appimage/squashfs-root/ # flatpak-builder state/cache from local builds (CI uses --state-dir under desktopApp/build/) .flatpak-builder/ -desktopApp/packaging/flatpak/build-dir/ -desktopApp/packaging/flatpak/repo/ +desktopApp/packaging/flatpak/**/build-dir/ +desktopApp/packaging/flatpak/**/repo/ # Git worktrees .worktrees/ diff --git a/desktopApp/packaging/flatpak/README.md b/desktopApp/packaging/flatpak/README.md index c732506f48..552fba7e42 100644 --- a/desktopApp/packaging/flatpak/README.md +++ b/desktopApp/packaging/flatpak/README.md @@ -6,10 +6,10 @@ used two ways: 1. **Release CI** (`.github/workflows/create-release.yml`, `linux-portable` leg) builds a single-file bundle from it on every tag and attaches it to the GitHub Release as `amethyst-desktop--linux-x64.flatpak`. -2. **Flathub submission** (future) — the same manifest is the starting - point, but Flathub requires building from downloadable sources instead of - the local `type: dir` tree, so it will need a source rewrite at - submission time. +2. **Flathub submission** — the `flathub/` subdirectory holds a + submission-ready variant that builds from the published GitHub Release + tarball (Flathub's build servers must fetch sources themselves; the + local `type: dir` tree used by CI is not allowed there). ## Files @@ -24,6 +24,12 @@ used two ways: - `com.vitorpamplona.amethyst.Desktop.desktop` — XDG desktop entry - `icons/512/com.vitorpamplona.amethyst.Desktop.png` — 512x512 icon (copy of `desktopApp/src/jvmMain/resources/icon.png`) +- `flathub/` — self-contained, copy-ready Flathub submission dir: its own + manifest (archive source pinned to the release tarball URL + sha256, with + `x-checker-data` so Flathub's update bot bumps it), its own metainfo + (carries the permanent `` history Flathub requires), desktop + entry, icon, and `flathub.json` (`only-arches: x86_64` — we publish no + aarch64 tarball, and jpackage can't cross-compile one) ## Local build @@ -70,16 +76,28 @@ from Flathub automatically on the user's machine. ## Submission to Flathub -Follow https://docs.flathub.org/docs/for-app-authors/submission +Follow https://docs.flathub.org/docs/for-app-authors/submission — no +separate Flathub account exists; everything runs through GitHub PRs. + +**Remaining blocker before submitting:** at least one screenshot with a +publicly reachable URL in `flathub/….metainfo.xml` (the Flathub linter +rejects the current empty placeholder). 1. Fork `flathub/flathub` on GitHub. 2. Branch from `new-pr` (NOT `master`). -3. Copy this manifest + AppStream + desktop into a new directory matching - the app id, and rework the `type: dir` source into a - buildable-from-source or downloadable-artifact form per Flathub policy. +3. Copy the contents of `flathub/` verbatim into a new top-level directory + named `com.vitorpamplona.amethyst.Desktop`. 4. Open a PR titled "Add com.vitorpamplona.amethyst.Desktop". -5. After merge, a per-app repo is created with write access for ongoing - updates. +5. After merge, Flathub creates a per-app repo + (`flathub/com.vitorpamplona.amethyst.Desktop`) with write access for + ongoing updates. Its `x-checker-data` makes + flatpak-external-data-checker open update PRs there automatically on + each new GitHub Release (bumping url/sha256 and appending the metainfo + `` entry). + +To test the Flathub variant locally, run the same flatpak-builder commands +as above from inside `flathub/` — it downloads the pinned release tarball +instead of using a local Gradle build. ## License metadata diff --git a/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.desktop b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.desktop new file mode 100644 index 0000000000..cc52ce21e4 --- /dev/null +++ b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.desktop @@ -0,0 +1,9 @@ +[Desktop Entry] +Type=Application +Name=Amethyst Desktop +Comment=Nostr client for desktop +Categories=Network;InstantMessaging; +Exec=amethyst-desktop +Icon=com.vitorpamplona.amethyst.Desktop +Terminal=false +StartupWMClass=Amethyst diff --git a/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.metainfo.xml b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.metainfo.xml new file mode 100644 index 0000000000..a203d09e68 --- /dev/null +++ b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.metainfo.xml @@ -0,0 +1,52 @@ + + + com.vitorpamplona.amethyst.Desktop + CC0-1.0 + MIT AND LGPL-2.1-or-later AND BSD-2-Clause AND Apache-2.0 + Amethyst Desktop + Nostr client for desktop + + +

+ Amethyst Desktop is a desktop client for the Nostr protocol. + Browse feeds, post notes, send zaps (Lightning Network), and + participate in NIP-53 live audio rooms. +

+
+ + com.vitorpamplona.amethyst.Desktop.desktop + + https://github.com/vitorpamplona/amethyst + https://github.com/vitorpamplona/amethyst/issues + https://github.com/vitorpamplona/amethyst + + + Vitor Pamplona + + + + + + Network + InstantMessaging + + + + + + + + + + +
diff --git a/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.yml b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.yml new file mode 100644 index 0000000000..54faa72fe1 --- /dev/null +++ b/desktopApp/packaging/flatpak/flathub/com.vitorpamplona.amethyst.Desktop.yml @@ -0,0 +1,98 @@ +# Flathub submission manifest for Amethyst Desktop. +# +# Unlike ../com.vitorpamplona.amethyst.Desktop.yml (which packages the locally +# built tree for release CI), this variant builds from the published GitHub +# Release tarball — Flathub's build servers must be able to fetch every source +# themselves. This directory is copy-ready: everything in it (manifest, +# metainfo, desktop entry, icon, flathub.json) is exactly what gets committed +# to the flathub per-app repo at submission time. +# +# Update flow after each Amethyst release: bump url + sha256 on the archive +# source and append a entry to the metainfo. The x-checker-data +# block below lets Flathub's flatpak-external-data-checker bot do both +# automatically once the app is published. + +app-id: com.vitorpamplona.amethyst.Desktop +runtime: org.freedesktop.Platform +runtime-version: '24.08' +sdk: org.freedesktop.Sdk +command: amethyst-desktop + +add-extensions: + org.freedesktop.Platform.ffmpeg-full: + directory: lib/ffmpeg + version: '24.08' + add-ld-path: . + autodownload: true + autodelete: false + +cleanup-commands: + - mkdir -p /app/lib/ffmpeg + +finish-args: + - --share=network + - --share=ipc + # Compose Desktop renders through AWT/skiko, which is X11-only on Linux + # (runs under XWayland on Wayland sessions). fallback-x11 + wayland would + # leave the app without a usable display socket on Wayland sessions, so + # grant x11 unconditionally. + - --socket=x11 + - --socket=pulseaudio + - --device=dri + - --filesystem=xdg-download + - --filesystem=xdg-pictures + - --talk-name=org.freedesktop.Notifications + - --talk-name=org.freedesktop.secrets + # GStreamer plugin/cache paths (org.freedesktop.Platform exposes them by default). + - --env=GST_PLUGIN_SYSTEM_PATH=/usr/lib/x86_64-linux-gnu/gstreamer-1.0 + +# No openjdk module / sdk-extension: the jpackage tree in the release tarball +# already bundles its own trimmed JRE under Amethyst/lib/runtime/. +modules: + - name: amethyst-desktop + buildsystem: simple + build-commands: + # Drop the jpackage-emitted self-contained tree into /app/lib/Amethyst. + # Wrapper at /app/bin/amethyst-desktop forwards args. + - mkdir -p /app/lib/Amethyst + - cp -r ./Amethyst/* /app/lib/Amethyst/ + - install -Dm755 amethyst-desktop.sh /app/bin/amethyst-desktop + - install -Dm644 com.vitorpamplona.amethyst.Desktop.metainfo.xml -t /app/share/metainfo/ + - install -Dm644 com.vitorpamplona.amethyst.Desktop.desktop -t /app/share/applications/ + - install -Dm644 icons/512/com.vitorpamplona.amethyst.Desktop.png -t /app/share/icons/hicolor/512x512/apps/ + sources: + # jpackage self-contained tree published by release CI. The tarball + # carries a single Amethyst/ top-level dir — keep it (strip-components + # defaults to 1, which would flatten it away). + - type: archive + url: https://github.com/vitorpamplona/amethyst/releases/download/v1.12.6/amethyst-desktop-1.12.6-linux-x64.tar.gz + sha256: 42250027857b37f184ebca52bf6124ff6524be4bc15fedf819e4acaca8bc9538 + strip-components: 0 + # flatpak-external-data-checker: watches GitHub Releases and opens + # update PRs against the flathub repo (bumps url/sha256 above and, + # via is-main-source, appends the entry to the metainfo). + x-checker-data: + type: json + is-main-source: true + url: https://api.github.com/repos/vitorpamplona/amethyst/releases/latest + version-query: .tag_name | sub("^v"; "") + timestamp-query: .published_at + url-query: '"https://github.com/vitorpamplona/amethyst/releases/download/" + + .tag_name + "/amethyst-desktop-" + (.tag_name | sub("^v"; "")) + + "-linux-x64.tar.gz"' + + - type: script + dest-filename: amethyst-desktop.sh + commands: + - "#!/bin/sh" + - exec /app/lib/Amethyst/bin/Amethyst "$@" + + - type: file + path: com.vitorpamplona.amethyst.Desktop.metainfo.xml + + - type: file + path: com.vitorpamplona.amethyst.Desktop.desktop + + - type: dir + path: icons + dest: icons diff --git a/desktopApp/packaging/flatpak/flathub/flathub.json b/desktopApp/packaging/flatpak/flathub/flathub.json new file mode 100644 index 0000000000..c75b742acf --- /dev/null +++ b/desktopApp/packaging/flatpak/flathub/flathub.json @@ -0,0 +1,3 @@ +{ + "only-arches": ["x86_64"] +} diff --git a/desktopApp/packaging/flatpak/flathub/icons/512/com.vitorpamplona.amethyst.Desktop.png b/desktopApp/packaging/flatpak/flathub/icons/512/com.vitorpamplona.amethyst.Desktop.png new file mode 100644 index 0000000000..ffe89a16f0 Binary files /dev/null and b/desktopApp/packaging/flatpak/flathub/icons/512/com.vitorpamplona.amethyst.Desktop.png differ