-
Notifications
You must be signed in to change notification settings - Fork 32
/
snapcraft.yaml
106 lines (103 loc) · 3.66 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
name: core20
# version: "20"
adopt-info: bootstrap
summary: Runtime environment based on Ubuntu 20.04
description: |
The base snap based on the Ubuntu 20.04 release.
confinement: strict
type: base
build-base: core20
parts:
consoleconf-deb:
plugin: nil
source: https://github.com/CanonicalLtd/subiquity.git
source-type: git
source-branch: core/focal
override-pull: |
snapcraftctl pull
# install build dependencies
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
sudo -E apt-get build-dep -y ./
override-build: |
# unset the LD_FLAGS and LD_LIBRARY_PATH vars that snapcraft sets for us
# as those will point to the $SNAPCRAFT_STAGE which on re-builds will
# contain things like libc and friends that confuse the debian package
# build system
# TODO: should we unset $PATH to not include $SNAPCRAFT_STAGE too?
unset LD_FLAGS
unset LD_LIBRARY_PATH
# run the real build (but just build the binary package, and don't
# bother compressing it too much)
dpkg-buildpackage -b -uc -us -Zgzip -zfast
cp ../console-conf_*.deb ../subiquitycore_*.deb $SNAPCRAFT_PART_INSTALL
stage:
- -console-conf_*.deb
- -subiquitycore_*.deb
# XXX: Dirty hacks to enable building core20 on non-focal systems.
# See below for details.
override-prime: |
unset LD_LIBRARY_PATH;
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# ensure snapcraftctl is found, see
# https://github.com/snapcore/snapcraft/pull/2251
export PATH="$PATH:/snap/snapcraft/current/bin/scriptlet-bin"
snapcraftctl prime
avahi-daemon-equiv-deb:
plugin: nil
build-packages:
- equivs
override-build: |
cat > avahi-daemon.control << \EOF
Section: misc
Priority: optional
Standards-Version: 3.9.2
Architecture: all
Package: avahi-daemon
Version: 1000
Multi-Arch: foreign
Description: A dummy version of avahi-daemon
EOF
unset LD_FLAGS LD_LIBRARY_PATH
equivs-build avahi-daemon.control
cp avahi-daemon_*.deb $SNAPCRAFT_PART_INSTALL
stage:
- -avahi-daemon_*.deb
bootstrap:
after:
- consoleconf-deb
- avahi-daemon-equiv-deb
plugin: make
source: .
build-packages:
- shellcheck
- wget
- distro-info
- python3-debian
- python3-requests
- python3-yaml
# XXX: Dirty hacks to enable building core20 on non-focal systems.
# Without these overrides both the PATH and LD_LIBRARY_PATH contain paths
# in the part's install directory which binaries can be incompatible with
# the ones running on our system. We don't need those while running stage
# and prime anyway.
override-pull: |
unset LD_LIBRARY_PATH;
snapcraftctl set-version "$(/bin/date +%Y%m%d)"
snapcraftctl pull
override-stage: |
unset LD_LIBRARY_PATH;
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# ensure snapcraftctl is found, see
# https://github.com/snapcore/snapcraft/pull/2251
export PATH="$PATH:/snap/snapcraft/current/bin/scriptlet-bin"
snapcraftctl stage
override-prime: |
unset LD_LIBRARY_PATH;
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin"
# ensure snapcraftctl is found, see
# https://github.com/snapcore/snapcraft/pull/2251
export PATH="$PATH:/snap/snapcraft/current/bin/scriptlet-bin"
snapcraftctl prime
# ensure build-in tests are run
cd ${SNAPCRAFT_PART_SRC} && make test TESTDIR=${SNAPCRAFT_PRIME}