From 9a76ae6f22d443d946fccb60f88579b20dfd8043 Mon Sep 17 00:00:00 2001 From: Bruno Lopes Date: Thu, 7 Aug 2025 08:23:38 -0300 Subject: [PATCH] build/linux: Add 'snapcraft pack' code on local snaps (cherry picked from commit 56e82756905c497121986a59228fb1ee1a315014) --- build/linux/snap/3_dist-gimp-snapcraft.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/build/linux/snap/3_dist-gimp-snapcraft.sh b/build/linux/snap/3_dist-gimp-snapcraft.sh index c32630022b..65889345ce 100644 --- a/build/linux/snap/3_dist-gimp-snapcraft.sh +++ b/build/linux/snap/3_dist-gimp-snapcraft.sh @@ -43,7 +43,10 @@ printf "(INFO): Name: $NAME (track: $TRACK) | Version: $GIMP_VERSION\n" ## Autodetects what archs will be packaged supported_archs=$(find . -maxdepth 1 -iname "*.snap") -if echo "$supported_archs" | grep -q 'arm64' && ! echo "$supported_archs" | grep -q 'amd64'; then +if [ "$supported_archs" = '' ]; then + printf "(INFO): Arch: $(dpkg --print-architecture)\n" + export supported_archs="./temp_${NAME}_${GIMP_VERSION}_$(dpkg --print-architecture).snap" +elif echo "$supported_archs" | grep -q 'arm64' && ! echo "$supported_archs" | grep -q 'amd64'; then printf '(INFO): Arch: arm64\n' elif ! echo "$supported_archs" | grep -q 'arm64' && echo "$supported_archs" | grep -q 'amd64'; then printf '(INFO): Arch: amd64\n' @@ -57,6 +60,10 @@ printf "\e[0Ksection_end:`date +%s`:snap_info\r\e[0K\n" for SNAP in $supported_archs; do SNAP=$(echo "$SNAP" | sed 's|^\./temp_||') printf "\e[0Ksection_start:`date +%s`:${SNAP}_making[collapsed=true]\r\e[0KFinishing ${SNAP}\n" +if [ -z "$GITLAB_CI" ]; then + #as explained in 2_build-gimp-snapcraft.sh, we can only make snaps this way locally due to remote-build limitations + sudo snapcraft pack --destructive-mode --output temp_${SNAP} +fi mv temp_${SNAP} ${SNAP} printf "(INFO): Suceeded. To test this build, install it from the artifact with: sudo snap install --dangerous ${SNAP}\n" printf "\e[0Ksection_end:`date +%s`:${SNAP}_making\r\e[0K\n"