add arm64 appimage
This commit is contained in:
1 parent
c19cd28de8
commit
c7847f0d9e
9 files changed
+248
-40
No files matched your search
+28
-11
@@ -3,25 +3,42 @@
|
||||
"glibc": "2.39",
|
||||
"flutter": {
|
||||
"version": "3.47.4",
|
||||
"source_revision": "9584c6713b324636289d067944a46fd6b49df14b",
|
||||
"url": "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.47.4-stable.tar.xz",
|
||||
"sha256": "5b45f0ceda99b9bebdc873e7e69f6450aeb4c30f454b505e2e62fc9255a907d3"
|
||||
},
|
||||
"tools": {
|
||||
"linuxdeploy": {
|
||||
"url": "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20251107-1/linuxdeploy-x86_64.AppImage",
|
||||
"sha256": "c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d"
|
||||
},
|
||||
"appimagetool": {
|
||||
"url": "https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage",
|
||||
"sha256": "ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0"
|
||||
},
|
||||
"gtk": {
|
||||
"url": "https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-gtk/7a3fbc31a9e5075073ff8790f26effbac5f84453/linuxdeploy-plugin-gtk.sh",
|
||||
"sha256": "b0f4cbc684a0103a9651f0955b635eaea0096b3a66c0f5a2c2aa337960375171"
|
||||
},
|
||||
"runtime": {
|
||||
"url": "https://github.com/AppImage/type2-runtime/releases/download/20251108/runtime-x86_64",
|
||||
"sha256": "2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d"
|
||||
"x86_64": {
|
||||
"linuxdeploy": {
|
||||
"url": "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20251107-1/linuxdeploy-x86_64.AppImage",
|
||||
"sha256": "c20cd71e3a4e3b80c3483cef793cda3f4e990aca14014d23c544ca3ce1270b4d"
|
||||
},
|
||||
"appimagetool": {
|
||||
"url": "https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-x86_64.AppImage",
|
||||
"sha256": "ed4ce84f0d9caff66f50bcca6ff6f35aae54ce8135408b3fa33abfc3cb384eb0"
|
||||
},
|
||||
"runtime": {
|
||||
"url": "https://github.com/AppImage/type2-runtime/releases/download/20251108/runtime-x86_64",
|
||||
"sha256": "2fca8b443c92510f1483a883f60061ad09b46b978b2631c807cd873a47ec260d"
|
||||
}
|
||||
},
|
||||
"aarch64": {
|
||||
"linuxdeploy": {
|
||||
"url": "https://github.com/linuxdeploy/linuxdeploy/releases/download/1-alpha-20251107-1/linuxdeploy-aarch64.AppImage",
|
||||
"sha256": "620095110d693282b8ebeb244a95b5e911cf8f65f76c88b4b47d16ae6346fcff"
|
||||
},
|
||||
"appimagetool": {
|
||||
"url": "https://github.com/AppImage/appimagetool/releases/download/1.9.1/appimagetool-aarch64.AppImage",
|
||||
"sha256": "f0837e7448a0c1e4e650a93bb3e85802546e60654ef287576f46c71c126a9158"
|
||||
},
|
||||
"runtime": {
|
||||
"url": "https://github.com/AppImage/type2-runtime/releases/download/20251108/runtime-aarch64",
|
||||
"sha256": "00cbdfcf917cc6c0ff6d3347d59e0ca1f7f45a6df1a428a0d6d8a78664d87444"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,6 @@ ENV PATH="/opt/flutter/bin:${PATH}"
|
||||
FROM ${BASE_IMAGE} AS runtime-test
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
xvfb xauth x11-utils x11-apps xdotool imagemagick dbus-x11 libgl1 libegl1 libgles2 \
|
||||
libgl1-mesa-dri fonts-dejavu-core \
|
||||
xvfb xauth x11-utils x11-apps xdotool imagemagick dbus-x11 binutils libgl1 libegl1 libgles2 \
|
||||
libgl1-mesa-dri fonts-dejavu-core \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
@@ -16,6 +16,10 @@ assert_fails() {
|
||||
assert_fails packaging_enabled Debug
|
||||
assert_fails packaging_enabled Profile
|
||||
packaging_enabled Release
|
||||
[[ "$(canonical_arch x64)" == x86_64 ]]
|
||||
[[ "$(canonical_arch aarch64)" == aarch64 ]]
|
||||
[[ "$(canonical_arch arm64)" == aarch64 ]]
|
||||
assert_fails canonical_arch riscv64
|
||||
MESHCORE_BUILD_APPIMAGE=0 assert_fails packaging_enabled Release
|
||||
assert_fails check_bundle "$temporary/missing"
|
||||
|
||||
@@ -32,7 +36,13 @@ MESHCORE_BUILD_APPIMAGE=0 bash "$project/scripts/build_appimage.sh" \
|
||||
bash "$project/scripts/build_appimage.sh" "$project" /missing "$temporary/output" Debug x64
|
||||
[[ ! -d "$temporary/output" ]]
|
||||
assert_fails bash "$project/scripts/build_appimage.sh" \
|
||||
"$project" /missing "$temporary/output" Release arm64
|
||||
"$project" /missing "$temporary/output" Release riscv64
|
||||
jq -e '.flutter.source_revision == "9584c6713b324636289d067944a46fd6b49df14b" and
|
||||
(.tools.x86_64.linuxdeploy.sha256 | length == 64) and
|
||||
(.tools.aarch64.linuxdeploy.sha256 | length == 64) and
|
||||
(.tools.aarch64.appimagetool.sha256 | length == 64) and
|
||||
(.tools.aarch64.runtime.sha256 | length == 64)' \
|
||||
"$project/scripts/appimage-tools.json" >/dev/null
|
||||
|
||||
stage_bundle "$project" "$temporary/bundle" "$temporary/AppDir with spaces"
|
||||
check_bundle "$temporary/AppDir with spaces/usr/bin"
|
||||
@@ -50,10 +60,36 @@ assert_fails download_verified "file://$temporary/input" \
|
||||
printf 'corruption\n' >> "$temporary/cache/tool"
|
||||
assert_fails download_verified "file://$temporary/input" "$checksum" "$temporary/cache/tool"
|
||||
|
||||
# shellcheck disable=SC2329
|
||||
download_verified() {
|
||||
printf '%s %s\n' "$1" "$3" >> "$temporary/tool-selection"
|
||||
mkdir -p "$(dirname "$3")"
|
||||
: > "$3"
|
||||
}
|
||||
|
||||
prepare_tools "$project/scripts/appimage-tools.json" "$temporary/tools-x64" x86_64
|
||||
prepare_tools "$project/scripts/appimage-tools.json" "$temporary/tools-arm64" aarch64
|
||||
grep -Fq 'linuxdeploy-x86_64.AppImage' "$temporary/tool-selection"
|
||||
grep -Fq 'appimagetool-x86_64.AppImage' "$temporary/tool-selection"
|
||||
grep -Fq 'runtime-x86_64' "$temporary/tool-selection"
|
||||
grep -Fq 'linuxdeploy-aarch64.AppImage' "$temporary/tool-selection"
|
||||
grep -Fq 'appimagetool-aarch64.AppImage' "$temporary/tool-selection"
|
||||
grep -Fq 'runtime-aarch64' "$temporary/tool-selection"
|
||||
unset -f download_verified
|
||||
|
||||
mkdir -p "$temporary/project/scripts/appimage"
|
||||
touch "$temporary/project/pubspec.lock"
|
||||
cp "$project/scripts/appimage/Dockerfile" "$temporary/project/scripts/appimage/"
|
||||
|
||||
# shellcheck disable=SC2329
|
||||
jq() {
|
||||
case "$*" in
|
||||
*'.flutter.version'*) printf '3.47.4\n' ;;
|
||||
*'.ubuntu'*) printf 'ubuntu:24.04\n' ;;
|
||||
*) return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
# shellcheck disable=SC2329
|
||||
podman() {
|
||||
case "$1" in
|
||||
@@ -84,7 +120,7 @@ package_container "$temporary/project" "$temporary/output" \
|
||||
"$project/scripts/appimage-tools.json" "$temporary/container-cache"
|
||||
assert_fails grep -Fxq -- '--userns=keep-id' "$temporary/container-arguments"
|
||||
grep -Fxq -- "$(id -u):$(id -g)" "$temporary/container-arguments"
|
||||
unset -f podman docker
|
||||
unset -f jq podman docker
|
||||
|
||||
# shellcheck disable=SC2329
|
||||
readelf() {
|
||||
|
||||
@@ -4,6 +4,15 @@ set -euo pipefail
|
||||
image="$(realpath "$1")"
|
||||
mkdir -p "$2"
|
||||
output="$(realpath "$2")"
|
||||
case "$(uname -m)" in
|
||||
x86_64) expected_machine='Advanced Micro Devices X86-64' ;;
|
||||
aarch64) expected_machine='AArch64' ;;
|
||||
*) printf 'Unsupported runtime-test architecture: %s\n' "$(uname -m)" >&2; exit 1 ;;
|
||||
esac
|
||||
if ! readelf -h "$image" | grep -Fq "$expected_machine"; then
|
||||
printf 'AppImage runtime is not built for %s\n' "$(uname -m)" >&2
|
||||
exit 1
|
||||
fi
|
||||
workspace="$(mktemp -d)"
|
||||
app_pid=''
|
||||
bus_pid=''
|
||||
@@ -23,6 +32,13 @@ appdir="$workspace/squashfs-root"
|
||||
-f "$appdir/usr/bin/data/icudtl.dat" && -d "$appdir/usr/bin/data/flutter_assets" ]]
|
||||
[[ -f "$appdir/usr/bin/lib/libonnxruntime.so.1" && \
|
||||
-f "$appdir/usr/share/glib-2.0/schemas/gschemas.compiled" ]]
|
||||
while IFS= read -r -d '' library; do
|
||||
if readelf -h "$library" >/dev/null 2>&1 && \
|
||||
! readelf -h "$library" | grep -Fq "$expected_machine"; then
|
||||
printf 'Wrong ELF architecture in AppImage: %s\n' "${library#"$appdir/"}" >&2
|
||||
exit 1
|
||||
fi
|
||||
done < <(find "$appdir/usr/bin" "$appdir/usr/lib" -type f -print0)
|
||||
ldd "$appdir/usr/bin/meshcore_open" > "$output/dependencies.log" 2>&1
|
||||
while IFS= read -r -d '' library; do
|
||||
printf '\n%s\n' "${library#"$appdir/"}" >> "$output/dependencies.log"
|
||||
|
||||
+32
-16
@@ -10,6 +10,14 @@ packaging_enabled() {
|
||||
[[ "${MESHCORE_BUILD_APPIMAGE:-1}" != 0 && "$1" == Release ]]
|
||||
}
|
||||
|
||||
canonical_arch() {
|
||||
case "$1" in
|
||||
x64|x86_64) printf 'x86_64\n' ;;
|
||||
arm64|aarch64) printf 'aarch64\n' ;;
|
||||
*) fail "Unsupported AppImage architecture: $1"; return 1 ;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_bundle() {
|
||||
local bundle="$1"
|
||||
[[ -x "$bundle/meshcore_open" && -f "$bundle/lib/libapp.so" && \
|
||||
@@ -53,13 +61,18 @@ require_tools() {
|
||||
}
|
||||
|
||||
prepare_tools() {
|
||||
local manifest="$1" cache="$2" tool url checksum
|
||||
local manifest="$1" cache="$2" architecture="$3" tool url checksum
|
||||
mkdir -p "$cache"
|
||||
exec {cache_lock}>"$cache/tools.lock"
|
||||
flock "$cache_lock"
|
||||
for tool in linuxdeploy appimagetool gtk runtime; do
|
||||
url="$(jq -er --arg tool "$tool" '.tools[$tool].url' "$manifest")"
|
||||
checksum="$(jq -er --arg tool "$tool" '.tools[$tool].sha256' "$manifest")"
|
||||
if [[ "$tool" == gtk ]]; then
|
||||
url="$(jq -er '.tools.gtk.url' "$manifest")"
|
||||
checksum="$(jq -er '.tools.gtk.sha256' "$manifest")"
|
||||
else
|
||||
url="$(jq -er --arg arch "$architecture" --arg tool "$tool" '.tools[$arch][$tool].url' "$manifest")"
|
||||
checksum="$(jq -er --arg arch "$architecture" --arg tool "$tool" '.tools[$arch][$tool].sha256' "$manifest")"
|
||||
fi
|
||||
download_verified "$url" "$checksum" "$cache/$tool"
|
||||
chmod +x "$cache/$tool"
|
||||
done
|
||||
@@ -104,14 +117,16 @@ audit_appdir() {
|
||||
}
|
||||
|
||||
package_direct() {
|
||||
local project="$1" bundle="$2" output="$3" manifest="$4" cache="$5"
|
||||
local work appdir library relative linuxdeploy appimagetool
|
||||
local project="$1" bundle="$2" output="$3" manifest="$4" cache="$5" architecture="$6"
|
||||
local work appdir library relative linuxdeploy appimagetool appimage_name appimage_arch
|
||||
local dependencies=()
|
||||
require_tools curl jq sha256sum flock file readelf patchelf pkg-config \
|
||||
desktop-file-validate glib-compile-schemas gdk-pixbuf-thumbnailer xdg-user-dir
|
||||
pkg-config --exists gtk+-3.0 librsvg-2.0 gobject-introspection-1.0 || \
|
||||
{ fail 'Missing GTK, librsvg or GObject introspection development files'; return 1; }
|
||||
prepare_tools "$manifest" "$cache"
|
||||
prepare_tools "$manifest" "$cache" "$architecture"
|
||||
appimage_arch="$architecture"
|
||||
appimage_name="meshcore-open-$architecture.AppImage"
|
||||
work="$(mktemp -d "$output/appimage.XXXXXX")"
|
||||
# shellcheck disable=SC2064
|
||||
trap "rm -rf -- $(printf '%q' "$work")" EXIT
|
||||
@@ -172,10 +187,10 @@ package_direct() {
|
||||
cp "$MESHCORE_APPIMAGE_FLUTTER_ROOT/LICENSE" "$appdir/usr/share/doc/meshcore-open/Flutter-LICENSE"
|
||||
fi
|
||||
audit_appdir "$appdir" "$work/audit.txt"
|
||||
ARCH=x86_64 "$appimagetool" --runtime-file "$cache/runtime" --no-appstream \
|
||||
"$appdir" "$work/meshcore-open-x86_64.AppImage"
|
||||
chmod +x "$work/meshcore-open-x86_64.AppImage"
|
||||
mv "$work/meshcore-open-x86_64.AppImage" "$output/meshcore-open-x86_64.AppImage"
|
||||
ARCH="$appimage_arch" "$appimagetool" --runtime-file "$cache/runtime" --no-appstream \
|
||||
"$appdir" "$work/$appimage_name"
|
||||
chmod +x "$work/$appimage_name"
|
||||
mv "$work/$appimage_name" "$output/$appimage_name"
|
||||
mv "$work/audit.txt" "$output/appimage-audit.txt"
|
||||
cp "$manifest" "$output/appimage-tools.json"
|
||||
rm -rf "$work"
|
||||
@@ -283,25 +298,26 @@ main() {
|
||||
[[ $# == 5 ]] || { fail 'Expected: project bundle output configuration architecture'; return 1; }
|
||||
local project="$1" bundle="$2" output="$3" configuration="$4" architecture="$5"
|
||||
packaging_enabled "$configuration" || return 0
|
||||
[[ "$architecture" == x64 || "$architecture" == x86_64 ]] || \
|
||||
{ fail 'Only x86_64 AppImages are supported; set MESHCORE_BUILD_APPIMAGE=0 for other architectures'; return 1; }
|
||||
architecture="$(canonical_arch "$architecture")" || return 1
|
||||
mkdir -p "$output"
|
||||
output="$(realpath "$output")"
|
||||
exec {output_lock}>"$output/appimage.lock"
|
||||
flock "$output_lock"
|
||||
rm -f "$output/meshcore-open-x86_64.AppImage" "$output/appimage-audit.txt" "$output/appimage-tools.json"
|
||||
rm -f "$output/meshcore-open-$architecture.AppImage" "$output/appimage-audit.txt" "$output/appimage-tools.json"
|
||||
check_bundle "$bundle"
|
||||
require_tools jq readelf sha256sum
|
||||
local manifest="$project/scripts/appimage-tools.json" pin cache
|
||||
pin="$(sha256sum "$manifest")"
|
||||
pin="${pin%% *}"
|
||||
cache="${XDG_CACHE_HOME:-$HOME/.cache}/meshcore-open/appimage/$pin/x86_64"
|
||||
cache="${XDG_CACHE_HOME:-$HOME/.cache}/meshcore-open/appimage/$pin/$architecture"
|
||||
if requires_container_rebuild "$bundle/meshcore_open" "$(jq -er '.glibc' "$manifest")"; then
|
||||
[[ "$architecture" == x86_64 ]] || \
|
||||
{ fail 'ARM64 container rebuild is not configured; build on an Ubuntu 24.04 ARM64 host or set MESHCORE_BUILD_APPIMAGE=0'; return 1; }
|
||||
package_container "$project" "$output" "$manifest" "$cache"
|
||||
else
|
||||
package_direct "$project" "$bundle" "$output" "$manifest" "$cache"
|
||||
package_direct "$project" "$bundle" "$output" "$manifest" "$cache" "$architecture"
|
||||
fi
|
||||
printf 'AppImage created: %s/meshcore-open-x86_64.AppImage\n' "$output"
|
||||
printf 'AppImage created: %s/meshcore-open-%s.AppImage\n' "$output" "$architecture"
|
||||
}
|
||||
|
||||
if [[ "${BASH_SOURCE[0]}" == "$0" ]]; then
|
||||
|
||||
Reference in new issue
Block a user