diff --git a/.gitignore b/.gitignore index 23236f0..f1c959f 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,7 @@ skills-lock.json # TypeScript incremental build info *.tsbuildinfo + +# Flatpak vendored sources (generated; belong in the flathub repo) +flatpak/cargo-sources.json +flatpak/node-sources.json diff --git a/flatpak/README.md b/flatpak/README.md new file mode 100644 index 0000000..68eb6b2 --- /dev/null +++ b/flatpak/README.md @@ -0,0 +1,68 @@ +# Flathub packaging for Vega + +This directory holds the Flatpak packaging for `com.veganostr.Vega`, built **entirely +from source** (Flathub forbids bundling prebuilt binaries — do **not** use Tauri's +official Flatpak guide, which repackages a `.deb`). + +## Files + +| File | Purpose | Lives in | +|---|---|---| +| `com.veganostr.Vega.yaml` | Flatpak manifest | Flathub PR repo (copy here for reference) | +| `com.veganostr.Vega.metainfo.xml` | AppStream metadata (store page) | this repo, installed from source | +| `com.veganostr.Vega.desktop` | Desktop entry | this repo, installed from source | +| `cargo-sources.json` | Vendored Rust crates (offline build) | generated → Flathub PR repo | +| `node-sources.json` | Vendored npm packages (offline build) | generated → Flathub PR repo | + +## Regenerating the vendored sources (after any dependency bump) + +```bash +# Rust +pip install toml aiohttp +python flatpak-cargo-generator.py -d src-tauri/Cargo.lock -o flatpak/cargo-sources.json + +# npm (lockfile v3) +pipx install git+https://github.com/flatpak/flatpak-builder-tools.git#subdirectory=node +flatpak-node-generator npm -o flatpak/node-sources.json package-lock.json +``` + +The generated sources **must** match the `Cargo.lock` / `package-lock.json` at the git +tag the manifest pins. + +## Validate locally + +```bash +appstreamcli validate flatpak/com.veganostr.Vega.metainfo.xml +desktop-file-validate flatpak/com.veganostr.Vega.desktop +``` + +## Test build (needs ~several GB of SDK) + +```bash +flatpak install flathub org.gnome.Platform//50 org.gnome.Sdk//50 \ + org.freedesktop.Sdk.Extension.rust-stable org.freedesktop.Sdk.Extension.node20 +flatpak install flathub org.flatpak.Builder +git clone https://github.com/flathub/shared-modules.git # for libappindicator +flatpak run org.flatpak.Builder --force-clean --user --install \ + build-dir flatpak/com.veganostr.Vega.yaml +flatpak run com.veganostr.Vega +``` + +## Submitting to Flathub + +1. Fork `github.com/flathub/flathub`, branch off **`new-pr`** (NOT `master`). +2. Add `com.veganostr.Vega.yaml`, `cargo-sources.json`, `node-sources.json`, and the + `shared-modules` submodule at the repo top level. +3. Open a PR against `new-pr`; a reviewer comments `bot, build` to test-build. + +## Open items before submission + +- **Screenshots**: `metainfo.xml` references three PNGs under + `flatpak/screenshots/`. Add real screenshots there and pin the manifest's git + source to a tag/commit that contains them (metainfo screenshot URLs should use a + tag/commit ref, not a branch). +- **`ffmpeg-full` `version:`** must match GNOME 50's freedesktop base — verify at + first `bot, build`. +- **Keyring in the sandbox**: the `keyring` crate uses the Secret Service over D-Bus + (`--talk-name=org.freedesktop.secrets`). Verify nsec survives a sandboxed restart; + if not, the `oo7` crate's file backend is the known fallback. diff --git a/flatpak/com.veganostr.Vega.desktop b/flatpak/com.veganostr.Vega.desktop new file mode 100644 index 0000000..6e298f2 --- /dev/null +++ b/flatpak/com.veganostr.Vega.desktop @@ -0,0 +1,12 @@ +[Desktop Entry] +Type=Application +Name=Vega +GenericName=Nostr Client +Comment=Read, write and zap on the Nostr network +Exec=vega +Icon=com.veganostr.Vega +Terminal=false +Categories=Network;Chat; +Keywords=Nostr;Bitcoin;Lightning;Zap;Social;Decentralized;Microblog;Long-form; +StartupWMClass=Vega +StartupNotify=true diff --git a/flatpak/com.veganostr.Vega.metainfo.xml b/flatpak/com.veganostr.Vega.metainfo.xml new file mode 100644 index 0000000..2deface --- /dev/null +++ b/flatpak/com.veganostr.Vega.metainfo.xml @@ -0,0 +1,81 @@ + + + com.veganostr.Vega + + Vega + Read, write and zap on Nostr + + CC0-1.0 + MIT + + + Jure Sršen + + + com.veganostr.Vega.desktop + + +

+ Vega is a desktop client for Nostr, a decentralized social network where you + own your identity, your content and your social graph. No company can delete + your account or censor your posts. +

+

+ Long-form writing and reading is a first-class feature, not an afterthought. + Alongside the social feed, Vega gives you a proper markdown article editor and + reader for publishing and following long-form content. +

+

Features:

+ +
+ + + intense + mild + + + https://veganostr.com + https://github.com/hoornet/vega/issues + https://github.com/hoornet/vega + + + + https://raw.githubusercontent.com/hoornet/vega/main/flatpak/screenshots/feed.png + The main feed with notes, reactions and zaps + + + https://raw.githubusercontent.com/hoornet/vega/main/flatpak/screenshots/article.png + Reading a long-form article + + + https://raw.githubusercontent.com/hoornet/vega/main/flatpak/screenshots/editor.png + Writing an article in the markdown editor + + + + + #c9b6ff + #2a2140 + + + + + +

Fixes a crash in the Support view and adds an optional network proxy (HTTP/SOCKS5), including Tor.

+
+
+ + +

Internal maintenance release aligning the application identifier with the project domain.

+
+
+
+
diff --git a/flatpak/com.veganostr.Vega.yaml b/flatpak/com.veganostr.Vega.yaml new file mode 100644 index 0000000..fe477bb --- /dev/null +++ b/flatpak/com.veganostr.Vega.yaml @@ -0,0 +1,86 @@ +id: com.veganostr.Vega + +runtime: org.gnome.Platform +runtime-version: "50" +sdk: org.gnome.Sdk +sdk-extensions: + - org.freedesktop.Sdk.Extension.rust-stable + - org.freedesktop.Sdk.Extension.node20 + +command: vega + +finish-args: + - --socket=wayland # show the window (Wayland) + - --socket=fallback-x11 # show the window (X11 fallback) + - --share=ipc # required alongside X11 + - --device=dri # GPU / OpenGL for WebKit + - --socket=pulseaudio # audio: podcasts & media + - --share=network # Nostr relays over WebSocket (runtime only) + - --talk-name=org.freedesktop.Notifications # mentions/zaps notifications + - --talk-name=org.freedesktop.secrets # keyring crate → Secret Service (nsec storage) + - --talk-name=org.kde.StatusNotifierWatcher # system tray + +# GStreamer codecs for AAC/MP3/H.264 podcast & media playback. The base runtime +# only ships open/royalty-free codecs. +add-extensions: + org.freedesktop.Platform.ffmpeg-full: + directory: lib/ffmpeg + add-ld-path: . + version: "24.08" + autodelete: false + +build-options: + append-path: /usr/lib/sdk/node20/bin:/usr/lib/sdk/rust-stable/bin + env: + # Speed up and pin the offline caches inside the build dir. + CARGO_HOME: /run/build/vega/cargo + +modules: + - shared-modules/libappindicator/libappindicator-gtk3-12.10.json + + - name: vega + buildsystem: simple + sources: + - type: git + url: https://github.com/hoornet/vega.git + tag: v0.14.1 + commit: e0a7c2e1a4368e22b6ca6982d02857ed65d8ef51 + + # flatpak-node-generator npm -o node-sources.json package-lock.json + - node-sources.json + + # flatpak-cargo-generator.py -d ./src-tauri/Cargo.lock -o cargo-sources.json + - cargo-sources.json + + build-options: + env: + XDG_CACHE_HOME: /run/build/vega/flatpak-node/cache + npm_config_cache: /run/build/vega/flatpak-node/npm-cache + npm_config_offline: "true" + + build-commands: + # Install vendored npm packages (offline) + - npm ci --offline + # Pre-fetch vendored crates (offline) + - cargo --offline fetch --manifest-path src-tauri/Cargo.toml + # Build frontend (vite) + the Rust binary, without producing an installer bundle + - npm run --offline tauri build -- --no-bundle + + # Binary + - install -Dm755 -t /app/bin/ src-tauri/target/release/vega + + # Desktop entry + AppStream metainfo + - install -Dm644 -t /app/share/applications/ flatpak/com.veganostr.Vega.desktop + - install -Dm644 -t /app/share/metainfo/ flatpak/com.veganostr.Vega.metainfo.xml + + # Icons (hicolor) + - install -Dm644 src-tauri/icons/32x32.png /app/share/icons/hicolor/32x32/apps/com.veganostr.Vega.png + - install -Dm644 src-tauri/icons/128x128.png /app/share/icons/hicolor/128x128/apps/com.veganostr.Vega.png + - install -Dm644 src-tauri/icons/128x128@2x.png /app/share/icons/hicolor/256x256/apps/com.veganostr.Vega.png + - install -Dm644 src-tauri/icons/icon.png /app/share/icons/hicolor/512x512/apps/com.veganostr.Vega.png + + # Create the ffmpeg extension mount point + - mkdir -p /app/lib/ffmpeg + + post-install: + - install -Dm644 LICENSE /app/share/licenses/com.veganostr.Vega/LICENSE