Mailspring/snap/snapcraft.yaml
Marco Trevisan 181e2fb11a
snap: Remove unused permissions and duplicated libraries (#2478)
* snap: Remove various unneeeded plugs

Remove various permissions that the snap required and that are not
actually used. In particular now all the file and settings access is handled
by XDG portals, so there's no need to grant direct file access.

Also this is not a media app or network management software, so no
need to add screen inhibitors or network observation.

* snap: Do not add libnss3

That's already provided by GNOME so no need to duplicate it.

* Update snapcraft.yaml

Put back password-manager-service, home for now

---------

Co-authored-by: Ben Gotow <bengotow@gmail.com>
2023-12-10 12:19:29 -06:00

72 lines
1.8 KiB
YAML

name: mailspring
license: GPL-3.0
adopt-info: mailspring
confinement: strict
base: core22
compression: lzo
architectures:
- build-on: amd64
parts:
mailspring:
plugin: nil
override-pull: |
deb="$(ls $CRAFT_PROJECT_DIR/app/dist/mailspring-*.deb)"
craftctl set version="$(basename "$deb" | grep -Eo "[0-9]+.[0-9]+.[0-9]+")"
dpkg -x "$deb" "$CRAFT_PART_SRC"
override-build: |
cp -a "$CRAFT_PART_SRC"/* "$CRAFT_PART_INSTALL"
craftctl default
sed -i 's|Icon=mailspring|Icon=/usr/share/pixmaps/mailspring\.png|' \
$CRAFT_PART_INSTALL/usr/share/applications/Mailspring.desktop
prime:
- -usr/share/mailspring/chrome-sandbox
parse-info: [usr/share/appdata/mailspring.appdata.xml]
stage-packages:
- libxkbfile1
stage:
- -usr/lib/*/libsecret-*
libsecret:
source: https://gitlab.gnome.org/GNOME/libsecret.git
source-depth: 1
source-tag: '0.20.5'
plugin: meson
meson-parameters:
- --prefix=/usr
- -Dgtk_doc=false
- -Dmanpage=false
- -Dgcrypt=false
stage:
- usr/lib/*/libsecret-*
apps:
mailspring:
command: usr/bin/mailspring --no-sandbox
common-id: mailspring
desktop: usr/share/applications/Mailspring.desktop
extensions: [gnome]
environment:
HOME: $SNAP_USER_COMMON
# Correct the TMPDIR path for Chromium Framework/Electron to
# ensure libappindicator has readable resources.
TMPDIR: $XDG_RUNTIME_DIR
# Fallback to XWayland if running in a Wayland session.
DISABLE_WAYLAND: 1
plugs:
- avahi-observe
- browser-support
- cups-control
- opengl
- home
- desktop
- desktop-legacy
- network
- network-bind
- password-manager-service
- pulseaudio
- unity7
- x11