Prepare Application for Flathub Submission (#64)

* chore(flatpak): prepare application for Flathub submission

- Change Flatpak filesystem permissions from `host` to `home` to comply with Flathub sandbox rules
- Remove `--share=network` build argument and implement offline Rust building using `flatpak-cargo-generator.py`
- Add generated `cargo-sources.json` to the Flatpak manifest to download dependencies
- Update `CARGO_HOME` environment variable to ensure vendored dependencies are found by `cargo build --offline`
- Update `.desktop` categories to meet Flathub specs (`AudioVideo` requirement)
- Add required `<releases>`, `bugtracker`, `vcs-browser` URLs, and valid `<developer>` tags to `metainfo.xml`

Co-authored-by: arabianq <55220741+arabianq@users.noreply.github.com>

* chore(flatpak): prepare application for Flathub submission

- Change Flatpak filesystem permissions from `host` to `home` to comply with Flathub sandbox rules
- Remove `--share=network` build argument and implement offline Rust building using `flatpak-cargo-generator.py`
- Add generated `cargo-sources.json` to the Flatpak manifest to download dependencies
- Explicitly set `CARGO_HOME=$PWD/cargo` in build-commands to ensure vendored dependencies are found by `cargo build --offline`
- Update `.desktop` categories to meet Flathub specs (`AudioVideo` requirement)
- Add required `<releases>`, `bugtracker`, `vcs-browser` URLs, and valid `<developer>` tags to `metainfo.xml`

Co-authored-by: arabianq <55220741+arabianq@users.noreply.github.com>

* chore(flatpak): add script to generate cargo sources

- Added `packages/flatpak/generate-sources.sh` to automate the generation of `cargo-sources.json`
- Script downloads the `flatpak-cargo-generator.py` tool from upstream, generates the offline sources map based on `Cargo.lock`, and cleans up after itself

Co-authored-by: arabianq <55220741+arabianq@users.noreply.github.com>

---------

Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
This commit is contained in:
Tarasov Aleksandr
2026-04-17 19:35:36 +03:00
committed by GitHub
parent 949307fcf8
commit d4d16f6ce7
5 changed files with 6657 additions and 10 deletions
File diff suppressed because it is too large Load Diff
+19
View File
@@ -0,0 +1,19 @@
#!/bin/bash
set -e
if [ ! -f "Cargo.lock" ]; then
echo "Error: Cargo.lock not found. Please run this script from the project root."
return 1
fi
echo "Downloading flatpak-cargo-generator.py..."
curl -sLO https://raw.githubusercontent.com/flatpak/flatpak-builder-tools/master/cargo/flatpak-cargo-generator.py
chmod +x flatpak-cargo-generator.py
echo "Generating cargo-sources.json..."
python3 flatpak-cargo-generator.py Cargo.lock -o packages/flatpak/cargo-sources.json
echo "Cleaning up..."
rm flatpak-cargo-generator.py
echo "Successfully generated packages/flatpak/cargo-sources.json"
+1 -1
View File
@@ -5,5 +5,5 @@ Exec=pwsp-wrapper.py %u
Icon=ru.arabianq.pwsp Icon=ru.arabianq.pwsp
Terminal=false Terminal=false
Type=Application Type=Application
Categories=Audio;Utility; Categories=AudioVideo;Audio;
Keywords=soundpad;pipewire;audio; Keywords=soundpad;pipewire;audio;
@@ -15,11 +15,17 @@
<launchable type="desktop-id">ru.arabianq.pwsp.desktop</launchable> <launchable type="desktop-id">ru.arabianq.pwsp.desktop</launchable>
<screenshots> <screenshots>
<screenshot type="default"> <screenshot type="default">
<image> <image>https://raw.githubusercontent.com/arabianq/pipewire-soundpad/master/assets/screenshot.png</image>
https://raw.githubusercontent.com/arabianq/pipewire-soundpad/master/assets/screenshot.png</image>
</screenshot> </screenshot>
</screenshots> </screenshots>
<url type="homepage">https://pwsp.arabianq.ru</url> <url type="homepage">https://pwsp.arabianq.ru</url>
<developer_name>arabian</developer_name> <url type="bugtracker">https://github.com/arabianq/pipewire-soundpad/issues</url>
<url type="vcs-browser">https://github.com/arabianq/pipewire-soundpad</url>
<developer id="ru.arabianq">
<name>arabian</name>
</developer>
<releases>
<release version="1.7.2" date="2025-01-01" />
</releases>
<content_rating type="oars-1.1" /> <content_rating type="oars-1.1" />
</component> </component>
+3 -6
View File
@@ -14,10 +14,9 @@ finish-args:
- --filesystem=xdg-run/pipewire-0 - --filesystem=xdg-run/pipewire-0
- --filesystem=xdg-run/pwsp:create - --filesystem=xdg-run/pwsp:create
- --filesystem=xdg-run/app/ru.arabianq.pwsp:create - --filesystem=xdg-run/app/ru.arabianq.pwsp:create
- --filesystem=host - --filesystem=home
- --device=all - --device=all
- --device=dri - --device=dri
- --share=network
- --talk-name=org.freedesktop.portal.Desktop - --talk-name=org.freedesktop.portal.Desktop
- --talk-name=org.freedesktop.portal.Documents - --talk-name=org.freedesktop.portal.Documents
@@ -30,11 +29,8 @@ build-options:
modules: modules:
- name: pwsp - name: pwsp
buildsystem: simple buildsystem: simple
build-options:
build-args:
- --share=network
build-commands: build-commands:
- cargo build --release - export CARGO_HOME=$PWD/cargo && cargo build --release --offline
- install -Dm755 target/release/pwsp-daemon /app/bin/pwsp-daemon - install -Dm755 target/release/pwsp-daemon /app/bin/pwsp-daemon
- install -Dm755 target/release/pwsp-cli /app/bin/pwsp-cli - install -Dm755 target/release/pwsp-cli /app/bin/pwsp-cli
- install -Dm755 target/release/pwsp-gui /app/bin/pwsp-gui - install -Dm755 target/release/pwsp-gui /app/bin/pwsp-gui
@@ -45,3 +41,4 @@ modules:
sources: sources:
- type: dir - type: dir
path: ../../ path: ../../
- cargo-sources.json