This repository has been archived by the owner on Mar 6, 2024. It is now read-only.
/
snapcraft.yaml
280 lines (266 loc) · 8.38 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
name: ubuntu-desktop-installer
version: git
summary: Ubuntu Desktop Installer
description: |
This project is a modern implementation of the Ubuntu Desktop installer,
using subiquity as a backend and Flutter for the UI.
grade: stable
confinement: classic
base: core22
issues: https://bugs.launchpad.net/ubuntu-desktop-installer/+filebug
contact: https://bugs.launchpad.net/ubuntu-desktop-installer/+filebug
apps:
subiquity-server:
command: bin/subiquity-server
daemon: simple
restart-condition: always
environment:
PATH_ORIG: $PATH
PYTHONPATH_ORIG: $PYTHONPATH
LD_LIBRARY_PATH_ORIG: $LD_LIBRARY_PATH
subiquity-loadkeys:
command: bin/subiquity/bin/subiquity-loadkeys
ubuntu-desktop-installer:
command: bin/ubuntu_desktop_installer
command-chain: [bin/launcher]
desktop: bin/data/flutter_assets/assets/ubuntu-desktop-installer.desktop
environment:
PATH: $SNAP/usr/bin:$SNAP/bin:$PATH
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/dri
GIO_MODULE_DIR: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET/gio/modules
LIVE_RUN: 1
LOG_LEVEL: debug
SNAP_PYTHON: python3
probert:
command: bin/probert
os-prober:
command: usr/bin/os-prober
parts:
curtin:
plugin: nil
source: https://git.launchpad.net/curtin
source-type: git
source-commit: f96c957c756d2856889ae977677de32647a1cbc9
override-pull: |
craftctl default
PACKAGED_VERSION="$(git describe --long --abbrev=9 --match=[0-9][0-9]*)"
sed -e "s,@@PACKAGED_VERSION@@,$PACKAGED_VERSION,g" -i curtin/version.py
override-build: &pyinstall |
# We install without dependencies because all dependencies come from
# archive packages.
# XXX: On core22, running `pip3 install --prefix xxx` does not do the
# right thing. The package ends up installed in xxx/local and the modules
# get installed to dist-packages instead of site-packages.
# See https://discuss.python.org/t/18240
# As a workaround, we use a fake user install to get the package
# installed in the expected place.
PYTHONUSERBASE="$CRAFT_PART_INSTALL" pip3 install --user --no-dependencies .
build-packages:
- python3-pip
organize:
lib/python*/site-packages/usr/lib/curtin: usr/lib/
probert:
plugin: nil
source: https://github.com/canonical/probert.git
source-type: git
source-commit: ae758355b610e389099abdb2397bb41ad49409ec
override-build: *pyinstall
build-packages:
- build-essential
- libnl-3-dev
- libnl-genl-3-dev
- libnl-route-3-dev
- pkg-config
- python3-dev
- python3-pip
build-attributes: [enable-patchelf]
stage:
- "*"
- -bin/python3*
subiquitydeps:
plugin: nil
build-attributes: [enable-patchelf]
stage-packages:
# This list includes the dependencies for curtin and probert as well,
# there doesn't seem to be any real benefit to listing them separately.
- cloud-init
- dctrl-tools
- iso-codes
- libpython3-stdlib
- libpython3.10-minimal
- libpython3.10-stdlib
- libsystemd0
- lsb-release
- ntfs-3g
- python3-aiohttp
- python3-apport
- python3-attr
- python3-bson
- python3-debian
- python3-jsonschema
- python3-minimal
- python3-oauthlib
- python3-pkg-resources
- python3-pyroute2
- python3-pyrsistent
- python3-pyudev
- python3-requests
- python3-requests-unixsocket
- python3-systemd
- python3-urwid
- python3-yaml
- python3-yarl
- python3.10-minimal
- ssh-import-id
- ubuntu-advantage-tools
# WSL specifics:
- language-selector-common
- locales
prime:
- -lib/systemd/system/*
flutter-git:
source: https://github.com/flutter/flutter.git
source-tag: 3.10.6
source-depth: 1
plugin: nil
override-build: |
mkdir -p $CRAFT_PART_INSTALL/usr/bin
mkdir -p $CRAFT_PART_INSTALL/usr/libexec
cp -r $CRAFT_PART_SRC $CRAFT_PART_INSTALL/usr/libexec/flutter
ln -s $CRAFT_PART_INSTALL/usr/libexec/flutter/bin/flutter $CRAFT_PART_INSTALL/usr/bin/flutter
$CRAFT_PART_INSTALL/usr/bin/flutter doctor
build-packages:
- clang
- cmake
- curl
- libgtk-3-dev
- ninja-build
- unzip
- xz-utils
- zip
override-prime: ""
ubuntu-desktop-installer:
after: [flutter-git]
source: .
source-type: git
plugin: nil
build-attributes: [enable-patchelf]
override-build: |
set -eux
mkdir -p $CRAFT_PART_INSTALL/bin/lib
cp snap/local/launcher $CRAFT_PART_INSTALL/bin/
cp snap/local/subiquity-server $CRAFT_PART_INSTALL/bin/
cp -r vendor/ubuntu-desktop-provision/packages/subiquity_client/subiquity $CRAFT_PART_INSTALL/bin/
mkdir -p $CRAFT_PART_INSTALL/etc/subiquity
cp -r snap/local/postinst.d $CRAFT_PART_INSTALL/etc/subiquity
# https://github.com/canonical/ubuntu-desktop-installer/issues/1146
(cd vendor/ubuntu-desktop-provision/packages/ubuntu_wizard && flutter pub get)
cd packages/ubuntu_desktop_installer
flutter pub get
flutter build linux --release -v
cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/bin/
ubuntu-wsl-setup:
after: [flutter-git]
source: .
source-type: git
plugin: nil
override-build: |
set -eux
# ubuntu-desktop-install will install subiquity in bin/subiquity. It’s not a real build-dep ordering though.
mkdir -p $CRAFT_PART_INSTALL/bin
mkdir -p $CRAFT_PART_INSTALL/usr/libexec
cd packages/ubuntu_wsl_setup
flutter pub get
flutter build linux --release -v
cp -r build/linux/*/release/bundle/* $CRAFT_PART_INSTALL/usr/libexec
cp -p ubuntu-wsl-setup $CRAFT_PART_INSTALL/bin/
# Create the theme empty directories for bindmounting the common-themes snap
mkdir -p $CRAFT_PART_INSTALL/data-dir/icons $CRAFT_PART_INSTALL/data-dir/sounds $CRAFT_PART_INSTALL/data-dir/themes
libraries:
plugin: nil
build-attributes: [enable-patchelf]
stage-packages:
- libatk1.0-0
- libcairo-gobject2
- libcairo2
- libegl-mesa0
- libegl1
# Needed for the dri drivers see github #2391
- libelf1
- libgl1
- libglib2.0-0
- libglib2.0-dev
- libgtk-3-0
- libpango-1.0-0
- libpangocairo-1.0-0
- libpng16-16
- libwayland-egl1
- libx11-6
- libdatrie1
- libdrm2
- libgbm1
- libglapi-mesa
- libgraphite2-3
- libxshmfence1
- libpciaccess0
- libvulkan1
- shared-mime-info
- libglib2.0-bin
- libibus-1.0-5
prime:
- usr/lib/*/libEGL*.so.*
- usr/lib/*/libGL*.so.*
- usr/lib/*/libX*.so.*
- usr/lib/*/liba*.so.*
- usr/lib/*/libcairo*.so.*
- usr/lib/*/libe*.so.*
- usr/lib/*/libf*.so.*
- usr/lib/*/libg*.so.*
- usr/lib/*/libharfbuzz*.so.*
- usr/lib/*/libibus*.so.*
- usr/lib/*/libpango*.so.*
- usr/lib/*/libpixman*.so.*
- usr/lib/*/libpng*.so.*
- usr/lib/*/libthai*.so.*
- usr/lib/*/libwayland*.so.*
- usr/lib/*/libxcb*.so.*
- usr/lib/*/libxkb*.so.*
- usr/lib/*/libdatrie*.so.*
- usr/lib/*/libdrm*.so.*
- usr/lib/*/libgbm*.so.*
- usr/lib/*/libglapi*.so.*
- usr/lib/*/libgraphite2*.so.*
- usr/lib/*/libxshmfence*.so.*
- usr/lib/*/libpciaccess*.so.*
- usr/lib/*/libsensors*.so.*
- usr/lib/*/libvulkan*.so.*
- usr/share/glvnd/egl_vendor.d
- usr/lib/*/gdk-pixbuf-2.0
- usr/lib/*/
- usr/bin/update-mime-database
- usr/bin/g*
- usr/share/mime
- -usr/lib/*/pkgconfig
- -usr/lib/pkgconfig
- -usr/share/pkgconfig
dri-no-patchelf:
after: [libraries]
plugin: nil
stage-packages:
- libgl1-mesa-dri
build-attributes:
- no-patchelf # Otherwise snapcraft may strip the build ID and cause the driver to crash
stage:
- usr/lib/${CRAFT_ARCH_TRIPLET}/dri
- usr/share/drirc.d
os-prober:
plugin: nil
stage-packages: [os-prober]
build-attributes: [enable-patchelf]
override-stage: |
craftctl default
for file in $(grep -lr /usr | grep 'usr/[^/]*/[^/]*-probe[sr]'); do
sed -i 's, \(/usr\), $SNAP\1,' $file
done
sed -i 's/mkdir "$tmpmnt"/mkdir -p "$tmpmnt"/' \
usr/lib/os-probes/50mounted-tests