Files
Meshtastic-Android/scripts/verify-flatpak/desktop-offline.yaml
T
James Rich 3222a8c461 fix(verify-flatpak): bundle gradle-9.5.1-all, rewrite wrapper URL
The Gradle wrapper inside the flatpak build was trying to download
gradle-9.5.1-all.zip from services.gradle.org and failing because the
build phase has no network. Two problems:

1. The bundled gradle distribution was gradle-9.4.1-bin.zip
   (mismatched version + bin instead of all).
2. The overlay was missing the sed step that rewrites
   distributionUrl in gradle-wrapper.properties to point at the
   bundled file.

Fix: bump bundled distribution to gradle-9.5.1-all.zip (matches
gradle/wrapper/gradle-wrapper.properties exactly) and add the
distributionUrl sed before any gradlew invocation. Hash pulled from
the official services.gradle.org/.../*.sha256 endpoint.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 11:27:21 -05:00

102 lines
4.3 KiB
YAML

# Local offline verification of org.meshtastic.desktop.
# Differences from vid's upstream manifest (vidplace7/org.meshtastic.desktop):
# 1. Meshtastic-Android source: `type: dir` pointing at our local checkout instead of `type: git`.
# 2. flatpak-sources.json is INCLUDED (uncommented) so Gradle resolves from the offline-repository.
# 3. Build uses `--offline` for Gradle — true Flathub-style offline compilation.
# (finish-args still grants runtime network since the app needs it; only the build is offline.)
# Generated by scripts/verify-flatpak/verify.sh; do not edit upstream from here.
id: org.meshtastic.desktop
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.openjdk17
- org.freedesktop.Sdk.Extension.openjdk21
command: meshtastic-wrapper.sh
finish-args:
- --share=ipc
- --socket=x11
- --device=dri
- --device=all
- --share=network
- --talk-name=org.kde.StatusNotifierWatcher
- --talk-name=org.freedesktop.Notifications
- --allow=bluetooth
- --system-talk-name=org.bluez.*
- --env=PATH=/app/jre/bin:/app/bin:/usr/bin
- --env=JAVA_HOME=/app/jre
modules:
- name: jbr
buildsystem: simple
build-commands:
- mkdir -p /app/jre
- tar xzf jbr-*.tar.gz -C /app/jre --strip-components=1
sources:
- type: file
url: https://cache-redirector.jetbrains.com/intellij-jbr/jbr-21.0.10-linux-x64-b1163.105.tar.gz
sha256: b6a3b13451d296140727bbde9325dd9ee422e2e9b2c6a9378f346f1b8d1111bc
only-arches:
- x86_64
- type: file
url: https://cache-redirector.jetbrains.com/intellij-jbr/jbr-21.0.10-linux-aarch64-b1163.105.tar.gz
sha256: 38804f526d869f5a9c49e9b90c04edcbc918b41e8e43264e5d5076d352a959bc
only-arches:
- aarch64
- shared-modules/libappindicator/libappindicator-gtk3-12.10.json
- name: meshtastic-wrapper
buildsystem: simple
build-commands:
- install -Dm755 meshtastic-wrapper.sh /app/bin/meshtastic-wrapper.sh
sources:
- type: file
path: meshtastic-wrapper.sh
- name: meshtastic-desktop
buildsystem: simple
build-options:
append-path: "/usr/lib/sdk/openjdk21/bin"
env:
JAVA_HOME: /usr/lib/sdk/openjdk21/jvm/openjdk-21
# Point Gradle at the offline mirror produced by flatpak-sources.json
GRADLE_USER_HOME: /run/build/meshtastic-desktop/.gradle
build-commands:
- install -Dm644 -t /app/share/icons/hicolor/scalable/apps org.meshtastic.desktop.svg
- install -Dm644 -t /app/share/applications org.meshtastic.desktop.desktop
- install -Dm644 -t /app/share/metainfo org.meshtastic.desktop.metainfo.xml
# Redirect the Gradle wrapper to the bundled distribution (no network).
- sed -i 's|distributionUrl=.*|distributionUrl=gradle-all.zip|' gradle/wrapper/gradle-wrapper.properties
- echo "org.gradle.java.installations.auto-detect=false" >> gradle.properties
- echo "org.gradle.java.installations.auto-download=false" >> gradle.properties
- echo "org.gradle.java.installations.paths=/usr/lib/sdk/openjdk21/jvm/openjdk-21,/usr/lib/sdk/openjdk17/jvm/openjdk-17" >> gradle.properties
- >
sed -i
's/^\(\s*\)vendor\.set(JvmVendorSpec\.JETBRAINS)/\1\/\/ vendor.set(JvmVendorSpec.JETBRAINS)/'
desktopApp/build.gradle.kts
# Force Gradle to resolve from the bundled offline-repository ONLY (true offline test).
- ./gradlew --offline :desktopApp:packageUberJarForCurrentOS
- >
JAR_FILE=$(find desktopApp/build/compose/jars/ -name "*.jar" -type f | head -1)
&& install -Dm755 "$JAR_FILE" /app/lib/meshtastic-desktop.jar
sources:
- type: file
path: org.meshtastic.desktop.desktop
- type: file
path: org.meshtastic.desktop.metainfo.xml
- type: file
path: org.meshtastic.desktop.svg
- type: dir
path: meshtastic-android
- type: file
# Must match the version in gradle/wrapper/gradle-wrapper.properties.
# Bumping the wrapper? Update both the URL and sha256 here.
url: https://services.gradle.org/distributions/gradle-9.5.1-all.zip
sha256: c72fb9991f6025cbe337d52ba77e531b3faf62bdd3e348fe1ccee9f51c71adb0
dest: "gradle/wrapper"
dest-filename: "gradle-all.zip"
- flatpak-sources.json