aboutsummaryrefslogtreecommitdiff
path: root/snap/snapcraft.yaml
blob: 447bfbf49a39a5436afe38cbb43587902b78515b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: magnus
version: git
version-script: |
  VER=$(grep __VERSION__ magnus | head -n 1 | cut -d'=' -f2 | sed 's/ //g' | sed "s/\"//g")
  REV=$(git rev-parse --short HEAD)
  echo $VER-$REV
summary: Magnus screen magnifier
description: |
  A very simple screen magnifier.
icon: data/logo.png

base: core18
grade: stable
confinement: strict

plugs:
  gnome-3-28-1804:
    interface: content
    target: gnome-platform
    default-provider: gnome-3-28-1804:gnome-3-28-1804
  gtk-3-themes:
    interface: content
    target: $SNAP/share/themes
    default-provider: gtk-common-themes:gtk-3-themes
  icon-themes:
    interface: content
    target: $SNAP/share/icons
    default-provider: gtk-common-themes:icon-themes
  sound-themes:
    interface: content
    target: $SNAP/share/sounds
    default-provider: gtk-common-themes:sounds-themes

slots:
  magnus-dbus:
    interface: dbus
    name: org.kryogenix.magnus
    bus: session

apps:
  magnus:
    command: desktop-launch $SNAP/bin/magnus
    desktop: usr/share/applications/magnus.desktop
    plugs:
      - desktop
      - desktop-legacy
      - gsettings
      - home
      - wayland
      - x11

parts:
  desktop-gtk3:
    build-packages:
      - libgtk-3-dev
    make-parameters:
      - FLAVOR=gtk3
    plugin: make
    source: https://github.com/ubuntu/snapcraft-desktop-helpers.git
    source-subdir: gtk

  # Python's DistUtilsExtra causes pip install failure
  # https://forum.snapcraft.io/t/use-of-pythons-distutilsextra-causes-pip-install-failure/802
  magnus:
    after:
      - desktop-gtk3
    source: .
    plugin: nil
    stage-packages:
      - gir1.2-gdkpixbuf-2.0
      - gir1.2-glib-2.0
      - gir1.2-gtk-3.0
      - gir1.2-keybinder-3.0
      - python3-gi
      - python3-setproctitle
    override-build: |
      snapcraftctl build
      install -D -m 755 -o root magnus $SNAPCRAFT_PART_INSTALL/bin/magnus
      install -D -m 644 -o root data/logo.png $SNAPCRAFT_PART_INSTALL/usr/share/pixmaps/magnus.png
      install -D -m 644 -o root data/magnus.desktop $SNAPCRAFT_PART_INSTALL/usr/share/applications/magnus.desktop
      sed -i 's|Icon=zoom-best-fit|Icon=/usr/share/pixmaps/magnus\.png|' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/magnus.desktop
    # Most of what Magnus requires is provided by the GNOME platform snap; so just prime what we need.
    prime:
      - bin
      - command-*.wrapper
      - flavor-select
      - lib
      - usr/bin/python*
      - usr/lib/girepository-1.0
      - usr/lib/python3*
      - usr/lib/*/gio
      - usr/lib/*/girepository-1.0
      - usr/lib/*/libkeybinder*
      - usr/share/applications/magnus.desktop
      - usr/share/pixmaps/magnus.png
bgstack15