build(snap): build arm64 and drop the riscv64 target

The pool carries an arm64 libkrunfw5 next to the amd64 one, so the
part now picks the flavor and the install path from the target arch
(CRAFT_ARCH_BUILD_FOR / CRAFT_ARCH_TRIPLET_BUILD_FOR) with the
checksum pinned per arch. riscv64 goes: the pool has no libkrunfw5
build for it, and libkrun does not target it.
This commit is contained in:
vhaudiquet committed 2026-10-30 03:25:49 +01:00
1 parent b4dafccae7
commit 5072fbcbed
1 file changed
+15 -8
+15 -8
View File
@@ -37,7 +37,6 @@ confinement: strict
platforms: platforms:
amd64: amd64:
arm64: arm64:
riscv64:
apps: apps:
ecrou: ecrou:
@@ -86,17 +85,25 @@ parts:
libkrunfw: libkrunfw:
plugin: nil plugin: nil
# libkrunfw5 ships only in stonking universe today, # libkrunfw5 ships only in stonking universe today, not in any LTS
# not in any LTS base, so the .deb comes straight from the pool. # base, so the .deb comes straight from the pool — one flavor per
# The library embeds its kernel and has no external symbols, so # target arch. The library embeds its kernel and has no external
# it runs on the base's older glibc. # symbols, so it runs on the base's older glibc. The pool carries
# no riscv64 build, and libkrun does not target riscv64, so the
# snap builds for amd64 and arm64 only.
build-packages: [curl] build-packages: [curl]
override-pull: | override-pull: |
arch="$CRAFT_ARCH_BUILD_FOR"
case "$arch" in
amd64) digest="924cd545080aaf5da66740d12a51b7a5cbd9a5c0b502d21cbef9bc82bf1c8b6b" ;;
arm64) digest="9570e82feac79fd41a6a9674cc02a9b2f09948ac30ad480d05fc73a957843e56" ;;
*) echo "no libkrunfw5 build for $arch in the Ubuntu pool" >&2; exit 1 ;;
esac
curl -fL -o libkrunfw5.deb \ curl -fL -o libkrunfw5.deb \
https://archive.ubuntu.com/ubuntu/pool/universe/libk/libkrunfw/libkrunfw5_5.5.0+ds-1_amd64.deb "https://archive.ubuntu.com/ubuntu/pool/universe/libk/libkrunfw/libkrunfw5_5.5.0+ds-1_${arch}.deb"
echo "924cd545080aaf5da66740d12a51b7a5cbd9a5c0b502d21cbef9bc82bf1c8b6b libkrunfw5.deb" | sha256sum -c echo "$digest libkrunfw5.deb" | sha256sum -c
override-build: | override-build: |
dpkg -x libkrunfw5.deb unpack dpkg -x libkrunfw5.deb unpack
install -Dm755 unpack/usr/lib/x86_64-linux-gnu/libkrunfw.so.5.5.0 \ install -Dm755 "unpack/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/libkrunfw.so.5.5.0" \
"$CRAFT_PART_INSTALL/lib/libkrunfw.so.5.5.0" "$CRAFT_PART_INSTALL/lib/libkrunfw.so.5.5.0"
ln -s libkrunfw.so.5.5.0 "$CRAFT_PART_INSTALL/lib/libkrunfw.so.5" ln -s libkrunfw.so.5.5.0 "$CRAFT_PART_INSTALL/lib/libkrunfw.so.5"