summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-support/emacs/emacs_27.1.bb261
-rw-r--r--meta-oe/recipes-support/emacs/files/usemake-docfile-native.patch85
2 files changed, 346 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/emacs/emacs_27.1.bb b/meta-oe/recipes-support/emacs/emacs_27.1.bb
new file mode 100644
index 0000000000..9b3adcf9d8
--- /dev/null
+++ b/meta-oe/recipes-support/emacs/emacs_27.1.bb
@@ -0,0 +1,261 @@
1SUMMARY = "Emacs is the extensible, customizable, self-documenting real-time display editor"
2HOMEPAGE = "https://www.gnu.org/software/emacs/"
3
4LICENSE = "GPLv3"
5LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464"
6
7SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz"
8
9SRC_URI_append_class-target = " file://usemake-docfile-native.patch"
10
11SRC_URI[sha256sum] = "4a4c128f915fc937d61edfc273c98106711b540c9be3cd5d2e2b9b5b2f172e41"
12
13PACKAGECONFIG[gnutls] = "--with-gnutls=yes,--with-gnutls=no,gnutls"
14PACKAGECONFIG[kerberos] = "--with-kerberos=yes,--with-kerberos=no,krb5"
15PACKAGECONFIG[libgmp] = "--with-libgmp=yes,--with-libgmp=no,gmp"
16
17PACKAGECONFIG ??= "gnutls kerberos libgmp"
18
19# We could use --without-all but its better to
20# split it into several packages (size of minimal doesnt change)
21EXTRA_OECONF = " --with-x=no --with-dumping=none"
22
23DEPENDS = "ncurses"
24DEPENDS_append_class-target = " emacs-native"
25
26inherit autotools mime-xdg
27
28
29do_compile_class-native (){
30 cd ${B}/lib-src
31 oe_runmake make-docfile
32 oe_runmake make-fingerprint
33}
34do_install_class-native(){
35 install -d ${D}${bindir}
36 install -m 755 ${B}/lib-src/make-docfile ${D}/${bindir}/
37 install -m 755 ${B}/lib-src/make-fingerprint ${D}/${bindir}/
38}
39
40
41do_install_append(){
42 # Delete systemd stuff, extend using DISTRO_FEATURES?
43 rm -rf ${D}/${libdir}
44 # Extra stuff which isnt needed
45 rm -rf ${D}/${datadir}/metainfo
46 rm -rf ${D}/${datadir}/info
47 # Emacs copies files to ${D} while building, which were unpacked
48 # by a different user, we need to restore those
49 chown -R root:root ${D}${datadir}
50}
51
52
53# Use a similar strategy to how we build python:
54# Create three packages
55# minimal - A working lisp based text editor
56# base - What would probably work for most
57# full - A fully working emacs
58# The lists of files are long but are worth it
59# Installing "emacs" installs the base package
60PACKAGE_BEFORE_PN = "${PN}-minimal ${PN}-base ${PN}-full"
61RPROVIDES_${PN}-base = "${PN}"
62RDEPENDS_${PN}-base_class-target = "${PN}-minimal"
63RDEPENDS_${PN}-full_class-target = "${PN}"
64
65
66# A minimal version of emacs that works
67FILES_${PN}-minimal = " \
68 ${datadir}/${BPN}/${PV}/lisp/loadup.el \
69 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-run.elc \
70 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/backquote.elc \
71 ${datadir}/${BPN}/${PV}/lisp/subr.elc \
72 ${datadir}/${BPN}/${PV}/lisp/version.elc \
73 ${datadir}/${BPN}/${PV}/lisp/widget.elc \
74 ${datadir}/${BPN}/${PV}/lisp/custom.elc \
75 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map-ynp.elc \
76 ${datadir}/${BPN}/${PV}/lisp/international/mule.elc \
77 ${datadir}/${BPN}/${PV}/lisp/international/mule-conf.elc \
78 ${datadir}/${BPN}/${PV}/lisp/env.elc \
79 ${datadir}/${BPN}/${PV}/lisp/format.elc \
80 ${datadir}/${BPN}/${PV}/lisp/bindings.elc \
81 ${datadir}/${BPN}/${PV}/lisp/window.elc \
82 ${datadir}/${BPN}/${PV}/lisp/files.elc \
83 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/macroexp.elc \
84 ${datadir}/${BPN}/${PV}/lisp/cus-face.elc \
85 ${datadir}/${BPN}/${PV}/lisp/faces.elc \
86 ${datadir}/${BPN}/${PV}/lisp/button.elc \
87 ${datadir}/${BPN}/${PV}/lisp/loaddefs.el \
88 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/nadvice.elc \
89 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-preloaded.elc \
90 ${datadir}/${BPN}/${PV}/lisp/obarray.elc \
91 ${datadir}/${BPN}/${PV}/lisp/abbrev.elc \
92 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
93 ${datadir}/${BPN}/${PV}/lisp/jka-cmpr-hook.elc \
94 ${datadir}/${BPN}/${PV}/lisp/epa-hook.elc \
95 ${datadir}/${BPN}/${PV}/lisp/international/mule-cmds.elc \
96 ${datadir}/${BPN}/${PV}/lisp/case-table.elc \
97 ${datadir}/${BPN}/${PV}/lisp/international/charprop.el \
98 ${datadir}/${BPN}/${PV}/lisp/international/characters.elc \
99 ${datadir}/${BPN}/${PV}/lisp/international/charscript.elc \
100 ${datadir}/${BPN}/${PV}/lisp/composite.elc \
101 ${datadir}/${BPN}/${PV}/lisp/language/chinese.elc \
102 ${datadir}/${BPN}/${PV}/lisp/language/cyrillic.elc \
103 ${datadir}/${BPN}/${PV}/lisp/language/indian.elc \
104 ${datadir}/${BPN}/${PV}/lisp/language/sinhala.elc \
105 ${datadir}/${BPN}/${PV}/lisp/language/english.elc \
106 ${datadir}/${BPN}/${PV}/lisp/language/ethiopic.elc \
107 ${datadir}/${BPN}/${PV}/lisp/language/european.elc \
108 ${datadir}/${BPN}/${PV}/lisp/language/czech.elc \
109 ${datadir}/${BPN}/${PV}/lisp/language/slovak.elc \
110 ${datadir}/${BPN}/${PV}/lisp/language/romanian.elc \
111 ${datadir}/${BPN}/${PV}/lisp/language/greek.elc \
112 ${datadir}/${BPN}/${PV}/lisp/language/hebrew.elc \
113 ${datadir}/${BPN}/${PV}/lisp/international/cp51932.elc \
114 ${datadir}/${BPN}/${PV}/lisp/international/eucjp-ms.elc \
115 ${datadir}/${BPN}/${PV}/lisp/language/japanese.elc \
116 ${datadir}/${BPN}/${PV}/lisp/language/korean.elc \
117 ${datadir}/${BPN}/${PV}/lisp/language/lao.elc \
118 ${datadir}/${BPN}/${PV}/lisp/language/tai-viet.elc \
119 ${datadir}/${BPN}/${PV}/lisp/language/thai.elc \
120 ${datadir}/${BPN}/${PV}/lisp/language/tibetan.elc \
121 ${datadir}/${BPN}/${PV}/lisp/language/vietnamese.elc \
122 ${datadir}/${BPN}/${PV}/lisp/language/misc-lang.elc \
123 ${datadir}/${BPN}/${PV}/lisp/language/utf-8-lang.elc \
124 ${datadir}/${BPN}/${PV}/lisp/language/georgian.elc \
125 ${datadir}/${BPN}/${PV}/lisp/language/khmer.elc \
126 ${datadir}/${BPN}/${PV}/lisp/language/burmese.elc \
127 ${datadir}/${BPN}/${PV}/lisp/language/cham.elc \
128 ${datadir}/${BPN}/${PV}/lisp/indent.elc \
129 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-generic.elc \
130 ${datadir}/${BPN}/${PV}/lisp/minibuffer.elc \
131 ${datadir}/${BPN}/${PV}/lisp/frame.elc \
132 ${datadir}/${BPN}/${PV}/lisp/startup.elc \
133 ${datadir}/${BPN}/${PV}/lisp/term/tty-colors.elc \
134 ${datadir}/${BPN}/${PV}/lisp/font-core.elc \
135 ${datadir}/${BPN}/${PV}/lisp/facemenu.elc \
136 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/syntax.elc \
137 ${datadir}/${BPN}/${PV}/lisp/font-lock.elc \
138 ${datadir}/${BPN}/${PV}/lisp/jit-lock.elc \
139 ${datadir}/${BPN}/${PV}/lisp/mouse.elc \
140 ${datadir}/${BPN}/${PV}/lisp/select.elc \
141 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/timer.elc \
142 ${datadir}/${BPN}/${PV}/lisp/isearch.elc \
143 ${datadir}/${BPN}/${PV}/lisp/rfn-eshadow.elc \
144 ${datadir}/${BPN}/${PV}/lisp/menu-bar.elc \
145 ${datadir}/${BPN}/${PV}/lisp/tab-bar.elc \
146 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp.elc \
147 ${datadir}/${BPN}/${PV}/lisp/textmodes/page.elc \
148 ${datadir}/${BPN}/${PV}/lisp/register.elc \
149 ${datadir}/${BPN}/${PV}/lisp/textmodes/paragraphs.elc \
150 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog-mode.elc \
151 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/lisp-mode.elc \
152 ${datadir}/${BPN}/${PV}/lisp/progmodes/elisp-mode.elc \
153 ${datadir}/${BPN}/${PV}/lisp/textmodes/text-mode.elc \
154 ${datadir}/${BPN}/${PV}/lisp/textmodes/fill.elc \
155 ${datadir}/${BPN}/${PV}/lisp/newcomment.elc \
156 ${datadir}/${BPN}/${PV}/lisp/replace.elc \
157 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/tabulated-list.elc \
158 ${datadir}/${BPN}/${PV}/lisp/buff-menu.elc \
159 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/float-sup.elc \
160 ${datadir}/${BPN}/${PV}/lisp/vc/vc-hooks.elc \
161 ${datadir}/${BPN}/${PV}/lisp/vc/ediff-hook.elc \
162 ${datadir}/${BPN}/${PV}/lisp/uniquify.elc \
163 ${datadir}/${BPN}/${PV}/lisp/electric.elc \
164 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eldoc.elc \
165 ${datadir}/${BPN}/${PV}/lisp/cus-start.elc \
166 ${datadir}/${BPN}/${PV}/lisp/tooltip.elc \
167 ${datadir}/${BPN}/${PV}/lisp/simple.elc \
168 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/regexp-opt.elc \
169 ${datadir}/${BPN}/${PV}/lisp/term/xterm.elc \
170 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/bytecomp.elc \
171 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cconv.elc \
172 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/gv.elc \
173 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/byte-opt.elc \
174 ${datadir}/${BPN}/${PV}/lisp/image.elc \
175 ${datadir}/${BPN}/${PV}/lisp/ldefs-boot.el \
176 ${datadir}/${BPN}/${PV}/lisp/help.elc \
177 ${datadir}/${BPN}/${PV}/lisp/international/uni*.el \
178 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/vc/warnings.elc \
179 ${datadir}/${BPN}/${PV}/etc/charsets/ \
180 ${bindir}/emacs* \
181 ${prefix}/libexec \
182"
183
184
185# What works for "most" is relative, but this can be easily extended if needed
186FILES_${PN}-base = " \
187 ${datadir}/${BPN}/${PV}/etc/srecode \
188 ${datadir}/${BPN}/${PV}/etc/e \
189 ${datadir}/${BPN}/${PV}/etc/forms \
190 ${datadir}/${BPN}/${PV}/lisp/cedet \
191 ${datadir}/${BPN}/${PV}/site-lisp/ \
192 ${datadir}/${BPN}/${PV}/lisp/subdirs.el \
193 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-mode.elc \
194 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-defs.elc \
195 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-vars.elc \
196 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-engine.elc \
197 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-styles.elc \
198 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-fonts.elc \
199 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-cmds.elc \
200 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-align.elc \
201 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-menus.elc \
202 ${datadir}/${BPN}/${PV}/lisp/progmodes/cc-guess.elc \
203 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-lib.elc \
204 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-macs.elc \
205 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/pcase.elc \
206 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/inline.elc \
207 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/cl-seq.elc \
208 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/easymenu.elc \
209 ${datadir}/${BPN}/${PV}/lisp/progmodes/python* \
210 ${datadir}/${BPN}/${PV}/lisp/ansi-color.elc \
211 ${datadir}/${BPN}/${PV}/lisp/comint.elc \
212 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/ring.elc \
213 ${datadir}/${BPN}/${PV}/lisp/json.elc \
214 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/map.elc \
215 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/seq.elc \
216 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/subr-x.elc \
217 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/seq.elc \
218 ${datadir}/${BPN}/${PV}/lisp/net/tramp-sh.elc \
219 ${datadir}/${BPN}/${PV}/lisp/net/tramp.elc \
220 ${datadir}/${BPN}/${PV}/lisp/net/tramp-compat.elc \
221 ${datadir}/${BPN}/${PV}/lisp/auth-source.elc \
222 ${datadir}/${BPN}/${PV}/lisp/password-cache.elc \
223 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio.elc \
224 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/eieio-core.elc \
225 ${datadir}/${BPN}/${PV}/lisp/format-spec.elc \
226 ${datadir}/${BPN}/${PV}/lisp/ls-lisp.elc \
227 ${datadir}/${BPN}/${PV}/lisp/calendar/parse-time.elc \
228 ${datadir}/${BPN}/${PV}/lisp/calendar/iso8601.elc \
229 ${datadir}/${BPN}/${PV}/lisp/calendar/time-date.elc \
230 ${datadir}/${BPN}/${PV}/lisp/shell.elc \
231 ${datadir}/${BPN}/${PV}/lisp/pcomplete.elc \
232 ${datadir}/${BPN}/${PV}/lisp/net/tramp-integration.elc \
233 ${datadir}/${BPN}/${PV}/lisp/files-x.elc \
234 ${datadir}/${BPN}/${PV}/lisp/net/trampver.elc \
235 ${datadir}/${BPN}/${PV}/lisp/net/tramp-loaddefs.el \
236 ${datadir}/${BPN}/${PV}/lisp/progmodes/*perl* \
237 ${datadir}/${BPN}/${PV}/lisp/emacs-lisp/smie.elc \
238 ${datadir}/${BPN}/${PV}/lisp/progmodes/*asm* \
239 ${datadir}/${BPN}/${PV}/lisp/progmodes/cpp* \
240 ${datadir}/${BPN}/${PV}/lisp/progmodes/make* \
241 ${datadir}/${BPN}/${PV}/lisp/progmodes/sh-script* \
242 ${datadir}/${BPN}/${PV}/etc/themes/adwaita-theme.el \
243 ${datadir}/${BPN}/${PV}/etc/themes/wheatgrass-theme.el \
244 ${datadir}/${BPN}/${PV}/etc/themes/deeper-blue-theme.el \
245 ${datadir}/${BPN}/${PV}/etc/themes/light-blue-theme.el \
246 ${datadir}/${BPN}/${PV}/etc/themes/misterioso-theme.el \
247 ${datadir}/${BPN}/${PV}/etc/themes/tango-theme.el \
248 ${datadir}/${BPN}/${PV}/etc/themes/wombat-theme.el \
249 ${datadir}/${BPN}/${PV}/lisp/progmodes/prog* \
250 ${datadir}/${BPN}/${PV}/lisp/progmodes/executable* \
251"
252
253# Restore FILES for the full package to catch everything left
254FILES_${PN}-full = "${FILES_${PN}}"
255FILES_${PN}-full_append = " ${datadir}/icons"
256
257
258# The following does NOT build a native emacs.
259# It only builds some parts of it that are
260# required to by the build for target emacs.
261BBCLASSEXTEND = "native"
diff --git a/meta-oe/recipes-support/emacs/files/usemake-docfile-native.patch b/meta-oe/recipes-support/emacs/files/usemake-docfile-native.patch
new file mode 100644
index 0000000000..cc0b05c792
--- /dev/null
+++ b/meta-oe/recipes-support/emacs/files/usemake-docfile-native.patch
@@ -0,0 +1,85 @@
1Upstream-Status: Inappropriate [OE-Specific]
2
3When building emacs, it builds some tools for the HOST
4that are then used to build for target, such as
5make-fingerprint and make-docfile, this needs to be
6adapted to be used by bitbake, otherwise the compiled
7executables arent compatible with the HOST.
8
9Use the above mentioned tools provided by the native
10version of the recipe instead.
11
12Signed-off-by: Alejandro Enedino Hernandez Samaniego <alejandro@enedino.org>
13
14Index: emacs-27.1/src/Makefile.in
15===================================================================
16--- emacs-27.1.orig/src/Makefile.in
17+++ emacs-27.1/src/Makefile.in
18@@ -472,7 +472,7 @@ ifeq ($(CHECK_STRUCTS),true)
19 pdumper.o: dmpstruct.h
20 endif
21 dmpstruct.h: $(srcdir)/dmpstruct.awk
22-dmpstruct.h: $(libsrc)/make-fingerprint$(EXEEXT) $(dmpstruct_headers)
23+dmpstruct.h: $(dmpstruct_headers)
24 $(AM_V_GEN)POSIXLY_CORRECT=1 awk -f $(srcdir)/dmpstruct.awk \
25 $(dmpstruct_headers) > $@
26
27@@ -566,8 +566,7 @@ ${lispintdir}/characters.elc: ${charscri
28 ## Strictly speaking, emacs does not depend directly on all of $lisp,
29 ## since not all pieces are used on all platforms. But DOC depends
30 ## on all of $lisp, and emacs depends on DOC, so it is ok to use $lisp here.
31-emacs$(EXEEXT): temacs$(EXEEXT) \
32- lisp.mk $(etc)/DOC $(lisp) \
33+emacs$(EXEEXT): lisp.mk $(etc)/DOC $(lisp) \
34 $(lispsource)/international/charprop.el ${charsets}
35 ifeq ($(DUMPING),unexec)
36 LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup --temacs=dump
37@@ -596,15 +595,15 @@ endif
38 ## for the first time, this prevents any variation between configurations
39 ## in the contents of the DOC file.
40 ##
41-$(etc)/DOC: lisp.mk $(libsrc)/make-docfile$(EXEEXT) $(obj) $(lisp)
42+$(etc)/DOC: lisp.mk $(obj) $(lisp)
43 $(AM_V_GEN)$(MKDIR_P) $(etc)
44 $(AM_V_at)rm -f $(etc)/DOC
45- $(AM_V_at)$(libsrc)/make-docfile -d $(srcdir) \
46+ make-docfile -d $(srcdir) \
47 $(SOME_MACHINE_OBJECTS) $(obj) > $(etc)/DOC
48- $(AM_V_at)$(libsrc)/make-docfile -a $(etc)/DOC -d $(lispsource) \
49+ make-docfile -a $(etc)/DOC -d $(lispsource) \
50 $(shortlisp)
51
52-$(libsrc)/make-docfile$(EXEEXT) $(libsrc)/make-fingerprint$(EXEEXT): \
53+$(libsrc)/make-fingerprint$(EXEEXT): \
54 $(lib)/libgnu.a
55 $(MAKE) -C $(dir $@) $(notdir $@)
56
57@@ -622,8 +621,8 @@ am__v_GLOBALS_ = $(am__v_GLOBALS_@AM_DEF
58 am__v_GLOBALS_0 = @echo " GEN " globals.h;
59 am__v_GLOBALS_1 =
60
61-gl-stamp: $(libsrc)/make-docfile$(EXEEXT) $(GLOBAL_SOURCES)
62- $(AM_V_GLOBALS)$(libsrc)/make-docfile -d $(srcdir) -g $(obj) > globals.tmp
63+gl-stamp: $(GLOBAL_SOURCES)
64+ make-docfile -d $(srcdir) -g $(obj) > globals.tmp
65 $(AM_V_at)$(top_srcdir)/build-aux/move-if-change globals.tmp globals.h
66 $(AM_V_at)echo timestamp > $@
67
68@@ -637,7 +636,7 @@ $(LIBEGNU_ARCHIVE): $(config_h)
69 $(MAKE) -C $(dir $@) all
70
71 ifeq ($(HAVE_PDUMPER),yes)
72- MAKE_PDUMPER_FINGERPRINT = $(libsrc)/make-fingerprint$(EXEEXT)
73+ MAKE_PDUMPER_FINGERPRINT = make-fingerprint
74 else
75 MAKE_PDUMPER_FINGERPRINT =
76 endif
77@@ -647,7 +646,7 @@ endif
78 ## This goes on to affect various things, and the emacs binary fails
79 ## to start if Vinstallation_directory has the wrong value.
80 temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \
81- $(charsets) $(charscript) $(MAKE_PDUMPER_FINGERPRINT)
82+ $(charsets) $(charscript)
83 $(AM_V_CCLD)$(CC) -o $@.tmp \
84 $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
85 $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES)