Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .github/workflows/flatpak-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
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//25.08 \
org.freedesktop.Sdk//25.08 \
org.freedesktop.Sdk.Extension.openjdk25//25.08

- name: Extract Version
id: version
run: |
VERSION=$(grep -oP '(?<=<property name="version" value=")[^"]+' build.xml | head -1)
echo "value=$VERSION" >> "$GITHUB_OUTPUT"

- name: Build Flatpak Bundle
run: ant 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-${{ steps.version.outputs.value }}
path: |
dist/*.flatpak
dist/INSTALL.md

7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,9 @@ jdiskmark-deb

# rpm packaging
jdiskmark.spec
temp_resources
temp_resources

# flatpak
flatpak-repo
.flatpak-builder
flatpak-staging
18 changes: 14 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,19 @@ To install use `sudo rpm -i jdiskmark-<rpm.version>.x86_64.rpm` and to remove us

Note: the `rpm.version` is similar to the `version` but replaces hyphens with periods.

### Flatpak Installer (.flatpak)

The flatpak installer is a universal linux package that can be used on many distributions.

To install download the `jdiskmark-<version>.flatpak` file and run:
`flatpak install --user ./jdiskmark-<version>.flatpak`

To run:
`flatpak run net.jdiskmark.JDiskMark`

To remove:
`flatpak uninstall net.jdiskmark.JDiskMark`

### Zip Archive (.zip)

The zip distribution does not require admin for installing but does require
Expand Down Expand Up @@ -208,6 +221,7 @@ Source is available on our [github repo](https://github.com/JDiskMark/jdm-java/)
- TODO: #118 test interlock or OAuth upload

### v0.7.0
- #115 flatpak installer
- #134 zgc optimization
- #44 gui benchmark export for json, yml, csv
- #67 rename sample fields `bwt` > `bt`, `lat` > `lt`
Expand Down Expand Up @@ -307,10 +321,6 @@ Source is available on our [github repo](https://github.com/JDiskMark/jdm-java/)
- IOPS charts, review potential charts
- help that describes features and controls

## issues
- read&write not consistant with order caps
- bottom margins between table to bar to window edge should be the same

## Windows Paths Examples for Building

For ant builds
Expand Down
62 changes: 62 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -486,4 +486,66 @@ Categories=Utility;System;</echo>
<arg value="${pkg.name}" />
</exec>
</target>

<!-- Flatpak packaging properties -->
<property name="flatpak.manifest.dir" value="pkg/flatpak"/>
<property name="flatpak.app.id" value="net.jdiskmark.JDiskMark"/>
<property name="flatpak.build.dir" value="flatpak-build"/>
<property name="flatpak.repo.dir" value="flatpak-repo"/>
<property name="flatpak.bundle.file" value="dist/${pkg.name}-${version}.flatpak"/>
<property name="flatpak.staging.dir" value="dist/flatpak-staging"/>

<target name="create-flatpak" depends="clean, -pre-jar, jar, -post-jar, -prepare-jpackage-input-jar"
description="Build Flatpak bundle using flatpak-builder">
<condition property="is.linux">
<os name="Linux"/>
</condition>
<fail unless="is.linux" message="The create-flatpak target can only be run on Linux."/>

<!-- Verify flatpak-builder is available -->
<exec executable="which" failonerror="true" outputproperty="flatpak.builder.path">
<arg value="flatpak-builder"/>
</exec>

<!-- Ensure the dist output directory exists -->
<mkdir dir="dist"/>

<!-- Prepare a version-agnostic staging directory for the flatpak builder -->
<delete dir="${flatpak.staging.dir}" failonerror="false"/>
<mkdir dir="${flatpak.staging.dir}"/>
<copy file="dist/${release.dir}/${pkg.name}.jar" tofile="${flatpak.staging.dir}/jdiskmark.jar" failonerror="true"/>

<!-- Run flatpak-builder to assemble the Flatpak from the manifest -->
<exec executable="flatpak-builder" failonerror="true">
<arg value="--user"/>
<arg value="--install-deps-from=flathub"/>
<arg value="--assumeyes"/>
<arg value="--force-clean"/>
<arg value="--repo=${flatpak.repo.dir}"/>
<arg value="${flatpak.build.dir}"/>
<arg value="${flatpak.manifest.dir}/${flatpak.app.id}.yml"/>
</exec>

<!-- Export a single-file Flatpak bundle from the local repo. -->
<exec executable="flatpak" failonerror="true">
<arg value="build-bundle"/>
<arg value="${flatpak.repo.dir}"/>
<arg value="${flatpak.bundle.file}"/>
<arg value="${flatpak.app.id}"/>
</exec>

<!-- Clean up intermediate build artifacts.
Use rm -rf instead of <delete> because flatpak-builder creates
special files (e.g. var/run/adduser) that Ant cannot delete. -->
<exec executable="rm" failonerror="false">
<arg value="-rf"/>
<arg value="${flatpak.build.dir}"/>
</exec>
<exec executable="rm" failonerror="false">
<arg value="-rf"/>
<arg value="${flatpak.repo.dir}"/>
</exec>

<echo message="Flatpak bundle created: ${flatpak.bundle.file}"/>
</target>
</project>
50 changes: 50 additions & 0 deletions pkg/flatpak/INSTALL.md
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 25.08` runtime from Flathub.
Install it before installing the bundle:

```sh
flatpak install --user flathub org.freedesktop.Platform//25.08
```

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
```
4 changes: 4 additions & 0 deletions pkg/flatpak/jdiskmark.sh
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 "$@"
Binary file added pkg/flatpak/net.jdiskmark.JDiskMark.64x64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions pkg/flatpak/net.jdiskmark.JDiskMark.desktop
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;
28 changes: 28 additions & 0 deletions pkg/flatpak/net.jdiskmark.JDiskMark.metainfo.xml
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>
Binary file added pkg/flatpak/net.jdiskmark.JDiskMark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading