Add cleanup part to snapcraft

This commit is contained in:
Miguel Jacq 2025-02-09 09:02:18 +11:00
parent bd9c191666
commit 6ec7a6a462
No known key found for this signature in database
GPG Key ID: 59B3F0C24135C6A9

View File

@ -222,3 +222,30 @@ parts:
override-build: |
cd meek-client
go build -o $SNAPCRAFT_PART_INSTALL/bin/meek-client ./...
# This part removes all the files in this snap which already exist in
# connected content and base snaps. Since these files will be available
# at runtime from the content and base snaps, they do not need to be
# included in this snap itself.
#
# More info: https://forum.snapcraft.io/t/reducing-the-size-of-desktop-snaps/17280#heading--cleanup-part
#
cleanup:
after: # Make this part run last; list all your other parts here
- onionshare-cli
- onionshare
- tor
- libevent
- obfs4
- snowflake-client
- meek-client
plugin: nil
build-snaps: # List all content-snaps and base snaps you're using here
- core22
- go/latest/stable
- gnome-42-2204-sdk
override-prime: |
set -eux
for snap in core22 go/latest/stable gnome-42-2204-sdk; do # List all content-snaps and base snaps you're using here
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$CRAFT_PRIME/{}" \;
done