blob: df210ef5e95f8e0136d610adea68528bc6199f0c [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 \
Patrick Williams8e7b46e2023-05-01 14:19:06 -05008 file://0001-largefile.m4-Update-from-latest-gnulib.patch \
Andrew Geisslerf103a7f2021-05-07 16:09:40 -05009 "
Patrick Williams213cb262021-08-07 19:21:33 -050010SRC_URI:append:class-target = " file://usemake-docfile-native.patch"
Andrew Geisslerd688a012020-09-18 13:36:00 -050011
Andrew Geissler87f5cff2022-09-30 13:13:31 -050012SRC_URI[sha256sum] = "ee21182233ef3232dc97b486af2d86e14042dbb65bbc535df562c3a858232488"
Andrew Geisslerd688a012020-09-18 13:36:00 -050013
Patrick Williamsdb4c27e2022-08-05 08:10:29 -050014CVE_CHECK_IGNORE = "\
15 CVE-2007-6109 \
16"
17
Andrew Geisslerd688a012020-09-18 13:36:00 -050018PACKAGECONFIG[gnutls] = "--with-gnutls=yes,--with-gnutls=no,gnutls"
19PACKAGECONFIG[kerberos] = "--with-kerberos=yes,--with-kerberos=no,krb5"
20PACKAGECONFIG[libgmp] = "--with-libgmp=yes,--with-libgmp=no,gmp"
21
22PACKAGECONFIG ??= "gnutls kerberos libgmp"
23
24# We could use --without-all but its better to
25# split it into several packages (size of minimal doesnt change)
Andrew Geissler87f5cff2022-09-30 13:13:31 -050026EXTRA_OECONF = " --with-x=no --with-dumping=none --disable-build-details"
27
28# Disable seccomp, as its a default dependency for gnutls but it doesnt work when cross-compiling emacs
29EXTRA_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)}"
30
Andrew Geisslerd688a012020-09-18 13:36:00 -050031
32DEPENDS = "ncurses"
Patrick Williams213cb262021-08-07 19:21:33 -050033DEPENDS:append:class-target = " emacs-native"
Andrew Geisslerd688a012020-09-18 13:36:00 -050034
Andrew Geissler5199d832021-09-24 16:47:35 -050035inherit autotools mime-xdg pkgconfig
Andrew Geisslerd688a012020-09-18 13:36:00 -050036
Andrew Geissler87f5cff2022-09-30 13:13:31 -050037# Remove build host references to avoid target pollution
38do_compile:prepend () {
39 sed -i -e 's|${TMPDIR}||g' ${B}/src/config.h
40 sed -i -e 's|${B}||g' ${B}/src/epaths.h
41}
42
Patrick Williams213cb262021-08-07 19:21:33 -050043do_compile:class-native (){
Andrew Geisslerd688a012020-09-18 13:36:00 -050044 cd ${B}/lib-src
45 oe_runmake make-docfile
46 oe_runmake make-fingerprint
47}
Patrick Williams213cb262021-08-07 19:21:33 -050048do_install:class-native(){
Andrew Geisslerd688a012020-09-18 13:36:00 -050049 install -d ${D}${bindir}
50 install -m 755 ${B}/lib-src/make-docfile ${D}/${bindir}/
51 install -m 755 ${B}/lib-src/make-fingerprint ${D}/${bindir}/
52}
53
54
Patrick Williams213cb262021-08-07 19:21:33 -050055do_install:append(){
Andrew Geisslerd688a012020-09-18 13:36:00 -050056 # Delete systemd stuff, extend using DISTRO_FEATURES?
57 rm -rf ${D}/${libdir}
58 # Extra stuff which isnt needed
59 rm -rf ${D}/${datadir}/metainfo
60 rm -rf ${D}/${datadir}/info
61 # Emacs copies files to ${D} while building, which were unpacked
62 # by a different user, we need to restore those
63 chown -R root:root ${D}${datadir}
64}
65
Andrew Geisslerd688a012020-09-18 13:36:00 -050066# Use a similar strategy to how we build python:
67# Create three packages
68# minimal - A working lisp based text editor
69# base - What would probably work for most
70# full - A fully working emacs
71# The lists of files are long but are worth it
72# Installing "emacs" installs the base package
73PACKAGE_BEFORE_PN = "${PN}-minimal ${PN}-base ${PN}-full"
Patrick Williams213cb262021-08-07 19:21:33 -050074RPROVIDES:${PN}-base = "${PN}"
75RDEPENDS:${PN}-base:class-target = "${PN}-minimal"
76RDEPENDS:${PN}-full:class-target = "${PN}"
Andrew Geisslerd688a012020-09-18 13:36:00 -050077
78
79# A minimal version of emacs that works
Andrew Geissler87f5cff2022-09-30 13:13:31 -050080# These are kept sorted in alphabetical order
Patrick Williams213cb262021-08-07 19:21:33 -050081FILES:${PN}-minimal = " \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050082 ${bindir}/emacs* \
83 ${datadir}/${BPN}/${PV}/etc/charsets/ \
Andrew Geisslerd688a012020-09-18 13:36:00 -050084 ${datadir}/${BPN}/${PV}/lisp/abbrev.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050085 ${datadir}/${BPN}/${PV}/lisp/bindings.elc \
86 ${datadir}/${BPN}/${PV}/lisp/buff-menu.elc \
87 ${datadir}/${BPN}/${PV}/lisp/button.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -050088 ${datadir}/${BPN}/${PV}/lisp/case-table.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -050089 ${datadir}/${BPN}/${PV}/lisp/composite.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -050090 ${datadir}/${BPN}/${PV}/lisp/cus-face.elc \
91 ${datadir}/${BPN}/${PV}/lisp/cus-start.elc \
92 ${datadir}/${BPN}/${PV}/lisp/custom.elc \
93 ${datadir}/${BPN}/${PV}/lisp/disp-table.elc \
94 ${datadir}/${BPN}/${PV}/lisp/electric.elc \
95 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/backquote.elc \
96 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-opt.elc \
97 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-run.elc \
98 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/bytecomp.elc \
99 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cconv.elc \
100 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-generic.elc \
101 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-preloaded.elc \
102 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/easymenu.elc \
103 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eldoc.elc \
104 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/float-sup.elc \
105 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/gv.elc \
106 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp-mode.elc \
107 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp.elc \
108 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/macroexp.elc \
109 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map-ynp.elc \
110 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map.elc \
111 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/nadvice.elc \
112 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/regexp-opt.elc \
113 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/seq.elc \
114 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/shorthands.elc \
115 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/subr-x.elc \
116 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/syntax.elc \
117 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/tabulated-list.elc \
118 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/timer.elc \
119 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/vc/warnings.elc \
120 ${datadir}/${BPN}/${PV}/lisp/env.elc \
121 ${datadir}/${BPN}/${PV}/lisp/epa-hook.elc \
122 ${datadir}/${BPN}/${PV}/lisp/facemenu.elc \
123 ${datadir}/${BPN}/${PV}/lisp/faces.elc \
124 ${datadir}/${BPN}/${PV}/lisp/files.elc \
125 ${datadir}/${BPN}/${PV}/lisp/font-core.elc \
126 ${datadir}/${BPN}/${PV}/lisp/font-lock.elc \
127 ${datadir}/${BPN}/${PV}/lisp/format.elc \
128 ${datadir}/${BPN}/${PV}/lisp/frame.elc \
129 ${datadir}/${BPN}/${PV}/lisp/help.elc \
130 ${datadir}/${BPN}/${PV}/lisp/image.elc \
131 ${datadir}/${BPN}/${PV}/lisp/indent.elc \
132 ${datadir}/${BPN}/${PV}/lisp/international/characters.elc \
133 ${datadir}/${BPN}/${PV}/lisp/international/charprop.el \
134 ${datadir}/${BPN}/${PV}/lisp/international/charscript.elc \
135 ${datadir}/${BPN}/${PV}/lisp/international/cp51932.elc \
136 ${datadir}/${BPN}/${PV}/lisp/international/emoji-zwj.elc \
137 ${datadir}/${BPN}/${PV}/lisp/international/eucjp-ms.elc \
138 ${datadir}/${BPN}/${PV}/lisp/international/iso-transl.elc \
139 ${datadir}/${BPN}/${PV}/lisp/international/mule-cmds.elc \
140 ${datadir}/${BPN}/${PV}/lisp/international/mule-conf.elc \
141 ${datadir}/${BPN}/${PV}/lisp/international/mule.elc \
142 ${datadir}/${BPN}/${PV}/lisp/international/uni*.el \
143 ${datadir}/${BPN}/${PV}/lisp/isearch.elc \
144 ${datadir}/${BPN}/${PV}/lisp/jit-lock.elc \
145 ${datadir}/${BPN}/${PV}/lisp/jka-cmpr-hook.elc \
146 ${datadir}/${BPN}/${PV}/lisp/language/burmese.elc \
147 ${datadir}/${BPN}/${PV}/lisp/language/cham.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500148 ${datadir}/${BPN}/${PV}/lisp/language/chinese.elc \
149 ${datadir}/${BPN}/${PV}/lisp/language/cyrillic.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500150 ${datadir}/${BPN}/${PV}/lisp/language/czech.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500151 ${datadir}/${BPN}/${PV}/lisp/language/english.elc \
152 ${datadir}/${BPN}/${PV}/lisp/language/ethiopic.elc \
153 ${datadir}/${BPN}/${PV}/lisp/language/european.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500154 ${datadir}/${BPN}/${PV}/lisp/language/georgian.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500155 ${datadir}/${BPN}/${PV}/lisp/language/greek.elc \
156 ${datadir}/${BPN}/${PV}/lisp/language/hebrew.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500157 ${datadir}/${BPN}/${PV}/lisp/language/indian.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500158 ${datadir}/${BPN}/${PV}/lisp/language/japanese.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500159 ${datadir}/${BPN}/${PV}/lisp/language/khmer.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500160 ${datadir}/${BPN}/${PV}/lisp/language/korean.elc \
161 ${datadir}/${BPN}/${PV}/lisp/language/lao.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500162 ${datadir}/${BPN}/${PV}/lisp/language/misc-lang.elc \
163 ${datadir}/${BPN}/${PV}/lisp/language/romanian.elc \
164 ${datadir}/${BPN}/${PV}/lisp/language/sinhala.elc \
165 ${datadir}/${BPN}/${PV}/lisp/language/slovak.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500166 ${datadir}/${BPN}/${PV}/lisp/language/tai-viet.elc \
167 ${datadir}/${BPN}/${PV}/lisp/language/thai.elc \
168 ${datadir}/${BPN}/${PV}/lisp/language/tibetan.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500169 ${datadir}/${BPN}/${PV}/lisp/language/utf-8-lang.elc \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500170 ${datadir}/${BPN}/${PV}/lisp/language/vietnamese.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500171 ${datadir}/${BPN}/${PV}/lisp/ldefs-boot.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500172 ${datadir}/${BPN}/${PV}/lisp/loaddefs.el \
173 ${datadir}/${BPN}/${PV}/lisp/loadup.el \
174 ${datadir}/${BPN}/${PV}/lisp/menu-bar.elc \
175 ${datadir}/${BPN}/${PV}/lisp/minibuffer.elc \
176 ${datadir}/${BPN}/${PV}/lisp/mouse.elc \
177 ${datadir}/${BPN}/${PV}/lisp/newcomment.elc \
178 ${datadir}/${BPN}/${PV}/lisp/obarray.elc \
179 ${datadir}/${BPN}/${PV}/lisp/paren.elc \
180 ${datadir}/${BPN}/${PV}/lisp/progmodes/elisp-mode.elc \
181 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog-mode.elc \
182 ${datadir}/${BPN}/${PV}/lisp/register.elc \
183 ${datadir}/${BPN}/${PV}/lisp/replace.elc \
184 ${datadir}/${BPN}/${PV}/lisp/rfn-eshadow.elc \
185 ${datadir}/${BPN}/${PV}/lisp/select.elc \
186 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
187 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
188 ${datadir}/${BPN}/${PV}/lisp/startup.elc \
189 ${datadir}/${BPN}/${PV}/lisp/subr.elc \
190 ${datadir}/${BPN}/${PV}/lisp/tab-bar.elc \
191 ${datadir}/${BPN}/${PV}/lisp/term/tty-colors.elc \
192 ${datadir}/${BPN}/${PV}/lisp/term/xterm.elc \
193 ${datadir}/${BPN}/${PV}/lisp/textmodes/fill.elc \
194 ${datadir}/${BPN}/${PV}/lisp/textmodes/page.elc \
195 ${datadir}/${BPN}/${PV}/lisp/textmodes/paragraphs.elc \
196 ${datadir}/${BPN}/${PV}/lisp/textmodes/text-mode.elc \
197 ${datadir}/${BPN}/${PV}/lisp/tooltip.elc \
198 ${datadir}/${BPN}/${PV}/lisp/uniquify.elc \
199 ${datadir}/${BPN}/${PV}/lisp/vc/ediff-hook.elc \
200 ${datadir}/${BPN}/${PV}/lisp/vc/vc-hooks.elc \
201 ${datadir}/${BPN}/${PV}/lisp/version.elc \
202 ${datadir}/${BPN}/${PV}/lisp/widget.elc \
203 ${datadir}/${BPN}/${PV}/lisp/window.elc \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500204 ${prefix}/libexec \
205"
206
Andrew Geisslerd688a012020-09-18 13:36:00 -0500207# What works for "most" is relative, but this can be easily extended if needed
Patrick Williams213cb262021-08-07 19:21:33 -0500208FILES:${PN}-base = " \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500209 ${datadir}/${BPN}/${PV}/etc/e \
210 ${datadir}/${BPN}/${PV}/etc/forms \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500211 ${datadir}/${BPN}/${PV}/etc/srecode \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500212 ${datadir}/${BPN}/${PV}/etc/themes/adwaita-theme.el \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500213 ${datadir}/${BPN}/${PV}/etc/themes/deeper-blue-theme.el \
214 ${datadir}/${BPN}/${PV}/etc/themes/light-blue-theme.el \
215 ${datadir}/${BPN}/${PV}/etc/themes/misterioso-theme.el \
216 ${datadir}/${BPN}/${PV}/etc/themes/tango-theme.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500217 ${datadir}/${BPN}/${PV}/etc/themes/wheatgrass-theme.el \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500218 ${datadir}/${BPN}/${PV}/etc/themes/wombat-theme.el \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500219 ${datadir}/${BPN}/${PV}/lisp/ansi-color.elc \
220 ${datadir}/${BPN}/${PV}/lisp/auth-source.elc \
221 ${datadir}/${BPN}/${PV}/lisp/calendar/iso8601.elc \
222 ${datadir}/${BPN}/${PV}/lisp/calendar/parse-time.elc \
223 ${datadir}/${BPN}/${PV}/lisp/calendar/time-date.elc \
224 ${datadir}/${BPN}/${PV}/lisp/cedet \
225 ${datadir}/${BPN}/${PV}/lisp/comint.elc \
226 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-lib.elc \
227 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-macs.elc \
228 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-seq.elc \
229 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio-core.elc \
230 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio.elc \
231 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/inline.elc \
232 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/pcase.elc \
233 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/ring.elc \
234 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/smie.elc \
235 ${datadir}/${BPN}/${PV}/lisp/files-x.elc \
236 ${datadir}/${BPN}/${PV}/lisp/format-spec.elc \
237 ${datadir}/${BPN}/${PV}/lisp/json.elc \
238 ${datadir}/${BPN}/${PV}/lisp/ls-lisp.elc \
239 ${datadir}/${BPN}/${PV}/lisp/net/tramp-compat.elc \
240 ${datadir}/${BPN}/${PV}/lisp/net/tramp-integration.elc \
241 ${datadir}/${BPN}/${PV}/lisp/net/tramp-loaddefs.el \
242 ${datadir}/${BPN}/${PV}/lisp/net/tramp-sh.elc \
243 ${datadir}/${BPN}/${PV}/lisp/net/tramp.elc \
244 ${datadir}/${BPN}/${PV}/lisp/net/trampver.elc \
245 ${datadir}/${BPN}/${PV}/lisp/password-cache.elc \
246 ${datadir}/${BPN}/${PV}/lisp/pcomplete.elc \
247 ${datadir}/${BPN}/${PV}/lisp/progmodes/*asm* \
248 ${datadir}/${BPN}/${PV}/lisp/progmodes/*perl* \
249 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-align.elc \
250 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-cmds.elc \
251 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-defs.elc \
252 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-engine.elc \
253 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-fonts.elc \
254 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-guess.elc \
255 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-menus.elc \
256 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-mode.elc \
257 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-styles.elc \
258 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-vars.elc \
259 ${datadir}/${BPN}/${PV}/lisp/progmodes/cpp* \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500260 ${datadir}/${BPN}/${PV}/lisp/progmodes/executable* \
Andrew Geissler87f5cff2022-09-30 13:13:31 -0500261 ${datadir}/${BPN}/${PV}/lisp/progmodes/make* \
262 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog* \
263 ${datadir}/${BPN}/${PV}/lisp/progmodes/python* \
264 ${datadir}/${BPN}/${PV}/lisp/progmodes/sh-script* \
265 ${datadir}/${BPN}/${PV}/lisp/shell.elc \
266 ${datadir}/${BPN}/${PV}/lisp/subdirs.el \
267 ${datadir}/${BPN}/${PV}/site-lisp/ \
Andrew Geisslerd688a012020-09-18 13:36:00 -0500268"
269
270# Restore FILES for the full package to catch everything left
Patrick Williams213cb262021-08-07 19:21:33 -0500271FILES:${PN}-full = "${FILES:${PN}}"
272FILES:${PN}-full:append = " ${datadir}/icons"
Andrew Geisslerd688a012020-09-18 13:36:00 -0500273
274
275# The following does NOT build a native emacs.
276# It only builds some parts of it that are
277# required to by the build for target emacs.
278BBCLASSEXTEND = "native"