diff --git a/desktop/resources/snap/snapcraft.yaml.in b/desktop/resources/snap/snapcraft.yaml.in index 9b125d6..19f5574 100644 --- a/desktop/resources/snap/snapcraft.yaml.in +++ b/desktop/resources/snap/snapcraft.yaml.in @@ -17,7 +17,7 @@ contact: https://reya.su parts: signed: plugin: dump - source: target/release/signed-linux-$ARCH_SUFFIX.tar.gz + source: target/release/signed-linux-$TARBALL_ARCH_SUFFIX.tar.gz organize: # These renames seem to not be necessary, but it's tidier. diff --git a/script/bundle-snap b/script/bundle-snap index 2f0356e..12abb3b 100755 --- a/script/bundle-snap +++ b/script/bundle-snap @@ -11,9 +11,12 @@ ARCH=$(uname -m) # Snap uses its own architecture names, which must match the file name and # the architecture asserted inside the .snap. `x86_64`/`aarch64` here would # produce a file like signed_1.0.0_x86_64.snap that snapd cannot match. +# +# The source tarball is named by `script/bundle-linux` after `uname -m`, so it +# keeps the x86_64/aarch64 spelling rather than the snap-native one. case "$ARCH" in - x86_64|amd64) ARCH_SUFFIX="amd64" ;; - aarch64|arm64) ARCH_SUFFIX="arm64" ;; + x86_64|amd64) ARCH_SUFFIX="amd64"; TARBALL_ARCH_SUFFIX="x86_64" ;; + aarch64|arm64) ARCH_SUFFIX="arm64"; TARBALL_ARCH_SUFFIX="aarch64" ;; *) echo "Unsupported architecture: $ARCH"; exit 1 ;; esac @@ -27,7 +30,7 @@ envsubst < "desktop/resources/signed.desktop.in" > "snap/gui/signed.desktop" cp "desktop/resources/icon.png" "snap/gui/signed.png" # Generate snapcraft.yaml with version and architecture -RELEASE_VERSION="$1" ARCH_SUFFIX="$ARCH_SUFFIX" envsubst < desktop/resources/snap/snapcraft.yaml.in > snap/snapcraft.yaml +RELEASE_VERSION="$1" TARBALL_ARCH_SUFFIX="$TARBALL_ARCH_SUFFIX" envsubst < desktop/resources/snap/snapcraft.yaml.in > snap/snapcraft.yaml # Clean previous builds snapcraft clean