-
Notifications
You must be signed in to change notification settings - Fork 784
Expand file tree
/
Copy pathsnapcraft.yaml
More file actions
349 lines (332 loc) · 10.2 KB
/
snapcraft.yaml
File metadata and controls
349 lines (332 loc) · 10.2 KB
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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
# Generated by packaging/gui-less/generate-snapcraft.py — do not edit directly.
# Edit snap/snapcraft.yaml and re-run the script.
name: multipass
title: Multipass
icon: data/multipass.gui.svg
summary: Instant cloud VMs
description: |
Multipass is a tool to launch and manage cloud VMs on Windows, Mac and Linux
that simulates a cloud environment with support for cloud-init. Get on-demand
cloud VMs with clean integration to your IDE and version control on your
native platform.
license: GPL-3.0
adopt-info: multipass
confinement: strict
base: core24
platforms:
arm64:
amd64:
s390x:
ppc64el:
layout:
/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qemu:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qemu
/etc/fonts:
bind: $SNAP/etc/fonts
/usr/share/fonts:
bind: $SNAP/usr/share/fonts
/usr/share/icons:
bind: $SNAP/usr/share/icons
environment:
# GDK pixbuf
GDK_PIXBUF_MODULEDIR: $SNAP/usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/gdk-pixbuf-2.0/2.10.0/loaders
GDK_PIXBUF_MODULE_FILE: $SNAP_COMMON/loaders.cache
ARCH_TRIPLET: ${CRAFT_ARCH_TRIPLET_BUILD_FOR}
plugs:
all-home:
interface: home
read: all
apps:
multipassd:
command: bin/launch-multipassd
environment:
LD_LIBRARY_PATH: &library-path $SNAP/lib:$SNAP/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:$SNAP/usr/lib:$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
PATH: &path $SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH
QT_PLUGIN_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
XDG_DATA_HOME: $SNAP_COMMON/data
XDG_CACHE_HOME: $SNAP_COMMON/cache
XDG_CONFIG_HOME: &daemon-config $SNAP_DATA/config
DAEMON_CONFIG_HOME: *daemon-config
# temporary
daemon: simple
stop-timeout: 5m
plugs:
- all-home
- firewall-control
- kvm
- multipass-support
- network-bind
- network-control
- network-manager # for bridge creation
- network-observe # for network listing (to read `/sys/devices/**/net/*`)
- removable-media
- system-observe # to read the host's os-release
multipass:
environment:
<<:
LD_LIBRARY_PATH: *library-path
PATH: *path
QT_PLUGIN_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/qt6/plugins
XDG_DATA_HOME: $SNAP_USER_DATA/data
XDG_DATA_DIRS: $SNAP/usr/share:$SNAP_DATA/data
XDG_CACHE_HOME: $SNAP_USER_DATA/cache
XDG_CONFIG_HOME: $SNAP_USER_DATA/config
DAEMON_CONFIG_HOME: *daemon-config
# temporary
command: bin/launch-multipass
completer: etc/bash_completion.d/snap.multipass
plugs:
- all-home
- network
parts:
qt-ssl-plugin:
plugin: nil
stage-packages:
- qt6-qpa-plugins
prime:
- usr/lib/*/qt6/plugins/tls/*
multipass:
after: [qt-ssl-plugin]
plugin: cmake
build-snaps:
- cmake
build-environment:
- PATH: /snap/bin:$PATH
- PYTHON: /usr/bin/python3
- PYTHONPATH: ""
- VCPKG_FORCE_SYSTEM_BINARIES: 1
- CMAKE_PRESET: snap
- CLANG_VERSION: "19"
- CXX: clang++-${CLANG_VERSION}
- CC: clang-${CLANG_VERSION}
- CMAKE_PRESET: snap-gui-less
build-packages:
- on arm64: [libgles2-mesa-dev]
- build-essential
- ccache
- lcov
- clang-19 # \
- lld-19 # } have to keep in sync with CLANG_VERSION above :'(
- llvm-19 # /
- git
- libapparmor-dev
- libgl1-mesa-dev
- libsystemd-dev
- libssl-dev
- pkg-config
- zip
- unzip
- curl
- libkeybinder-3.0-dev
- ninja-build
- libgtkmm-3.0-dev
# https://github.com/microsoft/vcpkg/issues/47920
- libltdl-dev # vcpkg-systemd: libxcrypt requires libltdl-dev from the system package manager
- python3-pip
stage-packages:
- apparmor
- libpng16-16
- libxml2
- dnsmasq-base
- dnsmasq-utils
- libkeybinder-3.0-dev
- libatkmm-1.6-1v5
- libcairomm-1.0-1v5
- libgtkmm-3.0-1t64
- libglibmm-2.4-1t64
- libpangomm-1.4-1v5
stage:
- -**/glvnd
- -**/X11
- -usr/bin/aa-*
- -usr/include
- -usr/lib/cmake
- -usr/lib/*/libEGL_mesa.so.*
- -usr/lib/*/libgirepository-1.0.so.*
- -usr/lib/*/libgthread-2.0.so*
- -usr/lib/*/libGLX_mesa.so.*
- -usr/lib/*/libGLX_indirect.so.*
- -usr/lib/*/libXxf86vm.so.*
- -usr/lib/*/libxcb-dri2.so.*
- -usr/lib/*/libxcb-present.so.*
- -usr/lib/*/libxshmfence.so.*
- -usr/lib/*/libicuio.so.*
- -usr/lib/*/libicutest.so.*
- -usr/lib/*/libicutu.so.*
- -usr/lib/*/libicui18n.so.*
- -usr/lib/*/libglibmm_generate_extra_defs-*.so*
- -usr/lib/libdart_ffi.so
- -usr/lib/*/libLLVM-*.so*
- -usr/lib/*/libdrm*
- -usr/lib/*/libglapi.so*
- -usr/lib/*/libpciaccess.so*
- -usr/lib/*/libsensors.so*
- -usr/lib/*/libxcb-dri3.so*
- -usr/lib/*/dri
- -usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/libcolordprivate.so.*
- -usr/lib/${CRAFT_ARCH_TRIPLET_BUILD_FOR}/libdconf.so.*
- -usr/share/apport
- -usr/share/bug
- -usr/share/doc*
- -usr/share/drirc.d
- -usr/share/gettext
- -usr/share/icons/Adwaita
- -usr/share/icons/DMZ-Black
- -usr/share/icons/Humanity*
- -usr/share/icons/LoginIcons
- -usr/share/icons/hicolor
- -usr/share/icons/ubuntu-*
- -usr/share/lib*
- -usr/share/lintian
- -usr/share/man
- -usr/share/mime
- -usr/share/pkgconfig
- -usr/share/thumbnailers
prime:
- -protobuf
source: https://github.com/canonical/multipass.git
source-type: git
override-pull: |
set -e
if ! snap list rustup >/dev/null 2>&1; then
snap install rustup --classic
rustup default stable
fi
# https://github.com/microsoft/vcpkg/issues/37279
# vcpkg-systemd: required for meson.build
python3 -m pip install --break-system-packages jinja2
# Update default clang
update-alternatives --install /usr/bin/clang clang /usr/bin/clang-${CLANG_VERSION} 150
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-${CLANG_VERSION} 150
# Do the CMake configure at the pull step so we can generate the compile_commands.json
# for the tool consumption.
craftctl default
cmake --preset "$CMAKE_PRESET" -S ${SNAPCRAFT_PART_SRC_WORK} -B ${SNAPCRAFT_PART_BUILD_WORK}
override-build: |
# Build the project.
cmake --build . -- -j"${SNAPCRAFT_PARALLEL_BUILD_COUNT}"
DESTDIR="${SNAPCRAFT_PART_INSTALL}" cmake --build . --target install
mkdir -p ${CRAFT_PART_INSTALL}/etc/bash_completion.d/
echo 'export PATH="${PATH}:/snap/bin:/var/lib/snapd/snap/bin"' > ${CRAFT_PART_INSTALL}/etc/bash_completion.d/snap.multipass
cat ../src/completions/bash/multipass >> ${CRAFT_PART_INSTALL}/etc/bash_completion.d/snap.multipass
VERSION=$( awk -F\" '/version_string/ { print $2 }' gen/multipass/version.h )
craftctl set version=${VERSION}
craftctl set grade=$( echo ${VERSION} | grep -qe '^[0-9]\+\.[0-9]\+\.[0-9]\+\($\|-rc\)' && echo stable || echo devel )
[ -f ${CRAFT_PART_INSTALL}/usr/share/applications/multipass.gui.desktop ] && \
sed -i -e 's@^Icon=\(.\+\)$@Icon=/usr/share/icons/hicolor/scalable/apps/\1.svg@' ${CRAFT_PART_INSTALL}/usr/share/applications/multipass.gui.desktop
cd ${CRAFT_PART_SRC}/3rd-party
find . -type f \( -name 'LICENSE*' -o -path '*/LICENSE*/*' \) -print0 | xargs -0 -I FILE install --mode=644 -D --no-target-directory FILE ${CRAFT_PART_INSTALL}/licenses/FILE
qemu:
build-environment:
- PYTHONPATH: ""
- LD_LIBRARY_PATH: ""
- XDG_DATA_DIRS: /root/stage/usr/share:/usr/share
- PKG_CONFIG_PATH: ""
- PYTHON: /usr/bin/python3
source: https://github.com/canonical/qemu.git
source-type: git
source-tag: v10.0.3+9p-uid-gid-map
source-depth: 1
source-submodules: []
plugin: autotools
autotools-configure-parameters:
- --enable-virtfs
- --disable-bochs
- --disable-cloop
- --disable-docs
- --disable-guest-agent
- --disable-parallels
- --disable-qed
- --disable-libiscsi
- --disable-vnc
- --disable-xen
- --disable-dmg
- --disable-replication
- --disable-snappy
- --disable-lzo
- --disable-vvfat
- --disable-curl
- --disable-tests
- --disable-nettle
- --disable-libusb
- --disable-bzip2
- --disable-gcrypt
- --disable-gnutls
- --disable-slirp
- --disable-user
- --disable-libvduse
- --disable-vduse-blk-export
- --disable-dbus-display
- --firmwarepath=/snap/multipass/current/qemu/
- --prefix=/usr
- --libdir=/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR
- --libexecdir=/usr/lib/qemu
- --enable-strip
build-packages:
- libattr1-dev
- libcap-ng-dev
- libglib2.0-dev
- libpixman-1-dev
- libseccomp-dev
- python3-venv
- gettext
- python3-tomli
stage-packages:
- libpixman-1-0
stage:
- -usr/include
- -usr/lib/*/libssh*
- -qemu/efi-*.rom
- -qemu/pxe-*.rom
organize:
usr/lib/qemu/*: usr/bin/
usr/share/qemu/*: qemu/
override-build: |-
set -ex
# Mangle the configure a bit
QEMUARCH="$(uname -m)"
[ "$QEMUARCH" = "ppc64le" ] && QEMUARCH="ppc64"
sed -i "s/^unset target_list$/target_list=\"${QEMUARCH}-softmmu\"/" configure
set +ex
craftctl default
prime:
- usr/bin/qemu-system-*
- usr/bin/qemu-img*
- usr/bin/virtfs-proxy-helper*
- usr/bin/virtiofsd*
- usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/*
- lib/*/libpixman*so*
- qemu/keymaps*
- qemu/efi-virtio.rom*
- qemu/kvmvapic.bin*
- qemu/vgabios-*.bin*
- qemu/slof.bin*
- qemu/bios-256k.bin*
- qemu/s390-ccw.img*
- -usr/lib/*/pkgconfig
qemu-firmware:
plugin: nil
override-pull: ""
stage-packages:
- ipxe-qemu
- on amd64: [ovmf]
- on arm64: [qemu-efi]
organize:
usr/share/ovmf/*: qemu/
usr/lib/ipxe/qemu/*: qemu/
usr/share/qemu-efi-aarch64/*: qemu/
prime:
- qemu/*
kvm-support:
plugin: nil
override-pull: ""
stage-packages:
- on amd64: [msr-tools]
stage:
- -usr/share/doc
- -usr/share/man
glue:
plugin: dump
source: https://github.com/canonical/multipass.git
source-type: git
source-subdir: snap-wrappers