Skip to content

FEAT(packaging): Flatpak support - #132

Open
SonyCore wants to merge 1 commit into
mainfrom
feat/flatpack
Open

FEAT(packaging): Flatpak support#132
SonyCore wants to merge 1 commit into
mainfrom
feat/flatpack

Conversation

@SonyCore

@SonyCore SonyCore commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@SonyCore
SonyCore requested a review from ja7ad September 5, 2026 18:39
@codecov

codecov Bot commented Sep 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.98%. Comparing base (a7ccf83) to head (84c22a6).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #132      +/-   ##
==========================================
+ Coverage   73.97%   73.98%   +0.01%     
==========================================
  Files          69       69              
  Lines       29154    29157       +3     
==========================================
+ Hits        21567    21573       +6     
+ Misses       7587     7584       -3     
Files with missing lines Coverage Δ
crates/hydra-updater/src/lib.rs 83.21% <100.00%> (+0.05%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SonyCore SonyCore mentioned this pull request Sep 5, 2026
8 tasks
Comment on lines +35 to +38
build-options:
append-path: /usr/lib/sdk/rust-stable/bin
env:
CARGO_HOME: /run/build/hydra/cargo

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

build has no network and no offline sources. For the local make flatpak path add the build-arg; for the Flathub submission generate cargo-sources.json instead (never both — Flathub rejects --share=network):

build-options:
  append-path: /usr/lib/sdk/rust-stable/bin
  build-args:
    - --share=network
  env:
    CARGO_HOME: /run/build/hydra/cargo

- --filesystem=home
# StatusNotifierItem system tray integration
- --talk-name=org.kde.StatusNotifierWatcher
- --own-name=org.kde.StatusNotifierItem-*

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete the line. --own-name=org.kde.StatusNotifierItem-* isn't a valid bus name (flatpak only strips a trailing .*), so build-finish errors out. ksni registers with the watcher under its unique name, so line 22's --talk-name=org.kde.StatusNotifierWatcher is all that's needed.

Terminal=false
Categories=Network;FileTransfer;
Keywords=download;manager;accelerator;torrent;http;metalink;hls;dash;
StartupWMClass=hydra

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

StartupWMClass=io.github.ja7ad.hydra, to match the app id app.rs:1789 now sets.

Name=Hydra Download Manager
GenericName=Download Manager
Comment=Multi-connection download accelerator and manager
Exec=hydra-gui @@u %u @@

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either drop both lines (Exec=hydra-gui, no MimeType), matching packaging/debian/hydra.desktop, or teach main.rs to consume a positional URL. As written the entry claims the hydra: scheme and throws the argument away.

@@ -1786,7 +1786,7 @@ impl App {
// hydra.desktop (scripts/package-linux.sh, install.sh).

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the comment "Must stay equal to the basename of hydra.desktop (scripts/package-linux.sh, install.sh)" is now only half true; add the Flatpak entry to the list it names.

- install -Dm644 README.md /app/share/doc/io.github.ja7ad.hydra/README.md
- install -Dm644 CHANGELOG.md /app/share/doc/io.github.ja7ad.hydra/CHANGELOG.md
sources:
- type: dir

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add skip: [target, .git, build-dir, repo] under the type: dir source.

<binary>hydra-host</binary>
</provides>
<releases>
<release version="0.4.2" date="2026-09-01">

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

date="2026-09-05" per CHANGELOG.md:8, and move the "Flatpak packaging" bullet (:65) to whichever release actually ships it.

Comment thread Makefile
appimage: require-linux
scripts/package-appimage.sh $(ARGS)

# Flatpak build, metadata validation, or bundle generation:

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the header at line 10 promises target/dist/*.flatpak, but bare make flatpak builds without exporting a bundle; either say make flatpak ARGS=--bundle there or default BUNDLE=1 in the script.

@ja7ad

ja7ad commented Sep 6, 2026

Copy link
Copy Markdown
Owner

crates/hydra-gui/src/main.rs:101 (root cause of the /app/bin/hydra-host manifests installed by .yml:49) — skip host registration inside the sandbox, since nmhost.rs:44 resolves a path only valid inside it:

if !hya_updater::is_flatpak() {
    nmhost::ensure_registered();
}

Otherwise a Flatpak launch overwrites the host's working /usr/bin/hydra-host manifest. (Either that, or drop hydra-host from the manifest and document that browser integration needs the native package.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants