-
Notifications
You must be signed in to change notification settings - Fork 158
/
snapcraft.yaml
257 lines (223 loc) · 7.34 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
name: subiquity
base: core24
version: git
summary: Ubuntu installer
description: The Ubuntu server installer
confinement: classic
source-code: https://github.com/canonical/subiquity
issues: https://bugs.launchpad.net/subiquity/+filebug
contact: https://bugs.launchpad.net/subiquity/+filebug
apps:
subiquity:
command: usr/bin/subiquity-cmd $SNAP/usr/bin/python3.12 -m subiquity
environment:
# Save original values of environment variables, we want to restore them
# for the debug shell (LP: #1975629) and restart (LP: #1978139)
PYTHONPATH_ORIG: $PYTHONPATH
PATH_ORIG: $PATH
PYTHONIOENCODING_ORIG: $PYTHONIOENCODING
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT_ORIG: $SUBIQUITY_ROOT
SUBIQUITY_ROOT: $SNAP
PYTHON_ORIG: $PYTHON
PYTHON: $SNAP/usr/bin/python3.12
# APPORT_DATA_DIR must be set before the `apport` python module is
# imported.
APPORT_DATA_DIR_ORIG: $APPORT_DATA_DIR
APPORT_DATA_DIR: $SNAP/share/apport
probert:
command: usr/bin/subiquity-cmd $SNAP/usr/bin/python3.12 $SNAP/bin/probert
environment:
PYTHON: $SNAP/usr/bin/python3.12
curtin:
command: usr/bin/subiquity-cmd $SNAP/bin/curtin
environment:
PYTHONIOENCODING: utf-8
PYTHON: $SNAP/usr/bin/python3.12
PY3OR2_PYTHON: $SNAP/usr/bin/python3.12
PATH: $PATH:$SNAP/bin
subiquity-server:
command: usr/bin/subiquity-server
daemon: simple
restart-condition: always
environment:
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT: $SNAP
PYTHONPATH_ORIG: $PYTHONPATH
PYTHON_ORIG: $PYTHON
PYTHON: $SNAP/usr/bin/python3.12
PY3OR2_PYTHON: $SNAP/usr/bin/python3.12
PATH_ORIG: $PATH
PATH: $PATH:$SNAP/bin:$SNAP/sbin
# APPORT_DATA_DIR must be set before the `apport` python module is
# imported.
APPORT_DATA_DIR_ORIG: $APPORT_DATA_DIR
APPORT_DATA_DIR: $SNAP/share/apport
subiquity-service:
command: usr/bin/subiquity-service
daemon: simple
restart-condition: always
environment:
# Save original values of environment variables, we want to restore them
# for the debug shell (LP: #1975629).
PYTHONPATH_ORIG: $PYTHONPATH
PATH_ORIG: $PATH
PYTHONIOENCODING_ORIG: $PYTHONIOENCODING
PYTHONIOENCODING: utf-8
SUBIQUITY_ROOT_ORIG: $SUBIQUITY_ROOT
SUBIQUITY_ROOT: $SNAP
PYTHON_ORIG: $PYTHON
PYTHON: $SNAP/usr/bin/python3.12
# APPORT_DATA_DIR must be set before the `apport` python module is
# imported.
APPORT_DATA_DIR_ORIG: $APPORT_DATA_DIR
APPORT_DATA_DIR: $SNAP/share/apport
parts:
curtin:
plugin: nil
source: https://git.launchpad.net/curtin
source-type: git
source-commit: "0ded564bde89cbf2ede7a9c3d6e1c260688b37cb"
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 --break-system-packages .
build-packages:
- python3-pip
organize:
lib/python*/site-packages/usr/lib/curtin: usr/lib/
subiquity:
plugin: nil
source: .
source-type: git
override-build: *pyinstall
build-packages:
- gettext
- lsb-release
- python3-pip
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.
- iso-codes
- libpython3-stdlib
- libpython3.12-minimal
- libpython3.12-stdlib
- libsystemd0
- lsb-release
- ntfs-3g
- python3-aiohttp
- python3-apport
- python3-attr
- python3-bson
- python3-debian
- python3-distro-info
- python3-jsonschema
- python3-minimal
- python3-more-itertools
- python3-oauthlib
- python3-passlib
- python3-pkg-resources
- python3-pyroute2
- python3-pyrsistent
- python3-pyudev
- python3-requests
- python3-requests-unixsocket
- python3-systemd
- python3-urwid
- python3-yaml
- python3-yarl
- python3.12-minimal
- ssh-import-id
- ubuntu-advantage-tools
organize:
bin/subiquity-tui: usr/bin/subiquity
bin/subiquity-service: usr/bin/subiquity-service
bin/subiquity-server: usr/bin/subiquity-server
bin/subiquity-cmd: usr/bin/subiquity-cmd
bin/subiquity-umockdev-wrapper: system_scripts/subiquity-umockdev-wrapper
bin/subiquity-legacy-cloud-init-extract: system_scripts/subiquity-legacy-cloud-init-extract
bin/subiquity-legacy-cloud-init-validate: system_scripts/subiquity-legacy-cloud-init-validate
build-attributes:
- enable-patchelf
users-and-groups:
plugin: nil
build-packages:
- user-setup
override-build: |
echo "get passwd/user-default-groups" | \
debconf-communicate user-setup | \
cut -d ' ' -f 2- > $CRAFT_PART_INSTALL/users-and-groups
stage:
- users-and-groups
user-setup:
plugin: nil
source: https://git.launchpad.net/ubuntu/+source/user-setup
source-type: git
override-build: cp -a reserved-usernames $CRAFT_PART_INSTALL/
stage:
- reserved-usernames
keyboard-data:
plugin: nil
build-packages:
- console-setup
- locales
- python3-attr
- python3-yaml
override-build: |
PYTHONPATH=$CRAFT_PROJECT_DIR/ $CRAFT_PROJECT_DIR/scripts/make-kbd-info.py
cp $CRAFT_PROJECT_DIR/kbds/keyboard-configuration.yaml \
$CRAFT_PART_INSTALL/kbds/keyboard-configuration.yaml
stage:
- kbds/
font:
plugin: dump
source: .
source-type: git
organize:
font/subiquity.psf: subiquity.psf
stage:
- subiquity.psf
languagelists:
plugin: nil
build-packages:
- localechooser-data
override-build: |
grep '^path-exclude=.*LC_MESSAGES.*' /etc/dpkg/dpkg.cfg.d/excludes && {
sed -i 's/^path-exclude.*LC_MESSAGES.*/#\0/g' /etc/dpkg/dpkg.cfg.d/excludes
apt-get -y install --reinstall iso-codes
} || true
$CRAFT_PROJECT_DIR/scripts/make-language-lists $CRAFT_PROJECT_DIR/po > $CRAFT_PART_INSTALL/languagelist
stage:
- languagelist
probert:
plugin: nil
source: https://github.com/canonical/probert.git
source-type: git
source-commit: "83d25c873a4a7d93c158d76da86cb9c612c29572"
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
management-script:
plugin: nil
override-build:
cp $CRAFT_PROJECT_DIR/scripts/management-script $CRAFT_PART_INSTALL/management-script
stage:
- management-script