-
Notifications
You must be signed in to change notification settings - Fork 41
Expand file tree
/
Copy pathsnapcraft.yaml
More file actions
262 lines (251 loc) · 7.65 KB
/
Copy pathsnapcraft.yaml
File metadata and controls
262 lines (251 loc) · 7.65 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
#
# Copyright (C) 2020 Matthias Klumpp <matthias@tenstral.net>
# Copyright (C) 2020 Canonical Ltd
# Author: Iain Lane <iain@orangesquash.org.uk>
#
# SPDX-License-Identifier: FSFAP
#
# This Snapcraft file and the resulting Snap is NOT OFFICIALLY SUPPORTED.
# If you can, please use a provided native build for your distribution.
# Patches to improve this file are very welcome though, and so is testing the Snap!
#
# This snap is strict, but it has an important limitation:
# - it needs read/write access to wherever the user puts the workspace
# definition (could be anywhere, but most commonly it's in /srv, in /home or
# in /var), access to a local archive mount (can be in /mnt), and that should
# be it (unless optipng and ffprobe have extra requirements).
#
# Until that is overcome, this snap should be installed using `--devmode` to
# effectively disable the confinement.
#
# This Snap is autobuilt, you can check its status at https://build.snapcraft.io/user/ximion/appstream-generator
name: appstream-generator
license: LGPL-3.0
base: core26
adopt-info: appstream-generator
confinement: strict
grade: stable
platforms:
amd64:
arm64:
apps:
appstream-generator:
command: usr/bin/appstream-generator.wrapper
extensions: [gnome]
common-id: org.freedesktop.appstream.generator
plugs:
- network
- home
environment:
GSETTINGS_SCHEMA_DIR: "$SNAP/usr/share/glib-2.0/schemas"
GIO_EXTRA_MODULES: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gio/modules"
layout:
/usr/share/appstream:
bind: $SNAP/usr/share/appstream
/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0:
bind: $SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0
/usr/share/i18n:
bind: $SNAP/usr/share/i18n
/usr/share/mime:
bind: $SNAP/usr/share/mime
parts:
appstream:
source: https://github.com/ximion/appstream.git
source-type: git
source-tag: 'v1.1.2'
plugin: meson
build-environment:
- DESTDIR: $CRAFT_PART_INSTALL
- LD_LIBRARY_PATH: >
$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:
$CRAFT_STAGE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
meson-parameters:
- --prefix=/usr
- --buildtype=debugoptimized
- -Dcompose=true
- -Dapidocs=false
- -Dsystemd=false
build-packages:
- build-essential
- docbook-xml
- docbook-xsl
- gettext
- gobject-introspection
- gperf
- itstool
- libcurl4-gnutls-dev
- liblzma-dev
- libffi-dev
- libfyaml-dev
- libgirepository1.0-dev
- libglib2.0-dev
- libstemmer-dev
- libxml2-dev
- libxmlb-dev
- libzstd-dev
- xsltproc
stage-packages:
- libcurl3t64-gnutls
- libfyaml0
- libicu74
- libstemmer0d
- libxml2
- libzstd1
appstream-generator:
source: .
source-type: git
parse-info: [usr/share/metainfo/org.freedesktop.appstream.generator.metainfo.xml]
override-pull: |
craftctl default
# set version from Git
craftctl set version=$(git describe --always | sed -e 's/v//;s/-/+git/;y/-/./')
build-environment:
- NINJAFLAGS: -v
- PATH: >
$CRAFT_STAGE/usr/bin:$CRAFT_STAGE/usr/sbin:${PATH}
- PKG_CONFIG_PATH: >
$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/pkgconfig:
$CRAFT_STAGE/usr/lib/pkgconfig:
$CRAFT_STAGE/usr/share/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}
- LD_LIBRARY_PATH: >
$CRAFT_STAGE/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR:
$CRAFT_STAGE/usr/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
plugin: meson
meson-parameters:
- --prefix=/usr
- --buildtype=debugoptimized
- -Ddownload-js=true
override-build: |
set -eux
craftctl default
meson test -C "${CRAFT_PART_BUILD}" --print-errorlogs --no-stdsplit --verbose
override-prime: |
set -eux
craftctl default
for dir in usr/lib/*/gdk-pixbuf-2.0; do
if [ -d "${dir}" ]; then
for subdir in "${dir}"/*; do
if [ -d "${subdir}" ] && [ -d "${subdir}/loaders" ]; then
GDK_PIXBUF_MODULEDIR="$(pwd)/${subdir}/loaders" "${dir}/gdk-pixbuf-query-loaders" > "${subdir}/loaders.cache"
sed -i "s,$(pwd),," "${subdir}/loaders.cache"
fi
done
fi
done
update-mime-database -V usr/share/mime/
usr/lib/${CRAFT_ARCH_TRIPLET}/glib-2.0/glib-compile-schemas usr/share/glib-2.0/schemas
after:
- appstream
build-packages:
- curl
- docbook-xsl
- docbook-xml
- ffmpeg
- npm
- catch2
- libarchive-dev
- libbackward-cpp-dev
- libcairo2-dev
- libcurl4-gnutls-dev
- libfontconfig1-dev
- libfreetype6-dev
- libfyaml-dev
- libgdk-pixbuf2.0-dev
- libglib2.0-dev
- liblmdb-dev
- libpango1.0-dev
- librsvg2-dev
- libtbb-dev
- libunwind-dev
- libxml2-dev
- pkgconf
- xsltproc
stage-packages:
- ffmpeg
- gdb
- glib-networking
- libarchive13t64
- libc-bin
- libcairo2
- libcurl3t64-gnutls
- libdatrie1
- libfontconfig1
- libfreetype6
- libfyaml0
- libgdk-pixbuf2.0-0
- libglib2.0-0t64
- libglib2.0-bin
- libglu1-mesa
- libglut3.12
- libgraphite2-3
- libharfbuzz0b
#- libjxl-gdk-pixbuf
- liblmdb0
- libpango-1.0-0
- libpangocairo-1.0-0
- libpangoft2-1.0-0
- libpixman-1-0
- libpng16-16t64
- librsvg2-2
- librsvg2-common
- libslang2
- libthai0
- libx11-6
- libxau6
- libxcb-render0
- libxcb-shm0
- libxcb1
- libxdmcp6
- libxext6
- libxrender1
- locales
- locales-all
- optipng
- shared-mime-info
prime:
- -usr/lib/*/libglib-*
- -usr/lib/*/libgio*
- -usr/lib/*/libgmodule*
- -usr/lib/*/libgobject*
- -usr/lib/*/libgthread*
- -usr/lib/*/pkgconfig/gio*
- -usr/lib/*/pkgconfig/glib-2.0.pc
- -usr/lib/*/pkgconfig/gmodule*
- -usr/lib/*/pkgconfig/gobject-2.0.pc
- -usr/lib/*/pkgconfig/gthread-2.0.pc
# This is a work-around for the broken Gdk Pixbuf in the Gnome SDK
#
# https://github.com/ubuntu/gnome-sdk/issues/357
#
# that would manifest in appstream-generator's failure to generate
# screenshots with
#
# ERROR: The currently used GdkPixbuf does not seem to support all image
# formats we require to run normally (png/svg/jpeg). This may be a problem
# with your installation of appstream-generator or gdk-pixbuf.
#
# This part merely ensures appstream-generator is run with
# GDK_PIXBUF_MODULE{DIR,_FILE} pointing to the libraries staged in this snap.
#
# If
#
# https://github.com/canonical/snapcraft-desktop-integration/pull/41
#
# goes in, this part can be deleted and replaced by
#
# - GDK_PIXBUF_MODULEDIR: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0/2.10.0/loaders"
# - GDK_PIXBUF_MODULE_FILE: "$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0/2.10.0/loaders.cache"
#
# in apps.*.environment for the sake of elegance and clarity.
launcher:
plugin: nil
override-prime: |
mkdir -p $CRAFT_PRIME
launcher=$CRAFT_PRIME/usr/bin/appstream-generator.wrapper
cat > "$launcher" <<EOF
#!/bin/sh
export GDK_PIXBUF_MODULEDIR=\$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0/2.10.0/loaders
export GDK_PIXBUF_MODULE_FILE=\$SNAP/usr/lib/$CRAFT_ARCH_TRIPLET_BUILD_FOR/gdk-pixbuf-2.0/2.10.0/loaders.cache
\$SNAP/usr/bin/appstream-generator "\$@"
EOF
chmod +x "$launcher"