forked from alexmurray/emacs-snap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsnapcraft.yaml
277 lines (272 loc) · 7.39 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
name: emacs
title: GNU Emacs
version: "29.1"
summary: GNU Emacs is the extensible self-documenting text editor
description: |
Emacs is the extensible, customizable, self-documenting real-time
display editor.
Features include:
* Content-aware editing modes, including syntax coloring, for many file types.
* Complete built-in documentation, including a tutorial for new users.
* Full Unicode support for nearly all human scripts.
* Highly customizable, using Emacs Lisp code or a graphical interface.
* An entire ecosystem of functionality beyond text editing, including a project
planner, mail and news reader, debugger interface, calendar, and more.
* A packaging system for downloading and installing extensions.
This snap is built via the build.snapcraft.io service from the
snapcraft.yaml definition at https://github.com/alexmurray/emacs-snap to
ensure source and build transparency.
base: core20
grade: stable
confinement: classic
license: GPL-3.0+
compression: lzo
apps:
emacs:
command-chain:
- setup-env
command: usr/bin/emacs
desktop: usr/share/applications/emacs.desktop
emacsclient:
command: emacsclient
desktop: usr/share/applications/emacsclient.desktop
ctags:
command: usr/bin/ctags
ebrowse:
command: usr/bin/ebrowse
etags:
command: usr/bin/etags
parts:
tree-sitter:
plugin: make
source: https://github.com/tree-sitter/tree-sitter.git
source-tag: v0.20.8
build-environment:
- PREFIX: "/usr"
emacs:
after: [tree-sitter]
plugin: autotools
source: https://mirrors.ocf.berkeley.edu/gnu/emacs/emacs-29.1.tar.xz
source-checksum: sha256/d2f881a5cc231e2f5a03e86f4584b0438f83edd7598a09d24a21bd8d003e2e01
autotools-configure-parameters:
[
"--prefix=/snap/emacs/current/usr",
"--with-x-toolkit=gtk3",
"--without-xaw3d",
"--with-modules",
"--with-cairo",
"--with-native-compilation=aot",
"--with-xinput2",
"--with-tree-sitter",
"--with-json"
]
organize:
snap/emacs/current/usr: usr
build-packages:
- autoconf
- automake
- bsd-mailx
- dbus-x11
- debhelper
- dpkg-dev
- gawk
- gcc-10
- g++-10
- libacl1-dev
- libasound2-dev
- libdbus-1-dev
- libgccjit-10-dev
- libgif-dev
- libgnutls28-dev
- libgpm-dev
- libgtk-3-dev
- libjansson-dev
- libjpeg-dev
- liblcms2-dev
- liblockfile-dev
- libm17n-dev
- libncurses5-dev
- liboss4-salsa2
- libotf-dev
- libpng-dev
- librsvg2-dev
- libselinux1-dev
- libsqlite3-dev
- libsystemd-dev
- libtiff-dev
- libxi-dev
- libxml2-dev
- libxpm-dev
- libxt-dev
- procps
- quilt
- sharutils
- texinfo
- zlib1g-dev
stage-packages:
- gcc-10 # for tree-sitter
- g++-10 # for tree-sitter
- gvfs
- ibus-gtk3
- libasound2
- libaspell15
- libasyncns0
- libatk-bridge2.0-0
- libatk1.0-0
- libatspi2.0-0
- libbrotli1
- libc6 # required for native-comp
- libc6-dev # required for native-comp
- libcairo-gobject2
- libcairo2
- libcanberra-gtk3-0
- libcanberra-gtk3-module
- libcanberra0
- libcroco3
- libdatrie1
- libdb5.3
- libdrm2
- libegl1
- libenchant1c2a
- libepoxy0
- libflac8
- libfontconfig1
- libfreetype6
- libgbm1
- libgccjit0
- libgccjit-10-dev
- libgcc-s1
- libgdk-pixbuf2.0-0
- libgif7
- libgl1
- libglvnd0
- libglx0
- libgpm2
- libgraphite2-3
- libgstreamer-gl1.0-0
- libgstreamer-plugins-base1.0-0
- libgstreamer1.0-0
- libgtk-3-0
- libgudev-1.0-0
- libharfbuzz-icu0
- libharfbuzz0b
- libhyphen0
- libibus-1.0-5
- libice6
- libicu66
- libisl22
- libjansson4
- libjbig0
- libjpeg-turbo8
- liblcms2-2
- liblockfile1
- libltdl7
- libm17n-0
- libmpc3
- libmpfr6
- libnotify4
- libnss-mdns
- libnss-myhostname
- libnss-sss
- libnss-systemd
- libogg0
- liborc-0.4-0
- libotf0
- libpango-1.0-0
- libpangocairo-1.0-0
- libpangoft2-1.0-0
- libpixman-1-0
- libpng16-16
- libpulse0
- librsvg2-2
- libsasl2-2
- libsecret-1-0
- libsm6
- libsndfile1
- libsoup2.4-1
- libsqlite3-0
- libssl1.1
- libsss-nss-idmap0
- libstdc++6
- libtdb1
- libthai0
- libtiff5
- libvorbis0a
- libvorbisenc2
- libvorbisfile3
- libwayland-client0
- libwayland-cursor0
- libwayland-egl1
- libwayland-server0
- libwebp6
- libwebpdemux2
- libwoff1
- libx11-6
- libx11-xcb1
- libxau6
- libxcb-render0
- libxcb-shm0
- libxcb1
- libxcomposite1
- libxcursor1
- libxdamage1
- libxdmcp6
- libxext6
- libxfixes3
- libxi6
- libxinerama1
- libxkbcommon0
- libxml2
- libxpm4
- libxrandr2
- libxrender1
- libxslt1.1
- libyajl2
stage:
- -usr/share/emacs/site-lisp
build-environment:
- CC: "gcc-10"
- CXX: "g++-10"
- CFLAGS: "$CFLAGS -O2"
- NATIVE_FULL_AOT: "1"
- LD_LIBRARY_PATH: "$SNAPCRAFT_STAGE/usr/lib"
override-build: |
# ensure we hard-code our copy of gcc-10 and g++10 for tree-sitter
# otherwise it will use the system installed ones which will have a
# different libc version and we will fail to load them
patch -p1 < $SNAPCRAFT_PROJECT_DIR/treesit.patch
snapcraftctl build
override-prime: |
set -eu
snapcraftctl prime
# Fix-up application icon lookup
sed -i -e 's|^Icon=.*|Icon=usr/share/icons/hicolor/scalable/apps/emacs.svg|g' usr/share/applications/emacs*.desktop
# also fixup emacsclient.desktop file since snapd replaces the Exec= line
sed -i 's|Exec=.*|Exec=emacsclient %F|' usr/share/applications/emacsclient.desktop
# ensure we hard-code the necessary arguments for
# native-comp-driver-options in the build to try and avoid
# https://github.com/alexmurray/emacs-snap/issues/35 - we can't do
# this before we compile otherwise these options get used for doing
# the AOT compile as well - so set them afterwards just inside the
# snap
rm -f usr/share/emacs/*/lisp/emacs-lisp/comp.elc
gunzip -f usr/share/emacs/*/lisp/emacs-lisp/comp.el.gz
# ensure we use the right path in the patch file
VERSION=$(echo usr/share/emacs/*/lisp/emacs-lisp/comp.el | cut -d / -f 4)
sed s/@@VERSION@@/$VERSION/g $SNAPCRAFT_PROJECT_DIR/native-comp.patch | patch -p1
../parts/emacs/build/src/emacs -batch -f batch-byte+native-compile usr/share/emacs/*/lisp/emacs-lisp/comp.el
# compiled eln files get put back in the build directory - copy them over
# manually
cp ../parts/emacs/build/native-lisp/*/comp-*.eln usr/lib/emacs/*/native-lisp/*/
gzip usr/share/emacs/*/lisp/emacs-lisp/comp.el
site-lisp:
source: site-lisp
plugin: dump
organize:
"*.el": usr/share/emacs/site-lisp/
command-chain:
source: .
plugin: dump
stage:
- emacsclient
- setup-env