blob: 7b0a422be6077ca51aea1cb60963fef2cd48346d [file] [log] [blame]
Andrew Geisslerd688a012020-09-18 13:36:00 -05001SUMMARY = "Emacs is the extensible, customizable, self-documenting real-time display editor"
2HOMEPAGE = "https://www.gnu.org/software/emacs/"
3
Andrew Geissler9aee5002022-03-30 16:27:02 +00004LICENSE = "GPL-3.0-only"
Andrew Geisslerd688a012020-09-18 13:36:00 -05005LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
6
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05007SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05008 "
Patrick Williams213cb262021-08-07 19:21:33 -05009SRC_URI:append:class-target = " file://usemake-docfile-native.patch"
Andrew Geisslerd688a012020-09-18 13:36:00 -050010
Andrew Geissler87f5cff2022-09-30 13:13:31 -050011SRC_URI[sha256sum] = "ee21182233ef3232dc97b486af2d86e14042dbb65bbc535df562c3a858232488"
Andrew Geisslerd688a012020-09-18 13:36:00 -050012
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050013CVE_CHECK_IGNORE = "\
14 CVE-2007-6109 \
15"
16
Andrew Geisslerd688a012020-09-18 13:36:00 -050017PACKAGECONFIG[gnutls] = "--with-gnutls=yes,--with-gnutls=no,gnutls"
18PACKAGECONFIG[kerberos] = "--with-kerberos=yes,--with-kerberos=no,krb5"
19PACKAGECONFIG[libgmp] = "--with-libgmp=yes,--with-libgmp=no,gmp"
20
21PACKAGECONFIG ??= "gnutls kerberos libgmp"
22
23# We could use --without-all but its better to
24# split it into several packages (size of minimal doesnt change)
Andrew Geissler87f5cff2022-09-30 13:13:31 -050025EXTRA_OECONF = " --with-x=no --with-dumping=none --disable-build-details"
26
27# Disable seccomp, as its a default dependency for gnutls but it doesnt work when cross-compiling emacs
28EXTRA_OECONF:append = " ${@bb.utils.contains('PACKAGECONFIG', 'gnutls', 'ac_cv_have_decl_SECCOMP_FILTER_FLAG_TSYNC=no ac_cv_have_decl_SECCOMP_SET_MODE_FILTER=no', '', d)}"
29
Andrew Geisslerd688a012020-09-18 13:36:00 -050030
31DEPENDS = "ncurses"
Patrick Williams213cb262021-08-07 19:21:33 -050032DEPENDS:append:class-target = " emacs-native"
Andrew Geisslerd688a012020-09-18 13:36:00 -050033
Andrew Geissler5199d832021-09-24 16:47:35 -050034inherit autotools mime-xdg pkgconfig
Andrew Geisslerd688a012020-09-18 13:36:00 -050035
Andrew Geissler87f5cff2022-09-30 13:13:31 -050036# Remove build host references to avoid target pollution
37do_compile:prepend () {
38 sed -i -e 's|${TMPDIR}||g' ${B}/src/config.h
39 sed -i -e 's|${B}||g' ${B}/src/epaths.h
40}
41
Patrick Williams213cb262021-08-07 19:21:33 -050042do_compile:class-native (){
Andrew Geisslerd688a012020-09-18 13:36:00 -050043 cd ${B}/lib-src
44 oe_runmake make-docfile
45 oe_runmake make-fingerprint
46}
Patrick Williams213cb262021-08-07 19:21:33 -050047do_install:class-native(){
Andrew Geisslerd688a012020-09-18 13:36:00 -050048 install -d ${D}${bindir}
49 install -m 755 ${B}/lib-src/make-docfile ${D}/${bindir}/
50 install -m 755 ${B}/lib-src/make-fingerprint ${D}/${bindir}/
51}
52
53
Patrick Williams213cb262021-08-07 19:21:33 -050054do_install:append(){
Andrew Geisslerd688a012020-09-18 13:36:00 -050055 # Delete systemd stuff, extend using DISTRO_FEATURES?
56 rm -rf ${D}/${libdir}
57 # Extra stuff which isnt needed
58 rm -rf ${D}/${datadir}/metainfo
59 rm -rf ${D}/${datadir}/info
60 # Emacs copies files to ${D} while building, which were unpacked
61 # by a different user, we need to restore those
62 chown -R root:root ${D}${datadir}
63}
64
Andrew Geisslerd688a012020-09-18 13:36:00 -050065# Use a similar strategy to how we build python:
66# Create three packages
67# minimal - A working lisp based text editor
68# base - What would probably work for most
69# full - A fully working emacs
70# The lists of files are long but are worth it
71# Installing "emacs" installs the base package
72PACKAGE_BEFORE_PN = "${PN}-minimal ${PN}-base ${PN}-full"
Patrick Williams213cb262021-08-07 19:21:33 -050073RPROVIDES:${PN}-base = "${PN}"
74RDEPENDS:${PN}-base:class-target = "${PN}-minimal"
75RDEPENDS:${PN}-full:class-target = "${PN}"
Andrew Geisslerd688a012020-09-18 13:36:00 -050076
77
78# A minimal version of emacs that works
Andrew Geissler87f5cff2022-09-30 13:13:31 -050079# These are kept sorted in alphabetical order
Patrick Williams213cb262021-08-07 19:21:33 -050080FILES:${PN}-minimal = " \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050081 ${bindir}/emacs* \
82 ${datadir}/${BPN}/${PV}/etc/charsets/ \
Andrew Geisslerd688a012020-09-18 13:36:00 -050083 ${datadir}/${BPN}/${PV}/lisp/abbrev.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050084 ${datadir}/${BPN}/${PV}/lisp/bindings.elc \
85 ${datadir}/${BPN}/${PV}/lisp/buff-menu.elc \
86 ${datadir}/${BPN}/${PV}/lisp/button.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -050087 ${datadir}/${BPN}/${PV}/lisp/case-table.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -050088 ${datadir}/${BPN}/${PV}/lisp/composite.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050089 ${datadir}/${BPN}/${PV}/lisp/cus-face.elc \
90 ${datadir}/${BPN}/${PV}/lisp/cus-start.elc \
91 ${datadir}/${BPN}/${PV}/lisp/custom.elc \
92 ${datadir}/${BPN}/${PV}/lisp/disp-table.elc \
93 ${datadir}/${BPN}/${PV}/lisp/electric.elc \
94 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/backquote.elc \
95 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-opt.elc \
96 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-run.elc \
97 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/bytecomp.elc \
98 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cconv.elc \
99 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-generic.elc \
100 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-preloaded.elc \
101 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/easymenu.elc \
102 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eldoc.elc \
103 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/float-sup.elc \
104 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/gv.elc \
105 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp-mode.elc \
106 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp.elc \
107 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/macroexp.elc \
108 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map-ynp.elc \
109 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map.elc \
110 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/nadvice.elc \
111 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/regexp-opt.elc \
112 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/seq.elc \
113 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/shorthands.elc \
114 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/subr-x.elc \
115 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/syntax.elc \
116 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/tabulated-list.elc \
117 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/timer.elc \
118 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/vc/warnings.elc \
119 ${datadir}/${BPN}/${PV}/lisp/env.elc \
120 ${datadir}/${BPN}/${PV}/lisp/epa-hook.elc \
121 ${datadir}/${BPN}/${PV}/lisp/facemenu.elc \
122 ${datadir}/${BPN}/${PV}/lisp/faces.elc \
123 ${datadir}/${BPN}/${PV}/lisp/files.elc \
124 ${datadir}/${BPN}/${PV}/lisp/font-core.elc \
125 ${datadir}/${BPN}/${PV}/lisp/font-lock.elc \
126 ${datadir}/${BPN}/${PV}/lisp/format.elc \
127 ${datadir}/${BPN}/${PV}/lisp/frame.elc \
128 ${datadir}/${BPN}/${PV}/lisp/help.elc \
129 ${datadir}/${BPN}/${PV}/lisp/image.elc \
130 ${datadir}/${BPN}/${PV}/lisp/indent.elc \
131 ${datadir}/${BPN}/${PV}/lisp/international/characters.elc \
132 ${datadir}/${BPN}/${PV}/lisp/international/charprop.el \
133 ${datadir}/${BPN}/${PV}/lisp/international/charscript.elc \
134 ${datadir}/${BPN}/${PV}/lisp/international/cp51932.elc \
135 ${datadir}/${BPN}/${PV}/lisp/international/emoji-zwj.elc \
136 ${datadir}/${BPN}/${PV}/lisp/international/eucjp-ms.elc \
137 ${datadir}/${BPN}/${PV}/lisp/international/iso-transl.elc \
138 ${datadir}/${BPN}/${PV}/lisp/international/mule-cmds.elc \
139 ${datadir}/${BPN}/${PV}/lisp/international/mule-conf.elc \
140 ${datadir}/${BPN}/${PV}/lisp/international/mule.elc \
141 ${datadir}/${BPN}/${PV}/lisp/international/uni*.el \
142 ${datadir}/${BPN}/${PV}/lisp/isearch.elc \
143 ${datadir}/${BPN}/${PV}/lisp/jit-lock.elc \
144 ${datadir}/${BPN}/${PV}/lisp/jka-cmpr-hook.elc \
145 ${datadir}/${BPN}/${PV}/lisp/language/burmese.elc \
146 ${datadir}/${BPN}/${PV}/lisp/language/cham.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500147 ${datadir}/${BPN}/${PV}/lisp/language/chinese.elc \
148 ${datadir}/${BPN}/${PV}/lisp/language/cyrillic.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500149 ${datadir}/${BPN}/${PV}/lisp/language/czech.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500150 ${datadir}/${BPN}/${PV}/lisp/language/english.elc \
151 ${datadir}/${BPN}/${PV}/lisp/language/ethiopic.elc \
152 ${datadir}/${BPN}/${PV}/lisp/language/european.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500153 ${datadir}/${BPN}/${PV}/lisp/language/georgian.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500154 ${datadir}/${BPN}/${PV}/lisp/language/greek.elc \
155 ${datadir}/${BPN}/${PV}/lisp/language/hebrew.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500156 ${datadir}/${BPN}/${PV}/lisp/language/indian.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500157 ${datadir}/${BPN}/${PV}/lisp/language/japanese.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500158 ${datadir}/${BPN}/${PV}/lisp/language/khmer.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500159 ${datadir}/${BPN}/${PV}/lisp/language/korean.elc \
160 ${datadir}/${BPN}/${PV}/lisp/language/lao.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500161 ${datadir}/${BPN}/${PV}/lisp/language/misc-lang.elc \
162 ${datadir}/${BPN}/${PV}/lisp/language/romanian.elc \
163 ${datadir}/${BPN}/${PV}/lisp/language/sinhala.elc \
164 ${datadir}/${BPN}/${PV}/lisp/language/slovak.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500165 ${datadir}/${BPN}/${PV}/lisp/language/tai-viet.elc \
166 ${datadir}/${BPN}/${PV}/lisp/language/thai.elc \
167 ${datadir}/${BPN}/${PV}/lisp/language/tibetan.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500168 ${datadir}/${BPN}/${PV}/lisp/language/utf-8-lang.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500169 ${datadir}/${BPN}/${PV}/lisp/language/vietnamese.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500170 ${datadir}/${BPN}/${PV}/lisp/ldefs-boot.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500171 ${datadir}/${BPN}/${PV}/lisp/loaddefs.el \
172 ${datadir}/${BPN}/${PV}/lisp/loadup.el \
173 ${datadir}/${BPN}/${PV}/lisp/menu-bar.elc \
174 ${datadir}/${BPN}/${PV}/lisp/minibuffer.elc \
175 ${datadir}/${BPN}/${PV}/lisp/mouse.elc \
176 ${datadir}/${BPN}/${PV}/lisp/newcomment.elc \
177 ${datadir}/${BPN}/${PV}/lisp/obarray.elc \
178 ${datadir}/${BPN}/${PV}/lisp/paren.elc \
179 ${datadir}/${BPN}/${PV}/lisp/progmodes/elisp-mode.elc \
180 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog-mode.elc \
181 ${datadir}/${BPN}/${PV}/lisp/register.elc \
182 ${datadir}/${BPN}/${PV}/lisp/replace.elc \
183 ${datadir}/${BPN}/${PV}/lisp/rfn-eshadow.elc \
184 ${datadir}/${BPN}/${PV}/lisp/select.elc \
185 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
186 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
187 ${datadir}/${BPN}/${PV}/lisp/startup.elc \
188 ${datadir}/${BPN}/${PV}/lisp/subr.elc \
189 ${datadir}/${BPN}/${PV}/lisp/tab-bar.elc \
190 ${datadir}/${BPN}/${PV}/lisp/term/tty-colors.elc \
191 ${datadir}/${BPN}/${PV}/lisp/term/xterm.elc \
192 ${datadir}/${BPN}/${PV}/lisp/textmodes/fill.elc \
193 ${datadir}/${BPN}/${PV}/lisp/textmodes/page.elc \
194 ${datadir}/${BPN}/${PV}/lisp/textmodes/paragraphs.elc \
195 ${datadir}/${BPN}/${PV}/lisp/textmodes/text-mode.elc \
196 ${datadir}/${BPN}/${PV}/lisp/tooltip.elc \
197 ${datadir}/${BPN}/${PV}/lisp/uniquify.elc \
198 ${datadir}/${BPN}/${PV}/lisp/vc/ediff-hook.elc \
199 ${datadir}/${BPN}/${PV}/lisp/vc/vc-hooks.elc \
200 ${datadir}/${BPN}/${PV}/lisp/version.elc \
201 ${datadir}/${BPN}/${PV}/lisp/widget.elc \
202 ${datadir}/${BPN}/${PV}/lisp/window.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500203 ${prefix}/libexec \
204"
205
Andrew Geisslerd688a012020-09-18 13:36:00 -0500206# What works for "most" is relative, but this can be easily extended if needed
Patrick Williams213cb262021-08-07 19:21:33 -0500207FILES:${PN}-base = " \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500208 ${datadir}/${BPN}/${PV}/etc/e \
209 ${datadir}/${BPN}/${PV}/etc/forms \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500210 ${datadir}/${BPN}/${PV}/etc/srecode \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500211 ${datadir}/${BPN}/${PV}/etc/themes/adwaita-theme.el \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500212 ${datadir}/${BPN}/${PV}/etc/themes/deeper-blue-theme.el \
213 ${datadir}/${BPN}/${PV}/etc/themes/light-blue-theme.el \
214 ${datadir}/${BPN}/${PV}/etc/themes/misterioso-theme.el \
215 ${datadir}/${BPN}/${PV}/etc/themes/tango-theme.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500216 ${datadir}/${BPN}/${PV}/etc/themes/wheatgrass-theme.el \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500217 ${datadir}/${BPN}/${PV}/etc/themes/wombat-theme.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500218 ${datadir}/${BPN}/${PV}/lisp/ansi-color.elc \
219 ${datadir}/${BPN}/${PV}/lisp/auth-source.elc \
220 ${datadir}/${BPN}/${PV}/lisp/calendar/iso8601.elc \
221 ${datadir}/${BPN}/${PV}/lisp/calendar/parse-time.elc \
222 ${datadir}/${BPN}/${PV}/lisp/calendar/time-date.elc \
223 ${datadir}/${BPN}/${PV}/lisp/cedet \
224 ${datadir}/${BPN}/${PV}/lisp/comint.elc \
225 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-lib.elc \
226 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-macs.elc \
227 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-seq.elc \
228 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio-core.elc \
229 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio.elc \
230 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/inline.elc \
231 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/pcase.elc \
232 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/ring.elc \
233 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/smie.elc \
234 ${datadir}/${BPN}/${PV}/lisp/files-x.elc \
235 ${datadir}/${BPN}/${PV}/lisp/format-spec.elc \
236 ${datadir}/${BPN}/${PV}/lisp/json.elc \
237 ${datadir}/${BPN}/${PV}/lisp/ls-lisp.elc \
238 ${datadir}/${BPN}/${PV}/lisp/net/tramp-compat.elc \
239 ${datadir}/${BPN}/${PV}/lisp/net/tramp-integration.elc \
240 ${datadir}/${BPN}/${PV}/lisp/net/tramp-loaddefs.el \
241 ${datadir}/${BPN}/${PV}/lisp/net/tramp-sh.elc \
242 ${datadir}/${BPN}/${PV}/lisp/net/tramp.elc \
243 ${datadir}/${BPN}/${PV}/lisp/net/trampver.elc \
244 ${datadir}/${BPN}/${PV}/lisp/password-cache.elc \
245 ${datadir}/${BPN}/${PV}/lisp/pcomplete.elc \
246 ${datadir}/${BPN}/${PV}/lisp/progmodes/*asm* \
247 ${datadir}/${BPN}/${PV}/lisp/progmodes/*perl* \
248 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-align.elc \
249 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-cmds.elc \
250 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-defs.elc \
251 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-engine.elc \
252 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-fonts.elc \
253 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-guess.elc \
254 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-menus.elc \
255 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-mode.elc \
256 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-styles.elc \
257 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-vars.elc \
258 ${datadir}/${BPN}/${PV}/lisp/progmodes/cpp* \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500259 ${datadir}/${BPN}/${PV}/lisp/progmodes/executable* \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500260 ${datadir}/${BPN}/${PV}/lisp/progmodes/make* \
261 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog* \
262 ${datadir}/${BPN}/${PV}/lisp/progmodes/python* \
263 ${datadir}/${BPN}/${PV}/lisp/progmodes/sh-script* \
264 ${datadir}/${BPN}/${PV}/lisp/shell.elc \
265 ${datadir}/${BPN}/${PV}/lisp/subdirs.el \
266 ${datadir}/${BPN}/${PV}/site-lisp/ \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500267"
268
269# Restore FILES for the full package to catch everything left
Patrick Williams213cb262021-08-07 19:21:33 -0500270FILES:${PN}-full = "${FILES:${PN}}"
271FILES:${PN}-full:append = " ${datadir}/icons"
Andrew Geisslerd688a012020-09-18 13:36:00 -0500272
273
274# The following does NOT build a native emacs.
275# It only builds some parts of it that are
276# required to by the build for target emacs.
277BBCLASSEXTEND = "native"