build(snap): build riscv64 from the ports archive

libkrunfw5 ships for riscv64 in ubuntu-ports, not the main archive
(archive.ubuntu.com carries amd64 and arm64 binaries); the part now
maps each target arch to its pool and a pinned digest.
This commit is contained in:
vhaudiquet committed 2026-10-30 03:45:23 +01:00
1 parent 2132a8262d
commit f47f9e77dd
1 file changed
+17 -10
+17 -10
View File
@@ -37,6 +37,7 @@ confinement: strict
platforms: platforms:
amd64: amd64:
arm64: arm64:
riscv64:
apps: apps:
ecrou: ecrou:
@@ -86,21 +87,27 @@ parts:
libkrunfw: libkrunfw:
plugin: nil plugin: nil
# libkrunfw5 ships only in stonking universe today, not in any LTS # libkrunfw5 ships only in stonking universe today, not in any LTS
# base, so the .deb comes straight from the pool — one flavor per # base, so the .deb comes straight from the Ubuntu archive — one
# target arch. The library embeds its kernel and has no external # flavor per target arch. riscv64 lives on the ports archive
# symbols, so it runs on the base's older glibc. The pool carries # (archive.ubuntu.com carries amd64 and arm64 binaries only). The
# no riscv64 build, and libkrun does not target riscv64, so the # library embeds its kernel and has no external symbols, so it
# snap builds for amd64 and arm64 only. # runs on the base's older glibc.
build-packages: [curl] build-packages: [curl]
override-pull: | override-pull: |
arch="$CRAFT_ARCH_BUILD_FOR" arch="$CRAFT_ARCH_BUILD_FOR"
case "$arch" in case "$arch" in
amd64) digest="924cd545080aaf5da66740d12a51b7a5cbd9a5c0b502d21cbef9bc82bf1c8b6b" ;; amd64)
arm64) digest="9570e82feac79fd41a6a9674cc02a9b2f09948ac30ad480d05fc73a957843e56" ;; digest="924cd545080aaf5da66740d12a51b7a5cbd9a5c0b502d21cbef9bc82bf1c8b6b"
*) echo "no libkrunfw5 build for $arch in the Ubuntu pool" >&2; exit 1 ;; pool="https://archive.ubuntu.com/ubuntu/pool/universe/libk/libkrunfw" ;;
arm64)
digest="9570e82feac79fd41a6a9674cc02a9b2f09948ac30ad480d05fc73a957843e56"
pool="https://archive.ubuntu.com/ubuntu/pool/universe/libk/libkrunfw" ;;
riscv64)
digest="1f8b52a00eafdf52d2295eeab7dd527736788ce4d3aa97aecc18e3f4b66f413f"
pool="https://ports.ubuntu.com/ubuntu-ports/pool/universe/libk/libkrunfw" ;;
*) echo "no libkrunfw5 .deb mapped for $arch" >&2; exit 1 ;;
esac esac
curl -fL -o libkrunfw5.deb \ curl -fL -o libkrunfw5.deb "$pool/libkrunfw5_5.5.0+ds-1_${arch}.deb"
"https://archive.ubuntu.com/ubuntu/pool/universe/libk/libkrunfw/libkrunfw5_5.5.0+ds-1_${arch}.deb"
echo "$digest libkrunfw5.deb" | sha256sum -c echo "$digest libkrunfw5.deb" | sha256sum -c
override-build: | override-build: |
dpkg -x libkrunfw5.deb unpack dpkg -x libkrunfw5.deb unpack