Andrew Geissler | d688a01 | 2020-09-18 13:36:00 -0500 | [diff] [blame^] | 1 | SUMMARY = "Emacs is the extensible, customizable, self-documenting real-time display editor" |
| 2 | HOMEPAGE = "https://www.gnu.org/software/emacs/" |
| 3 | |
| 4 | LICENSE = "GPLv3" |
| 5 | LIC_FILES_CHKSUM = "file://COPYING;md5=1ebbd3e34237af26da5dc08a4e440464" |
| 6 | |
| 7 | SRC_URI = "https://ftp.gnu.org/pub/gnu/emacs/emacs-${PV}.tar.xz" |
| 8 | |
| 9 | SRC_URI_append_class-target = " file://usemake-docfile-native.patch" |
| 10 | |
| 11 | SRC_URI[sha256sum] = "4a4c128f915fc937d61edfc273c98106711b540c9be3cd5d2e2b9b5b2f172e41" |
| 12 | |
| 13 | PACKAGECONFIG[gnutls] = "--with-gnutls=yes,--with-gnutls=no,gnutls" |
| 14 | PACKAGECONFIG[kerberos] = "--with-kerberos=yes,--with-kerberos=no,krb5" |
| 15 | PACKAGECONFIG[libgmp] = "--with-libgmp=yes,--with-libgmp=no,gmp" |
| 16 | |
| 17 | PACKAGECONFIG ??= "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) |
| 21 | EXTRA_OECONF = " --with-x=no --with-dumping=none" |
| 22 | |
| 23 | DEPENDS = "ncurses" |
| 24 | DEPENDS_append_class-target = " emacs-native" |
| 25 | |
| 26 | inherit autotools mime-xdg |
| 27 | |
| 28 | |
| 29 | do_compile_class-native (){ |
| 30 | cd ${B}/lib-src |
| 31 | oe_runmake make-docfile |
| 32 | oe_runmake make-fingerprint |
| 33 | } |
| 34 | do_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 | |
| 41 | do_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 |
| 60 | PACKAGE_BEFORE_PN = "${PN}-minimal ${PN}-base ${PN}-full" |
| 61 | RPROVIDES_${PN}-base = "${PN}" |
| 62 | RDEPENDS_${PN}-base_class-target = "${PN}-minimal" |
| 63 | RDEPENDS_${PN}-full_class-target = "${PN}" |
| 64 | |
| 65 | |
| 66 | # A minimal version of emacs that works |
| 67 | FILES_${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 |
| 186 | FILES_${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 |
| 254 | FILES_${PN}-full = "${FILES_${PN}}" |
| 255 | FILES_${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. |
| 261 | BBCLASSEXTEND = "native" |