From 1cd727d9dc28c10cfc8ad4b674799afda92550f9 Mon Sep 17 00:00:00 2001 From: Maximilian Federle Date: Thu, 13 Feb 2020 16:20:52 +0100 Subject: [PATCH] snap: Remove superfluous files from package Remove all files from snap that are already included in the base snap or in any connected content snaps. The main advantage is the massively reduced snap size: From ~70 MB down to ~6 MB. --- pkg/snap/snap/snapcraft.yaml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkg/snap/snap/snapcraft.yaml b/pkg/snap/snap/snapcraft.yaml index e17ecda..ce0c45e 100644 --- a/pkg/snap/snap/snapcraft.yaml +++ b/pkg/snap/snap/snapcraft.yaml @@ -26,7 +26,7 @@ apps: extensions: [gnome-3-28] plugs: [opengl, unity7, home, removable-media, gsettings, network] environment: - __EGL_VENDOR_LIBRARY_DIRS: $SNAP/usr/share/glvnd/egl_vendor.d + __EGL_VENDOR_LIBRARY_DIRS: $SNAP/gnome-platform/usr/share/glvnd/egl_vendor.d:$SNAP/usr/share/glvnd/egl_vendor.d cli: command: usr/bin/solvespace-cli plugs: [home, removable-media, network] @@ -71,6 +71,14 @@ parts: - libglibmm-2.4-1v5 - libpangomm-1.4-1v5 - libsigc++-2.0-0v5 - - libglew2.0 - - libegl-mesa0 - - libdrm2 + cleanup: + after: [solvespace] + plugin: nil + build-snaps: [core18, gnome-3-28-1804] + override-prime: | + # Remove all files from snap that are already included in the base snap or in + # any connected content snaps + set -eux + for snap in "core18" "gnome-3-28-1804"; do # List all content-snaps and base snaps you're using here + cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \; + done