forked from snapcore/snapd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
snapcraft.yaml
127 lines (124 loc) · 4.11 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
name: snapd
# TODO: enable this when the store is ready
# type: snapd
summary: Daemon and tooling that enable snap packages
description: |
Install, configure, refresh and remove snap packages. Snaps are
'universal' packages that work across many different Linux systems,
enabling secure distribution of the latest apps and utilities for
cloud, servers, desktops and the internet of things.
Start with 'snap list' to see installed snaps.
adopt-info: snapd
# build-base is needed here for snapcraft to build this snap as with "modern"
# snapcraft
build-base: core
grade: stable
license: GPL-3.0
# Note that this snap is unusual in that it has no "apps" section.
#
# It is started via re-exec on classic systems and via special
# handling in the core18 snap on Ubuntu Core Systems.
#
# Because snapd itself manages snaps it must currently run totally
# unconfined (even devmode is not enough).
#
# See the comments from jdstrand in
# https://forum.snapcraft.io/t/5547/10
parts:
snapd:
plugin: nil
source: .
build-snaps: [go/1.10/stable]
override-pull: |
snapcraftctl pull
# install build dependencies
export DEBIAN_FRONTEND=noninteractive
export DEBCONF_NONINTERACTIVE_SEEN=true
sudo apt-get build-dep -y ./
./get-deps.sh --skip-unused-check
# set version after installing dependencies so we have all the tools here
snapcraftctl set-version $(./mkversion.sh --output-only)
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
# if we are root, disable tests
if [ "$(id -u)" = "0" ]; then
DEB_BUILD_OPTIONS=nocheck
export DEB_BUILD_OPTIONS
fi
# run the real build (but just build the binary package, and don't
# bother compressing it too much)
dpkg-buildpackage -b -Zgzip -zfast
dpkg-deb -x $(pwd)/../snapd_*.deb $SNAPCRAFT_PART_INSTALL
# xdelta is used to enable delta downloads (even if the host does not have it)
xdelta3:
plugin: nil
stage-packages:
- xdelta3
stage:
- usr/bin/*
- usr/lib/*
- lib/*
# squashfs-tools are used by `snap pack`
squashfs-tools:
plugin: nil
stage-packages:
- squashfs-tools
stage:
- usr/bin/*
- usr/lib/*
- lib/*
# liblzma5 is part of core but the snapd snap needs to run even without core
liblzma5:
plugin: nil
stage-packages:
- liblzma5
stage:
- lib/*
# libc6 is part of core but we need it in the snapd snap for
# CommandFromSystemSnap
libc6:
plugin: nil
stage-packages:
- libc6
- libc-bin
stage:
- lib/*
- usr/lib/*
- lib64/*
- etc/ld.so.conf
- etc/ld.so.conf.d/*
override-stage: |
snapcraftctl stage
# fix symlinks of ld.so to be relative
if [ "$(readlink -f lib64/ld-linux-x86-64.so.2)" = "/lib/x86_64-linux-gnu/ld-2.23.so" ]; then
ln -f -s ../lib/x86_64-linux-gnu/ld-2.23.so lib64/ld-linux-x86-64.so.2
fi
if [ "$(readlink -f lib64/ld64.so.2)" = "/lib/powerpc64le-linux-gnu/ld-2.23.so" ]; then
ln -f -s ../lib/powerpc64le-linux-gnu/ld-2.23.so lib64/ld64.so.2
fi
# the version in Ubuntu 16.04 (cache v6)
fontconfig-xenial:
plugin: nil
source: https://github.com/snapcore/fc-cache-static-builder.git
override-build: |
./build-from-security.py xenial
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp -a fc-cache-xenial $SNAPCRAFT_PART_INSTALL/bin/fc-cache-v6
prime:
- bin/fc-cache-v6
# the version in Ubuntu 18.04 (cache v7)
fontconfig-bionic:
plugin: nil
source: https://github.com/snapcore/fc-cache-static-builder.git
override-build: |
./build-from-security.py bionic
mkdir -p $SNAPCRAFT_PART_INSTALL/bin
cp -a fc-cache-bionic $SNAPCRAFT_PART_INSTALL/bin/fc-cache-v7
prime:
- bin/fc-cache-v7