-
Notifications
You must be signed in to change notification settings - Fork 6
#115 Flatpak packaging for Bazzite/SteamOS #148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
12afc19
Initial plan
Copilot 1cf2f2e
Add Flatpak packaging support for Bazzite/SteamOS
Copilot 10ff075
Fix Flatpak cleanup: use rm -rf instead of Ant delete for build dirs
Copilot 14e0a1c
Add --runtime-repo to flatpak build-bundle so missing runtime is fetc…
Copilot 937370b
Add INSTALL.md to flatpak artifact with correct install instructions
Copilot 812c6d5
Remove --runtime-repo flag; add explicit runtime install step to INST…
Copilot ef97ec7
#115 Improve Flatpak build process with a version-agnostic staging di…
jamesmarkchan e261392
#115 chore: Update Flatpak runtime and OpenJDK SDK extension versions…
jamesmarkchan 9f78438
#115 ignore flatpak-repo
jamesmarkchan 0e2be71
Potential fix for pull request finding
jamesmarkchan e4e7310
Align CI workflow and docs to use Freedesktop Platform 25.08 + OpenJD…
Copilot f4c42e3
Potential fix for pull request finding
jamesmarkchan e88bed9
#115 update readme
jamesmarkchan 74d758c
#115 include -pre-jar to ensure version info is present
jamesmarkchan 728f86c
Include version in CI artifact name: jdiskmark-flatpak-<version>
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| name: Flatpak Build | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ "dev", "release/**", "main" ] | ||
| pull_request: | ||
| branches: [ "dev", "release/**" ] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build-flatpak: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Checkout Repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up JDK 25 | ||
| uses: actions/setup-java@v4 | ||
| with: | ||
| java-version: '25' | ||
| distribution: 'oracle' | ||
|
|
||
| - name: Cache Ant Dependencies | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: libs | ||
| key: ${{ runner.os }}-ant-${{ hashFiles('build.xml') }} | ||
| restore-keys: | | ||
| ${{ runner.os }}-ant- | ||
|
|
||
| - name: Install Build Dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y ant ant-optional flatpak flatpak-builder | ||
|
|
||
| - name: Add Flathub Remote | ||
| run: | | ||
| flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo | ||
|
|
||
| - name: Install Flatpak Runtime and SDK | ||
| run: | | ||
| flatpak install --user --noninteractive flathub \ | ||
| org.freedesktop.Platform//24.08 \ | ||
| org.freedesktop.Sdk//24.08 \ | ||
| org.freedesktop.Sdk.Extension.openjdk21//24.08 | ||
|
|
||
| - name: Build Flatpak Bundle | ||
| # Compile to Java 21 bytecode so the bundled JRE 21 can load the classes. | ||
| # JDK 25 fully supports targeting older release levels via -source/-target. | ||
| run: ant -Djavac.source=21 -Djavac.target=21 create-flatpak | ||
|
|
||
| - name: Copy Install Instructions into dist/ | ||
| run: cp pkg/flatpak/INSTALL.md dist/INSTALL.md | ||
|
|
||
| - name: Upload Flatpak Bundle | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: jdiskmark-flatpak | ||
| path: | | ||
| dist/*.flatpak | ||
| dist/INSTALL.md | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # Installing JDiskMark Flatpak | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| Flatpak must be installed on your system. If you are on a gaming-oriented distro such | ||
| as Bazzite or SteamOS, Flatpak and Flathub are already configured by default. | ||
|
|
||
| ### 1. Add Flathub (if not already configured) | ||
|
|
||
| On Ubuntu / Debian: | ||
|
|
||
| ```sh | ||
| flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | ||
| ``` | ||
|
|
||
| ### 2. Install the required runtime | ||
|
|
||
| The bundle requires the `org.freedesktop.Platform 24.08` runtime from Flathub. | ||
| Install it before installing the bundle: | ||
|
|
||
| ```sh | ||
| flatpak install --user flathub org.freedesktop.Platform//24.08 | ||
|
jamesmarkchan marked this conversation as resolved.
Outdated
|
||
| ``` | ||
|
|
||
| If prompted to install other dependencies, accept them. | ||
|
|
||
| ## Install | ||
|
|
||
| Download `jdiskmark-<version>.flatpak` from the GitHub Actions artifact or release page, then run: | ||
|
|
||
| ```sh | ||
| flatpak install --user ./jdiskmark-<version>.flatpak | ||
| ``` | ||
|
|
||
| > **Note:** Do **not** use `flatpak install --from` — that flag is for `.flatpakref` | ||
| > reference files, not `.flatpak` bundles, and will produce an error. | ||
|
|
||
| ## Run | ||
|
|
||
| After installation, launch JDiskMark from your application menu or from the terminal: | ||
|
|
||
| ```sh | ||
| flatpak run net.jdiskmark.JDiskMark | ||
| ``` | ||
|
|
||
| ## Uninstall | ||
|
|
||
| ```sh | ||
| flatpak uninstall net.jdiskmark.JDiskMark | ||
| ``` | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| #!/bin/sh | ||
| # Launcher script for JDiskMark Flatpak | ||
| CLASSPATH="/app/lib/jdiskmark/jdiskmark.jar:/app/lib/jdiskmark/libs/*" | ||
| exec /app/jre/bin/java -XX:+UseZGC -cp "$CLASSPATH" jdiskmark.App "$@" |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| [Desktop Entry] | ||
| Type=Application | ||
| Name=JDiskMark | ||
| GenericName=Disk Benchmark | ||
| Comment=Measure the read and write performance of your storage devices | ||
| Exec=jdiskmark | ||
| Icon=net.jdiskmark.JDiskMark | ||
| Terminal=false | ||
| Categories=Utility;System; | ||
| Keywords=disk;benchmark;performance;storage;speed; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| <?xml version="1.0" encoding="UTF-8"?> | ||
| <component type="desktop-application"> | ||
| <id>net.jdiskmark.JDiskMark</id> | ||
| <metadata_license>MIT</metadata_license> | ||
| <project_license>Apache-2.0</project_license> | ||
| <name>JDiskMark</name> | ||
| <summary>Measure the read and write performance of your storage devices</summary> | ||
| <description> | ||
| <p>JDiskMark is a cross-platform disk benchmark utility written in Java. | ||
| It provides a simple way to measure the read and write performance of | ||
| storage devices including SSDs, NVMe drives, SD cards, and hard drives.</p> | ||
| <p>It is especially useful for gamers validating SD card and SSD upgrades | ||
| on platforms like Steam Deck, Bazzite, and SteamOS.</p> | ||
| </description> | ||
| <categories> | ||
| <category>Utility</category> | ||
| <category>System</category> | ||
| </categories> | ||
| <url type="homepage">https://github.com/jDiskMark/jdm-java</url> | ||
| <url type="bugtracker">https://github.com/jDiskMark/jdm-java/issues</url> | ||
| <content_rating type="oars-1.1"/> | ||
| <releases> | ||
| <release version="0.7.0" date="2025-01-01"/> | ||
| </releases> | ||
| <provides> | ||
| <binary>jdiskmark</binary> | ||
| </provides> | ||
| </component> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| app-id: net.jdiskmark.JDiskMark | ||
| runtime: org.freedesktop.Platform | ||
| runtime-version: '25.08' | ||
| sdk: org.freedesktop.Sdk | ||
| sdk-extensions: | ||
| - org.freedesktop.Sdk.Extension.openjdk25 | ||
|
jamesmarkchan marked this conversation as resolved.
|
||
|
|
||
| command: jdiskmark | ||
|
|
||
| finish-args: | ||
| # X11 / Wayland display access | ||
| - --share=ipc | ||
| - --socket=x11 | ||
| - --socket=wayland | ||
| # Access to all storage devices for disk benchmarking | ||
| - --device=all | ||
| # Read/write access to the home directory for selecting benchmark paths | ||
| - --filesystem=home | ||
| # Allow access to removable media (SD cards, external drives) | ||
| - --filesystem=/media:rw | ||
| - --filesystem=/run/media:rw | ||
|
|
||
| modules: | ||
| # Install OpenJDK 21 JRE from the SDK extension into /app/jre | ||
| - name: openjdk | ||
| buildsystem: simple | ||
| build-commands: | ||
| - /usr/lib/sdk/openjdk25/install.sh | ||
|
jamesmarkchan marked this conversation as resolved.
Outdated
|
||
|
|
||
| # Package the pre-built JDiskMark JAR and its library dependencies. | ||
| # Run 'ant jar' (or 'ant create-flatpak') before invoking flatpak-builder. | ||
| - name: jdiskmark | ||
| buildsystem: simple | ||
| sources: | ||
| # Main application JAR — built by 'ant jar' prior to flatpak-builder | ||
| - type: file | ||
| path: ../../dist/flatpak-staging/jdiskmark.jar | ||
| # Runtime library dependencies from the libs/ directory | ||
| - type: file | ||
| path: ../../libs/derby.jar | ||
| - type: file | ||
| path: ../../libs/eclipselink.jar | ||
| - type: file | ||
| path: ../../libs/flatlaf-3.7.jar | ||
| - type: file | ||
| path: ../../libs/hibernate-jpamodelgen-jakarta-5.6.15.Final.jar | ||
| - type: file | ||
| path: ../../libs/jackson-annotations-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jackson-core-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jackson-databind-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jackson-dataformat-csv-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jackson-dataformat-yaml-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jackson-datatype-jsr310-2.16.1.jar | ||
| - type: file | ||
| path: ../../libs/jakarta.persistence-api-3.2.0-M1.jar | ||
| - type: file | ||
| path: ../../libs/jakarta.xml.bind-api-4.0.1.jar | ||
| - type: file | ||
| path: ../../libs/javax.annotation-3.1.2.2.jar | ||
| - type: file | ||
| path: ../../libs/jcommon-1.0.21.jar | ||
| - type: file | ||
| path: ../../libs/jfreechart-1.0.17.jar | ||
| - type: file | ||
| path: ../../libs/miglayout-core-11.4.2.jar | ||
| - type: file | ||
| path: ../../libs/miglayout-swing-11.4.2.jar | ||
| - type: file | ||
| path: ../../libs/picocli-4.7.7.jar | ||
| - type: file | ||
| path: ../../libs/snakeyaml-2.2.jar | ||
| # Launcher script, desktop entry, AppStream metadata and icons | ||
| - type: file | ||
| path: jdiskmark.sh | ||
| - type: file | ||
| path: net.jdiskmark.JDiskMark.desktop | ||
| - type: file | ||
| path: net.jdiskmark.JDiskMark.metainfo.xml | ||
| - type: file | ||
| path: net.jdiskmark.JDiskMark.png | ||
| - type: file | ||
| path: net.jdiskmark.JDiskMark.64x64.png | ||
| build-commands: | ||
| # Install application JAR | ||
| - install -Dm644 jdiskmark.jar /app/lib/jdiskmark/jdiskmark.jar | ||
| # Install library JARs | ||
| - install -Dm644 derby.jar /app/lib/jdiskmark/libs/derby.jar | ||
| - install -Dm644 eclipselink.jar /app/lib/jdiskmark/libs/eclipselink.jar | ||
| - install -Dm644 flatlaf-3.7.jar /app/lib/jdiskmark/libs/flatlaf-3.7.jar | ||
| - install -Dm644 hibernate-jpamodelgen-jakarta-5.6.15.Final.jar /app/lib/jdiskmark/libs/hibernate-jpamodelgen-jakarta-5.6.15.Final.jar | ||
| - install -Dm644 jackson-annotations-2.16.1.jar /app/lib/jdiskmark/libs/jackson-annotations-2.16.1.jar | ||
| - install -Dm644 jackson-core-2.16.1.jar /app/lib/jdiskmark/libs/jackson-core-2.16.1.jar | ||
| - install -Dm644 jackson-databind-2.16.1.jar /app/lib/jdiskmark/libs/jackson-databind-2.16.1.jar | ||
| - install -Dm644 jackson-dataformat-csv-2.16.1.jar /app/lib/jdiskmark/libs/jackson-dataformat-csv-2.16.1.jar | ||
| - install -Dm644 jackson-dataformat-yaml-2.16.1.jar /app/lib/jdiskmark/libs/jackson-dataformat-yaml-2.16.1.jar | ||
| - install -Dm644 jackson-datatype-jsr310-2.16.1.jar /app/lib/jdiskmark/libs/jackson-datatype-jsr310-2.16.1.jar | ||
| - install -Dm644 jakarta.persistence-api-3.2.0-M1.jar /app/lib/jdiskmark/libs/jakarta.persistence-api-3.2.0-M1.jar | ||
| - install -Dm644 jakarta.xml.bind-api-4.0.1.jar /app/lib/jdiskmark/libs/jakarta.xml.bind-api-4.0.1.jar | ||
| - install -Dm644 javax.annotation-3.1.2.2.jar /app/lib/jdiskmark/libs/javax.annotation-3.1.2.2.jar | ||
| - install -Dm644 jcommon-1.0.21.jar /app/lib/jdiskmark/libs/jcommon-1.0.21.jar | ||
| - install -Dm644 jfreechart-1.0.17.jar /app/lib/jdiskmark/libs/jfreechart-1.0.17.jar | ||
| - install -Dm644 miglayout-core-11.4.2.jar /app/lib/jdiskmark/libs/miglayout-core-11.4.2.jar | ||
| - install -Dm644 miglayout-swing-11.4.2.jar /app/lib/jdiskmark/libs/miglayout-swing-11.4.2.jar | ||
| - install -Dm644 picocli-4.7.7.jar /app/lib/jdiskmark/libs/picocli-4.7.7.jar | ||
| - install -Dm644 snakeyaml-2.2.jar /app/lib/jdiskmark/libs/snakeyaml-2.2.jar | ||
| # Install launcher wrapper script | ||
| - install -Dm755 jdiskmark.sh /app/bin/jdiskmark | ||
| # Install desktop entry | ||
| - install -Dm644 net.jdiskmark.JDiskMark.desktop /app/share/applications/net.jdiskmark.JDiskMark.desktop | ||
| # Install AppStream metadata | ||
| - install -Dm644 net.jdiskmark.JDiskMark.metainfo.xml /app/share/metainfo/net.jdiskmark.JDiskMark.metainfo.xml | ||
| # Install icons (128x128 and 64x64) | ||
| - install -Dm644 net.jdiskmark.JDiskMark.png /app/share/icons/hicolor/128x128/apps/net.jdiskmark.JDiskMark.png | ||
| - install -Dm644 net.jdiskmark.JDiskMark.64x64.png /app/share/icons/hicolor/64x64/apps/net.jdiskmark.JDiskMark.png | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.