Skip to content

Add a flatpak build for linux#70

Merged
TheRealSavi merged 18 commits intoTheRealSavi:mainfrom
marthabo:main
Apr 13, 2026
Merged

Add a flatpak build for linux#70
TheRealSavi merged 18 commits intoTheRealSavi:mainfrom
marthabo:main

Conversation

@marthabo
Copy link
Copy Markdown
Contributor

This pull request adds the workflow and infrastructure for automatic flatpak builds. The app's id is

io.github.therealsavi.iopenpod

because flatpak requires reverse dns app ids. Currently the way of installing the app is through a .flatpak file, however the app can be published on a centralized repo called FlatHub or distributed through a custom repo made with github pages.

Copilot AI review requested due to automatic review settings April 10, 2026 11:28
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds Flatpak packaging support and a CI workflow to build and attach a .flatpak bundle to GitHub Releases for Linux distribution using the reverse-DNS app ID io.github.therealsavi.iOpenPod.

Changes:

  • Introduces a Flatpak manifest plus Desktop Entry and AppStream metadata for io.github.therealsavi.iOpenPod.
  • Adds a wrapper script to launch the PyInstaller one-folder bundle inside the Flatpak sandbox.
  • Adds a GitHub Actions workflow to build the PyInstaller bundle, package it as a Flatpak, checksum it, and upload it to the GitHub Release.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
flatpak/iOpenPod-wrapper.sh Wrapper script to set runtime env vars and exec the bundled PyInstaller binary.
flatpak/io.github.therealsavi.iOpenPod.yml Flatpak manifest that installs a pre-built dist/iOpenPod bundle plus icons/desktop/metainfo.
flatpak/io.github.therealsavi.iOpenPod.metainfo.xml AppStream metadata for store/display integration.
flatpak/io.github.therealsavi.iOpenPod.desktop Desktop entry for launching the app in desktop environments.
.github/workflows/flatpak.yml CI workflow to build and upload the Flatpak bundle on tag pushes.

Comment on lines +4 to +7
BUNDLE=/app/lib/iOpenPod
export LD_LIBRARY_PATH="$BUNDLE/_internal:$BUNDLE/_internal/Qt/lib:${LD_LIBRARY_PATH:-}"
export QT_PLUGIN_PATH="$BUNDLE/_internal/plugins:${QT_PLUGIN_PATH:-}"
exec "$BUNDLE/iOpenPod" "$@"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The wrapper sets LD_LIBRARY_PATH and QT_PLUGIN_PATH, but it doesn’t mirror the Linux AppImage launcher used in .github/workflows/release.yml (which also adds _internal/lib and sets QML2_IMPORT_PATH). If any Qt/QML components or bundled shared libs are under those paths, the Flatpak may fail to start or miss plugins. Consider aligning the environment variables with the AppImage AppRun so both packaging formats behave consistently.

Copilot uses AI. Check for mistakes.
Comment on lines +43 to +45
<releases>
<release version="1.0.41" date="2026-04-10"/>
</releases>
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The AppStream release version is hard-coded to 1.0.41, but pyproject.toml currently declares version 1.0.43. This mismatch can confuse users and stores (and may cause validation failures in some tooling). Update the metainfo to match the current release version, or generate/sync this value as part of the release process.

Copilot uses AI. Check for mistakes.
Comment on lines +21 to +36
finish-args:
# Qt needs shared memory for IPC between processes.
- --share=ipc
# Allow the app to open an X11 window.
- --socket=x11
# Allow the app to open a Wayland window.
- --socket=wayland
# Give the app access to all host devices, including USB (for iPod).
- --device=all
# Allow outbound network access (podcast downloads, artwork, update checks).
- --share=network
# Allow read/write access to the user's home directory (music library).
- --filesystem=home
# Common iPod mount points on Linux.
- --filesystem=/media
- --filesystem=/run/media
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

finish-args currently grants very broad host access (--device=all and --filesystem=home). This increases the sandbox escape surface and will likely block Flathub acceptance. If possible, narrow these to the minimum required (e.g., --filesystem=xdg-music and specific mount points, and only the device access actually needed for iPod sync) and document why any broad permissions are required.

Copilot uses AI. Check for mistakes.
Comment on lines +3 to +7
# This manifest wraps the pre-built PyInstaller bundle produced by the
# release workflow — it does NOT build iOpenPod from Python source inside
# the Flatpak SDK. The bundle directory (dist/iOpenPod/) must already
# exist when flatpak-builder is invoked; the GitHub Actions workflow takes
# care of building it first.
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

The manifest is designed to wrap a pre-built dist/iOpenPod directory (type: dir source) rather than building from source inside the Flatpak SDK. That approach generally isn’t acceptable for Flathub (which typically requires reproducible source builds and fixed upstream sources). If Flathub publication is a goal (per PR description), consider adding a source-build manifest (or clarify that this manifest is only for GitHub-release .flatpak bundles/custom repos).

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +10
name: Flatpak

on:
push:
tags:
- "v*"

permissions:
contents: write # needed to upload assets to the GitHub Release

Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This workflow triggers on tags (v*) and uploads assets to the GitHub Release, but .github/workflows/release.yml is also triggered on the same tags and creates/uploads the release. Running two independent workflows that both create/update the same release can race and intermittently fail. Consider integrating the Flatpak build into the existing Release workflow (same run), or trigger this workflow via workflow_run after Release completes and only upload once the release exists.

Copilot uses AI. Check for mistakes.
@TheRealSavi
Copy link
Copy Markdown
Owner

are you marta in the discord?

also, i have some questions about your experience with the compiled version of the software. i know that users sometimes have to download some odds and ends to get it working, i think to do with pyqt6?

i dont have a linux distro installed at the moment and just test on mac and linux and rely on community to let me know if linux is working.

Ill get a linux distro going this week so i can be more proactive about it.

@TheRealSavi
Copy link
Copy Markdown
Owner

i notice it has 1.0.41 hardcoded, is there a way to get that to match the actual version automatically? or will it need changed each version?

@marthabo
Copy link
Copy Markdown
Contributor Author

are you marta in the discord?

yes

users sometimes have to download some odds and ends to get it working, i think to do with pyqt6?

Dependencies on Linux are a mess. For the best compatibility, the binary should be compiled on the same system it will be run on. It's then built against system dependencies and generally should work. AppImages allow you to easily bundle dependencies in the same way Mac programs are packaged in .app files. The best solution for compatibility across distros is Flatpak because it makes the program run in a sandbox built with a common runtime that's required to be installed on the user's computer. Flatpak handles this all automatically, installing the correct runtime with the program. I think it would be best to remove the Linux binary release and keep Flatpak, AppImage, and AUR as the recommended methods. If someone doesn't want to use these, they are usually knowledgeable enough to build it themselves from source.

i notice it has 1.0.41 hardcoded, is there a way to get that to match the actual version automatically? or will it need changed each version?

I made the Flatpak build action get the release tag and update the metadata automatically upon running. It also runs after the release workflow ends because it sometimes doesn't detect the tag correctly.

@TheRealSavi
Copy link
Copy Markdown
Owner

thanks for the help and info!

@TheRealSavi TheRealSavi merged commit ee254aa into TheRealSavi:main Apr 13, 2026
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.

4 participants