Skip to content

#115 Flatpak packaging for Bazzite/SteamOS#148

Merged
jamesmarkchan merged 15 commits intodevfrom
copilot/create-flatpak-installer
Mar 15, 2026
Merged

#115 Flatpak packaging for Bazzite/SteamOS#148
jamesmarkchan merged 15 commits intodevfrom
copilot/create-flatpak-installer

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

  • Create pkg/flatpak/ directory with Flatpak manifest (net.jdiskmark.JDiskMark.yml)
  • Create AppStream metadata file (net.jdiskmark.JDiskMark.metainfo.xml)
  • Create XDG desktop entry (net.jdiskmark.JDiskMark.desktop)
  • Create launcher shell script (jdiskmark.sh)
  • Add PNG icons from existing macOS ICNS
  • Add create-flatpak ant target to build.xml
  • Create GitHub Actions workflow (.github/workflows/flatpak-build.yml)
  • Fix CI failure: replace Ant <delete> with rm -rf for cleanup of flatpak-build/ and flatpak-repo/ directories (flatpak-builder creates special files like var/run/adduser that Ant cannot delete)
  • Remove --runtime-repo from flatpak build-bundle (the dl.flathub.org CDN returns HTTP 403 when Flatpak tries to auto-fetch the runtime); users must install org.freedesktop.Platform//25.08 from Flathub explicitly before installing the bundle
  • Align CI workflow, Flatpak manifest, and INSTALL.md to consistently use org.freedesktop.Platform//25.08 + org.freedesktop.Sdk.Extension.openjdk25//25.08; removed -Djavac.source=21/-Djavac.target=21 override so the bundle is built with native JDK 25 bytecode
  • Add INSTALL.md to the CI artifact (alongside the .flatpak bundle) documenting the correct three-step install process: add Flathub remote, install the required runtime (org.freedesktop.Platform//25.08), then run flatpak install --user ./jdiskmark<version>.flatpak — and noting that flatpak install --from must not be used with .flatpak bundles
  • Include the project version in the CI artifact name so the downloaded zip is jdiskmark-flatpak-<version>.zip (e.g. jdiskmark-flatpak-0.7.0.zip); version is read dynamically from build.xml so it tracks future releases automatically
Original prompt

This section details on the original issue you should resolve

<issue_title>Flatpak for Bazzit / SteamOS</issue_title>
<issue_description>Bazzite and SteamOS are linux gaming distros that have standardized on the Flatpak format.

A jdiskmark flatpak release would be helpful for gamers because we can help them validate their SD and SSD upgrades or high end NVMe performance.

objectives:

  • create a Flatpak installer that can be used on a distro like Bazzite.
  • create ant targets or maven goals to create and package the Flatpak

create new issues if not done:

  • optional: create a gitlab workflow that will create a flatpak release on commit
  • optional: successful Flathub submission</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Flatpak installer for Bazzit and SteamOS Add Flatpak packaging for Bazzite/SteamOS Mar 6, 2026
@jamesmarkchan
Copy link
Copy Markdown
Member

@copilot please try and resolve the build error that was encountered:
https://github.com/JDiskMark/jdm-java/actions/runs/22759478452/job/66134984705?pr=148

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 7, 2026

@copilot please try and resolve the build error that was encountered:
https://github.com/JDiskMark/jdm-java/actions/runs/22759478452/job/66134984705?pr=148

Fixed in commit 10ff075.

The Flatpak bundle itself built successfully — the failure was only in the cleanup step. flatpak-builder creates special files like var/run/adduser inside the build directory that Ant's <delete> task can't remove. Replaced both <delete dir="..."/> calls with <exec executable="rm"> (rm -rf) which handles those files without issue.

@jamesmarkchan
Copy link
Copy Markdown
Member

jamesmarkchan commented Mar 7, 2026

@copilot the uploaded flatpack from your workflow indicated this error when it was installed:

james@james-Blade:~/Downloads/jdiskmark-flatpak$ flatpak install --user ./jdiskmark-0.7.0.flatpak

Note that the directories 

'/var/lib/flatpak/exports/share'
'/home/james/.local/share/flatpak/exports/share'

are not in the search path set by the XDG_DATA_DIRS environment variable, so
applications installed by Flatpak may not appear on your desktop until the
session is restarted.

error: The application net.jdiskmark.JDiskMark/x86_64/master requires the runtime org.freedesktop.Platform/x86_64/24.08 which was not found

Is this something we should improve in the flatpack or is there something i need to do differently to install?

I have installed flatpak 1.14.6 on Ubuntu 24.04.4 LTS

…hed from Flathub

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 7, 2026

@copilot the uploaded flatpack from your workflow indicated this error when it was installed:

...

This is expected Flatpak behavior — a .flatpak bundle doesn't embed the runtime, so the system needs the org.freedesktop.Platform 24.08 runtime available locally.

Fixed in commit 14e0a1c by adding --runtime-repo=https://dl.flathub.org/repo/ to the flatpak build-bundle command. This embeds the Flathub URL into the bundle's metadata, so Flatpak can automatically offer to fetch the missing runtime from Flathub during install instead of just failing.

After the next CI run, the new bundle should install without that error on any system that has Flathub configured. For Ubuntu where Flathub may not be pre-configured, you can add it first with:

flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

@JasmineRRod
Copy link
Copy Markdown

image

Is this expected? Can we improve the installer?

After reboot, I got this.
image

@jamesmarkchan
Copy link
Copy Markdown
Member

@copilot look at feedback from @JasmineRRod above and advise.

#148 (comment)

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 8, 2026

@copilot look at feedback from @JasmineRRod above and advise.

#148 (comment)

The error @JasmineRRod hit is caused by using the wrong install command. flatpak install --from is for .flatpakref text reference files — not .flatpak bundles. The correct command is:

flatpak install --user ./jdiskmark-0.7.0.flatpak

Fixed in commit 937370b by adding an INSTALL.md to the artifact (alongside the .flatpak bundle) that explains the correct command and common pitfalls. After the next CI run the downloaded zip will include both jdiskmark-0.7.0.flatpak and INSTALL.md.

@jamesmarkchan
Copy link
Copy Markdown
Member

@copilot is this expected behavior?

image

…ALL.md

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 9, 2026

@copilot is this expected behavior?

image

Yes, that 403 is caused by the --runtime-repo=https://dl.flathub.org/repo/ flag I added — Flatpak tries to auto-fetch the runtime directly from the Flathub CDN, but that endpoint returns 403.

Fixed in commit 812c6d5:

  • Removed --runtime-repo from the flatpak build-bundle command in build.xml
  • Updated INSTALL.md to include an explicit prerequisite step — install the runtime from your locally-configured Flathub remote before installing the bundle:
flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install --user flathub org.freedesktop.Platform//24.08
flatpak install --user ./jdiskmark-0.7.0.flatpak

Copy link
Copy Markdown
Contributor

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 and CI automation to build a distributable .flatpak bundle for JDiskMark, targeting gaming-focused Linux distros (e.g., Bazzite/SteamOS).

Changes:

  • Introduces a Flatpak manifest, launcher, desktop entry, AppStream metadata, install docs, and icons under pkg/flatpak/.
  • Adds an Ant create-flatpak target to build a local Flatpak repo and export a single-file bundle.
  • Adds a GitHub Actions workflow to build and upload the Flatpak bundle artifact; updates .gitignore for Flatpak build outputs.

Reviewed changes

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

Show a summary per file
File Description
pkg/flatpak/net.jdiskmark.JDiskMark.yml Flatpak manifest defining runtime/SDK, permissions, and packaging steps.
pkg/flatpak/jdiskmark.sh Wrapper script used as the Flatpak command entrypoint.
pkg/flatpak/net.jdiskmark.JDiskMark.desktop XDG desktop entry for app launch integration.
pkg/flatpak/net.jdiskmark.JDiskMark.metainfo.xml AppStream metadata for software centers.
pkg/flatpak/INSTALL.md User install instructions for the generated .flatpak bundle.
pkg/flatpak/net.jdiskmark.JDiskMark.png 128×128 icon asset for the Flatpak.
pkg/flatpak/net.jdiskmark.JDiskMark.64x64.png 64×64 icon asset for the Flatpak.
build.xml Adds create-flatpak Ant target and Flatpak-related properties.
.github/workflows/flatpak-build.yml CI workflow to build and upload the Flatpak bundle artifact.
.gitignore Ignores Flatpak build/repo artifacts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
…K 25

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jamesmarkchan jamesmarkchan changed the title Add Flatpak packaging for Bazzite/SteamOS #115 Flatpak packaging for Bazzite/SteamOS Mar 14, 2026
@jamesmarkchan
Copy link
Copy Markdown
Member

@copilot the last build created a jdiskmark-flatpak.zip could you rename this generated zip file to include the version so it is jdiskmark-flatpak-<version>.zip

Co-authored-by: jamesmarkchan <6020424+jamesmarkchan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Mar 15, 2026

@copilot the last build created a jdiskmark-flatpak.zip could you rename this generated zip file to include the version so it is jdiskmark-flatpak-<version>.zip

Done in commit 728f86c. A new "Extract Version" step reads the version from build.xml and passes it to the upload step, so the artifact is now named jdiskmark-flatpak-0.7.0 (producing jdiskmark-flatpak-0.7.0.zip). It will update automatically whenever the version property in build.xml changes.

@jamesmarkchan
Copy link
Copy Markdown
Member

flatpak build appears to be working, here is test record:

#115 (comment)

@jamesmarkchan jamesmarkchan marked this pull request as ready for review March 15, 2026 19:46
@jamesmarkchan jamesmarkchan merged commit d70f531 into dev Mar 15, 2026
1 check passed
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.

Flatpak for Bazzit / SteamOS

4 participants