forked from ubuntu/snapcraft-desktop-helpers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
283 lines (281 loc) · 7.97 KB
/
snapcraft.yaml
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
name: desktop-helpers
version: 1
summary: Various technology desktop helpers for snapcraft
description: |
Note: We are currently in the process of moving most of the functionality of the
desktop helpers to Snapcraft Extensions. The extensions are much easier to use
and contain many improvements. Please read the documentation on snapping
desktop applications to see what the best way is to create a snap for
your application: https://forum.snapcraft.io/t/desktop-applications/13034
.
Helpers for gtk2, gtk3, qt4 and qt5 or gnome-platform and glib minimal launchers.
It brings the necessary code and exports for binding and using those
desktop technologies in a relocatable fashion, enabling binding with
global desktop theme, icon theme, image caching, fonts, mimetype handlers
application global menu and gsettings integration.
It also brings basic ubuntu dependency packages.
.
Usage:
1. copy the part of the toolkit you need to your snapcraft.yaml file:
- gtk2, gtk3, qt4 and qt5 corresponds to their respective toolkit
main dependencies and default choices.
- gnome-platform is similar to gtk3 without the extra depends, it's
meant to be used with the gnome platform which already includes those.
- glib-only enables to compile mime types and gsettings infos. If you
added your own graphical drivers, it will link them as well.
2. prepend your command with "desktop-launch", like:
commands: "desktop-launch foo" if foo is in $PATH. You can as well
specify: "desktop-launch $SNAP/foo".
3. add needed plugs to your application:
- for graphical application:
plugs: [x11] or:
[unity7] for appmenu, input methods, a11y integration. And/or:
[desktop] for GNOME Shell/Plasma
[wayland] for Wayland compositors
See https://forum.snapcraft.io/t/the-desktop-interfaces/2042
for details
- if your application needs hw acceleration:
plugs: [opengl]
- for sound playback:
plugs: [audio-playback, pulseaudio]
- for sound playback and recording:
plugs: [audio-playback, audio-record, pulseaudio]
- accessing to user's home directory:
plugs: [home]
- read/write to gsettings:
plugs: [gsettings]
- if using "desktop" and need a11y or other input methods:
plugs: [desktop-legacy]
- use of the shared platform snap content, first define the plug:
plugs:
gnome-3-26-1604:
interface: content
target: gnome-platform
default-provider: gnome-3-26-1604:gnome-3-26-1604
and then make your apps use it:
plugs: [gnome-3-26-1604]
Note that an empty "gnome-platform" directory will be created for you
in your snap.
confinement: strict
parts:
desktop:
plugin: nil
gtk2:
source: .
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk2"]
build-packages:
- libgtk2.0-dev
stage-packages:
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk2.0-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk2.0-bin
- unity-gtk2-module
- libappindicator1
- locales-all
- ibus-gtk
- libibus-1.0-5
gtk3:
source: .
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- libgtk-3-dev
stage-packages:
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk-3-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk-3-bin
- unity-gtk3-module
- libappindicator3-1
- locales-all
- xdg-user-dirs
- ibus-gtk3
- libibus-1.0-5
qt4:
source: .
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt4"]
build-packages:
- libqt4-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqtgui4
- libgdk-pixbuf2.0-0
- libqt4-svg # for loading icon themes which are svg
- appmenu-qt
- locales-all
- sni-qt
qt5:
source: .
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- qtbase5-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- try: [appmenu-qt5] # not available on core18
- locales-all
glib-only:
source: .
source-subdir: glib-only
plugin: make
build-packages:
- libglib2.0-dev
stage-packages:
- libglib2.0-bin
desktop-gtk2:
source: .
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk2"]
build-packages:
- build-essential
- libgtk2.0-dev
stage-packages:
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk2.0-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk2.0-bin
- unity-gtk2-module
- locales-all
- libappindicator1
- xdg-user-dirs
- ibus-gtk
- libibus-1.0-5
desktop-gtk3:
source: .
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- build-essential
- libgtk-3-dev
stage-packages:
- libxkbcommon0 # XKB_CONFIG_ROOT
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libgtk-3-0
- libgdk-pixbuf2.0-0
- libglib2.0-bin
- libgtk-3-bin
- unity-gtk3-module
- libappindicator3-1
- locales-all
- xdg-user-dirs
- ibus-gtk3
- libibus-1.0-5
- fcitx-frontend-gtk3
desktop-qt4:
source: .
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt4"]
build-packages:
- build-essential
- libqt4-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqtgui4
- libgdk-pixbuf2.0-0
- libqt4-svg # for loading icon themes which are svg
- appmenu-qt
- locales-all
- sni-qt
- xdg-user-dirs
desktop-qt5:
source: .
source-subdir: qt
plugin: make
make-parameters: ["FLAVOR=qt5"]
build-packages:
- build-essential
- qtbase5-dev
- dpkg-dev
stage-packages:
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- adwaita-icon-theme
- gnome-themes-standard
- shared-mime-info
- libqt5gui5
- libgdk-pixbuf2.0-0
- libqt5svg5 # for loading icon themes which are svg
- try: [appmenu-qt5] # not available on core18
- locales-all
- xdg-user-dirs
- fcitx-frontend-qt5
desktop-glib-only:
source: .
source-subdir: glib-only
plugin: make
build-packages:
- libglib2.0-dev
stage-packages:
- libglib2.0-bin
desktop-gnome-platform:
source: .
source-subdir: gtk
plugin: make
make-parameters: ["FLAVOR=gtk3"]
build-packages:
- gcc
override-build: |
snapcraftctl build
mkdir -pv $SNAPCRAFT_PART_INSTALL/gnome-platform