Commit | Line | Data |
---|---|---|
468bdabb | 1 | ;;; GNU Guix --- Functional package management for GNU |
5645307f | 2 | ;;; Copyright © 2013-2017, 2019, 2021-2022 Ludovic Courtès <ludo@gnu.org> |
eeb883cb | 3 | ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr> |
4a3e602c | 4 | ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com> |
36a09d18 | 5 | ;;; Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Mark H Weaver <mhw@netris.org> |
eeb883cb RW |
6 | ;;; Copyright © 2014, 2015, 2016, 2017 Alex Kost <alezost@gmail.com> |
7 | ;;; Copyright © 2016, 2018 Arun Isaac <arunisaac@systemreboot.net> | |
8 | ;;; Copyright © 2016 Federico Beffa <beffa@fbengineering.ch> | |
9 | ;;; Copyright © 2016 David Thompson <dthompson2@worcester.edu> | |
3c986a7d | 10 | ;;; Copyright © 2016 Nikita <nikita@n0.is> |
eeb883cb | 11 | ;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com> |
ffaec307 | 12 | ;;; Copyright © 2017, 2019, 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com> |
eeb883cb RW |
13 | ;;; Copyright © 2017 Alex Vong <alexvong1995@gmail.com> |
14 | ;;; Copyright © 2017, 2018 Ricardo Wurmus <rekado@elephly.net> | |
7a0efa77 | 15 | ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org> |
eeb883cb RW |
16 | ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il> |
17 | ;;; Copyright © 2018 Mathieu Othacehe <m.othacehe@gmail.com> | |
f5ef08c4 | 18 | ;;; Copyright © 2018, 2019, 2021 Tobias Geerinckx-Rice <me@tobias.gr> |
5ce153b1 | 19 | ;;; Copyright © 2019 Jesse John Gildersleve <jessejohngildersleve@zohomail.eu> |
92d2205a | 20 | ;;; Copyright © 2019 Valentin Ignatev <valentignatev@gmail.com> |
4baeb727 | 21 | ;;; Copyright © 2019, 2021 Liliana Marie Prikler <liliana.prikler@gmail.com> |
c2cf286c | 22 | ;;; Copyright © 2019 Amin Bandali <bandali@gnu.org> |
ef0cb0dd | 23 | ;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us> |
562f7e3f | 24 | ;;; Copyright © 2020 Morgan Smith <Morgan.J.Smith@outlook.com> |
e9f10f1d | 25 | ;;; Copyright © 2022 Zhu Zihao <all_but_last@163.com> |
468bdabb LC |
26 | ;;; |
27 | ;;; This file is part of GNU Guix. | |
28 | ;;; | |
29 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
30 | ;;; under the terms of the GNU General Public License as published by | |
31 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
32 | ;;; your option) any later version. | |
33 | ;;; | |
34 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
35 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
36 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
37 | ;;; GNU General Public License for more details. | |
38 | ;;; | |
39 | ;;; You should have received a copy of the GNU General Public License | |
40 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
41 | ||
1ffa7090 | 42 | (define-module (gnu packages emacs) |
f61e0e79 | 43 | #:use-module ((guix licenses) #:prefix license:) |
468bdabb | 44 | #:use-module (guix packages) |
64557bc6 | 45 | #:use-module (guix gexp) |
468bdabb | 46 | #:use-module (guix download) |
f906d30c | 47 | #:use-module (guix git-download) |
dbcba75c | 48 | #:use-module (guix build-system) |
468bdabb | 49 | #:use-module (guix build-system gnu) |
71f57158 | 50 | #:use-module (guix build-system glib-or-gtk) |
59a43334 | 51 | #:use-module (gnu packages) |
eeb883cb | 52 | #:use-module (gnu packages acl) |
18d26210 | 53 | #:use-module (gnu packages autotools) |
be379ee7 | 54 | #:use-module (gnu packages base) |
f61e0e79 | 55 | #:use-module (gnu packages compression) |
eeb883cb | 56 | #:use-module (gnu packages fontutils) |
64557bc6 | 57 | #:use-module (gnu packages freedesktop) |
a80b60f4 | 58 | #:use-module (gnu packages fribidi) |
dbcba75c | 59 | #:use-module (gnu packages gcc) |
a80b60f4 | 60 | #:use-module (gnu packages gd) |
eeb883cb | 61 | #:use-module (gnu packages gettext) |
4baeb727 | 62 | #:use-module (gnu packages ghostscript) |
eeb883cb | 63 | #:use-module (gnu packages glib) |
5ce153b1 | 64 | #:use-module (gnu packages gnome) ; for librsvg |
eeb883cb RW |
65 | #:use-module (gnu packages gtk) |
66 | #:use-module (gnu packages guile) | |
67 | #:use-module (gnu packages image) | |
947398c7 | 68 | #:use-module (gnu packages linux) ; alsa-lib, gpm |
5ce153b1 | 69 | #:use-module (gnu packages mail) ; for mailutils |
36a09d18 | 70 | #:use-module (gnu packages multiprecision) |
eeb883cb | 71 | #:use-module (gnu packages ncurses) |
4baeb727 | 72 | #:use-module (gnu packages pdf) |
eeb883cb | 73 | #:use-module (gnu packages pkg-config) |
15870cc0 | 74 | #:use-module (gnu packages selinux) |
e9f10f1d | 75 | #:use-module (gnu packages sqlite) |
eeb883cb RW |
76 | #:use-module (gnu packages texinfo) |
77 | #:use-module (gnu packages tls) | |
92d2205a | 78 | #:use-module (gnu packages web) ; for jansson |
5bbb04f9 | 79 | #:use-module (gnu packages webkit) |
eeb883cb RW |
80 | #:use-module (gnu packages xml) |
81 | #:use-module (gnu packages xorg) | |
4a3e602c | 82 | #:use-module (guix utils) |
5d2863df | 83 | #:use-module (ice-9 match) |
eeb883cb | 84 | #:use-module (srfi srfi-1)) |
468bdabb | 85 | |
dbcba75c LMP |
86 | (define (%emacs-modules build-system) |
87 | (let ((which (build-system-name build-system))) | |
88 | `((guix build ,(symbol-append which '-build-system)) | |
89 | (guix build utils) | |
90 | (srfi srfi-1) | |
91 | (ice-9 ftw)))) | |
92 | ||
468bdabb LC |
93 | (define-public emacs |
94 | (package | |
95 | (name "emacs") | |
b65a1e4a | 96 | (version "28.1") |
468bdabb | 97 | (source (origin |
3bd3a625 MC |
98 | (method url-fetch) |
99 | (uri (string-append "mirror://gnu/emacs/emacs-" | |
100 | version ".tar.xz")) | |
101 | (sha256 | |
102 | (base32 | |
b65a1e4a | 103 | "1qbmmmhnjhn4lvzsnyk7l5ganbi6wzbm38jc1a7hhyh3k78b7c98")) |
3bd3a625 MC |
104 | (patches (search-patches "emacs-exec-path.patch" |
105 | "emacs-fix-scheme-indent-function.patch" | |
106 | "emacs-source-date-epoch.patch")) | |
107 | (modules '((guix build utils))) | |
108 | (snippet | |
109 | '(with-directory-excursion "lisp" | |
110 | ;; Delete the bundled byte-compiled elisp files and generated | |
111 | ;; autoloads. | |
112 | (for-each delete-file | |
113 | (append (find-files "." "\\.elc$") | |
114 | (find-files "." "loaddefs\\.el$") | |
36a09d18 | 115 | (find-files "eshell" "^esh-groups\\.el$"))) |
dc701091 | 116 | |
3bd3a625 MC |
117 | ;; Make sure Tramp looks for binaries in the right places on |
118 | ;; remote Guix System machines, where 'getconf PATH' returns | |
119 | ;; something bogus. | |
4f9ac2af | 120 | (substitute* "net/tramp.el" |
3bd3a625 MC |
121 | ;; Patch the line after "(defcustom tramp-remote-path". |
122 | (("\\(tramp-default-remote-path") | |
123 | (format #f "(tramp-default-remote-path ~s ~s ~s ~s " | |
124 | "~/.guix-profile/bin" "~/.guix-profile/sbin" | |
125 | "/run/current-system/profile/bin" | |
126 | "/run/current-system/profile/sbin"))) | |
d1c11418 | 127 | |
3bd3a625 MC |
128 | ;; Make sure Man looks for C header files in the right |
129 | ;; places. | |
130 | (substitute* "man.el" | |
131 | (("\"/usr/local/include\"" line) | |
132 | (string-join | |
133 | (list line | |
134 | "\"~/.guix-profile/include\"" | |
135 | "\"/var/guix/profiles/system/profile/include\"") | |
64557bc6 | 136 | " "))))))) |
71f57158 | 137 | (build-system glib-or-gtk-build-system) |
468bdabb | 138 | (arguments |
64557bc6 LMP |
139 | (list |
140 | #:tests? #f ; no check target | |
dbcba75c | 141 | #:modules (%emacs-modules build-system) |
64557bc6 LMP |
142 | #:configure-flags #~(list "--with-modules" |
143 | "--with-cairo" | |
dbcba75c | 144 | "--with-native-compilation" |
64557bc6 | 145 | "--disable-build-details") |
dbcba75c | 146 | #:make-flags #~(list "NATIVE_FULL_AOT=1") |
64557bc6 LMP |
147 | #:phases |
148 | #~(modify-phases %standard-phases | |
dbcba75c LMP |
149 | (add-after 'set-paths 'set-libgccjit-path |
150 | (lambda* (#:key inputs #:allow-other-keys) | |
151 | (define (first-subdirectory/absolute directory) | |
152 | (let ((files (scandir | |
153 | directory | |
154 | (lambda (file) | |
155 | (and (not (member file '("." ".."))) | |
156 | (file-is-directory? (string-append | |
157 | directory "/" | |
158 | file))))))) | |
159 | (and (not (null? files)) | |
160 | (string-append directory "/" (car files))))) | |
161 | (let* ((libgccjit-libdir | |
162 | (first-subdirectory/absolute ;; version | |
163 | (first-subdirectory/absolute ;; host type | |
164 | (search-input-directory inputs "lib/gcc"))))) | |
165 | (setenv "LIBRARY_PATH" | |
166 | (string-append (getenv "LIBRARY_PATH") | |
167 | ":" libgccjit-libdir))))) | |
5f315e1d LMP |
168 | (add-after 'unpack 'enable-elogind |
169 | (lambda _ | |
170 | (substitute* "configure.ac" | |
171 | (("libsystemd") "libelogind")) | |
172 | (when (file-exists? "configure") | |
173 | (delete-file "configure")))) | |
64557bc6 LMP |
174 | (add-after 'unpack 'patch-program-file-names |
175 | (lambda* (#:key inputs #:allow-other-keys) | |
176 | (substitute* '("src/callproc.c" | |
177 | "lisp/term.el" | |
178 | "lisp/htmlfontify.el" | |
179 | "lisp/textmodes/artist.el" | |
180 | "lisp/progmodes/sh-script.el") | |
181 | (("\"/bin/sh\"") | |
182 | (format #f "~s" (search-input-file inputs "/bin/sh")))) | |
183 | (substitute* "lisp/doc-view.el" | |
184 | (("\"(gs|dvipdf|ps2pdf|pdftotext)\"" all what) | |
77581764 LMP |
185 | (let ((replacement (false-if-exception |
186 | (search-input-file | |
187 | inputs | |
188 | (string-append "/bin/" what))))) | |
64557bc6 LMP |
189 | (if replacement |
190 | (string-append "\"" replacement "\"") | |
191 | all)))) | |
192 | ;; match ".gvfs-fuse-daemon-real" and ".gvfsd-fuse-real" | |
193 | ;; respectively when looking for GVFS processes. | |
194 | (substitute* "lisp/net/tramp-gvfs.el" | |
195 | (("\\(tramp-compat-process-running-p \"(.*)\"\\)" all process) | |
196 | (format #f "(or ~a (tramp-compat-process-running-p ~s))" | |
197 | all (string-append "." process "-real")))))) | |
dbcba75c LMP |
198 | (add-after 'unpack 'patch-compilation-driver |
199 | (lambda _ | |
200 | (substitute* "lisp/emacs-lisp/comp.el" | |
201 | (("\\(defcustom native-comp-driver-options nil") | |
202 | (format | |
203 | #f "(defcustom native-comp-driver-options '(~@{~s~^ ~})" | |
204 | (string-append | |
205 | "-B" #$(this-package-input "binutils") "/bin/") | |
206 | (string-append | |
207 | "-B" #$(this-package-input "glibc") "/lib/") | |
208 | (string-append | |
209 | "-B" #$(this-package-input "libgccjit") "/lib/") | |
210 | (string-append | |
211 | "-B" #$(this-package-input "libgccjit") "/lib/gcc/")))))) | |
64557bc6 LMP |
212 | (add-before 'configure 'fix-/bin/pwd |
213 | (lambda _ | |
214 | ;; Use `pwd', not `/bin/pwd'. | |
215 | (substitute* (find-files "." "^Makefile\\.in$") | |
216 | (("/bin/pwd") | |
217 | "pwd")))) | |
218 | (add-after 'install 'install-site-start | |
219 | ;; Use 'guix-emacs' in "site-start.el", which is used autoload the | |
220 | ;; Elisp packages found in EMACSLOADPATH. | |
221 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
222 | (let* ((out (assoc-ref outputs "out")) | |
223 | (lisp-dir (string-append out "/share/emacs/site-lisp")) | |
224 | (emacs (string-append out "/bin/emacs"))) | |
ffaec307 | 225 | |
64557bc6 LMP |
226 | ;; This is duplicated from emacs-utils to prevent coupling. |
227 | (define* (emacs-byte-compile-directory dir) | |
228 | (let ((expr `(progn | |
229 | (setq byte-compile-debug t) | |
230 | (byte-recompile-directory | |
231 | (file-name-as-directory ,dir) 0 1)))) | |
232 | (invoke emacs "--quick" "--batch" | |
233 | (format #f "--eval=~s" expr)))) | |
ffaec307 | 234 | |
64557bc6 LMP |
235 | (copy-file #$(local-file |
236 | (search-auxiliary-file "emacs/guix-emacs.el")) | |
237 | (string-append lisp-dir "/guix-emacs.el")) | |
238 | (with-output-to-file (string-append lisp-dir "/site-start.el") | |
239 | (lambda () | |
240 | (display | |
241 | (string-append | |
242 | "(when (require 'guix-emacs nil t)\n" | |
243 | " (guix-emacs-autoload-packages)\n" | |
244 | " (advice-add 'package-load-all-descriptors" | |
245 | " :after #'guix-emacs-load-package-descriptors))")))) | |
246 | ;; Remove the extraneous subdirs.el file, as it causes Emacs to | |
247 | ;; add recursively all the the sub-directories of a profile's | |
248 | ;; share/emacs/site-lisp union when added to EMACSLOADPATH, | |
249 | ;; which leads to conflicts. | |
250 | (delete-file (string-append lisp-dir "/subdirs.el")) | |
251 | ;; Byte compile the site-start files. | |
252 | (emacs-byte-compile-directory lisp-dir)))) | |
253 | (add-after 'glib-or-gtk-wrap 'restore-emacs-pdmp | |
254 | ;; restore the dump file that Emacs installs somewhere in | |
255 | ;; libexec/ to its original state | |
256 | (lambda* (#:key outputs target #:allow-other-keys) | |
257 | (let* ((libexec (string-append (assoc-ref outputs "out") | |
258 | "/libexec")) | |
259 | ;; each of these ought to only match a single file, | |
260 | ;; but even if not (find-files) sorts by string<, | |
261 | ;; so the Nth element in one maps to the Nth element of | |
262 | ;; the other | |
263 | (pdmp (find-files libexec "\\.pdmp$")) | |
264 | (pdmp-real (find-files libexec "\\.pdmp-real$"))) | |
265 | (for-each rename-file pdmp-real pdmp)))) | |
266 | (add-after 'glib-or-gtk-wrap 'strip-double-wrap | |
267 | (lambda* (#:key outputs #:allow-other-keys) | |
268 | ;; Directly copy emacs-X.Y to emacs, so that it is not wrapped | |
269 | ;; twice. This also fixes a minor issue, where WMs would not be | |
270 | ;; able to track emacs back to emacs.desktop. | |
271 | (with-directory-excursion (assoc-ref outputs "out") | |
272 | (copy-file | |
273 | (car (find-files "bin" "^emacs-([0-9]+\\.)+[0-9]+$")) | |
274 | "bin/emacs")))) | |
275 | (add-after 'strip-double-wrap 'wrap-emacs-paths | |
276 | (lambda* (#:key inputs outputs #:allow-other-keys) | |
277 | (let* ((out (assoc-ref outputs "out")) | |
278 | (lisp-dirs (find-files (string-append out "/share/emacs") | |
279 | "^lisp$" | |
280 | #:directories? #t))) | |
281 | (for-each | |
282 | (lambda (prog) | |
283 | (wrap-program prog | |
284 | ;; emacs-next and variants rely on uname being in PATH for | |
285 | ;; Tramp. Tramp paths can't be hardcoded, because they | |
286 | ;; need to be portable. | |
287 | `("PATH" suffix | |
288 | ,(map dirname | |
289 | (list (search-input-file inputs "/bin/gzip") | |
290 | ;; for coreutils | |
291 | (search-input-file inputs "/bin/yes")))) | |
292 | `("EMACSLOADPATH" suffix ,lisp-dirs))) | |
293 | (find-files (string-append out "/bin") | |
294 | ;; Matches versioned and unversioned emacs binaries. | |
295 | ;; We don't patch emacsclient, because it takes its | |
296 | ;; environment variables from emacs. | |
297 | ;; Likewise, we don't need to patch helper binaries | |
298 | ;; like etags, ctags or ebrowse. | |
299 | "^emacs(-[0-9]+(\\.[0-9]+)*)?$")))))))) | |
468bdabb | 300 | (inputs |
64557bc6 LMP |
301 | (list gnutls |
302 | ncurses | |
468bdabb | 303 | |
dbcba75c LMP |
304 | ;; To "unshadow" ld-wrapper in native builds |
305 | (make-ld-wrapper "ld-wrapper" #:binutils binutils) | |
306 | ||
307 | ;; For native compilation | |
308 | binutils | |
309 | glibc | |
310 | libgccjit | |
311 | ||
64557bc6 LMP |
312 | ;; Required for "core" functionality, such as dired and compression. |
313 | coreutils | |
314 | gzip | |
d13b46fa | 315 | |
64557bc6 LMP |
316 | ;; Avoid Emacs's limited movemail substitute that retrieves POP3 |
317 | ;; email only via insecure channels. | |
318 | ;; This is not needed for (modern) IMAP. | |
319 | mailutils | |
5ce153b1 | 320 | |
64557bc6 LMP |
321 | gpm |
322 | libx11 | |
323 | gtk+ | |
324 | cairo | |
325 | pango | |
326 | harfbuzz | |
327 | libxft | |
328 | libtiff | |
329 | giflib | |
fd5b7393 | 330 | lcms |
64557bc6 | 331 | libjpeg-turbo |
15870cc0 | 332 | libselinux |
64557bc6 LMP |
333 | acl |
334 | jansson | |
335 | gmp | |
336 | ghostscript | |
337 | poppler | |
5f315e1d | 338 | elogind |
50efa797 | 339 | |
64557bc6 LMP |
340 | ;; When looking for libpng `configure' links with `-lpng -lz', so we |
341 | ;; must also provide zlib as an input. | |
342 | libpng | |
343 | zlib | |
344 | (if (target-x86-64?) | |
345 | librsvg-bootstrap | |
346 | librsvg-2.40) | |
347 | libxpm | |
348 | libxml2 | |
349 | libice | |
350 | libsm | |
351 | alsa-lib | |
352 | dbus | |
01c5c21a | 353 | |
64557bc6 LMP |
354 | ;; multilingualization support |
355 | libotf | |
356 | m17n-lib)) | |
c4c4cc05 | 357 | (native-inputs |
5f315e1d | 358 | (list autoconf pkg-config texinfo)) |
64c98347 LC |
359 | (native-search-paths |
360 | (list (search-path-specification | |
215a45d9 | 361 | (variable "EMACSLOADPATH") |
307a2d2e | 362 | (files '("share/emacs/site-lisp"))) |
dbcba75c LMP |
363 | (search-path-specification |
364 | (variable "EMACSNATIVELOADPATH") | |
365 | (files '("lib/emacs/native-site-lisp"))) | |
215a45d9 | 366 | (search-path-specification |
64c98347 LC |
367 | (variable "INFOPATH") |
368 | (files '("share/info"))))) | |
369 | ||
6fd52309 | 370 | (home-page "https://www.gnu.org/software/emacs/") |
f50d2669 | 371 | (synopsis "The extensible, customizable, self-documenting text editor") |
468bdabb | 372 | (description |
79c311b8 LC |
373 | "GNU Emacs is an extensible and highly customizable text editor. It is |
374 | based on an Emacs Lisp interpreter with extensions for text editing. Emacs | |
375 | has been extended in essentially all areas of computing, giving rise to a | |
376 | vast array of packages supporting, e.g., email, IRC and XMPP messaging, | |
377 | spreadsheets, remote server editing, and much more. Emacs includes extensive | |
378 | documentation on all aspects of the system, from basic editing to writing | |
379 | large Lisp programs. It has full Unicode support for nearly all human | |
380 | languages.") | |
f61e0e79 | 381 | (license license:gpl3+))) |
4f028c8f | 382 | |
562f7e3f | 383 | (define-public emacs-next |
77f84500 JP |
384 | (let ((commit "0a5477b448e6b62bcedc1803e531ec7686eea48d") |
385 | (revision "1")) | |
dbcf2b61 MB |
386 | (package |
387 | (inherit emacs) | |
562f7e3f | 388 | (name "emacs-next") |
eb02e086 | 389 | (version (git-version "29.0.50" revision commit)) |
562f7e3f MS |
390 | (source |
391 | (origin | |
392 | (inherit (package-source emacs)) | |
393 | (method git-fetch) | |
394 | (uri (git-reference | |
395 | (url "https://git.savannah.gnu.org/git/emacs.git/") | |
396 | (commit commit))) | |
397 | (file-name (git-file-name name version)) | |
398 | (sha256 | |
399 | (base32 | |
77f84500 | 400 | "0dqmrawkvbypxp8gcnspnhhmfamzp3l62gfgp1pw2l6svz58v991")))) |
e9f10f1d ZZ |
401 | (inputs |
402 | (modify-inputs (package-inputs emacs) | |
403 | (prepend sqlite))) | |
562f7e3f | 404 | (native-inputs |
8394619b LC |
405 | (modify-inputs (package-native-inputs emacs) |
406 | (prepend autoconf)))))) | |
562f7e3f | 407 | |
2a1eda5a | 408 | (define-public emacs-next-pgtk |
52795294 LMP |
409 | (package |
410 | (inherit emacs-next) | |
411 | (name "emacs-next-pgtk") | |
77e768ac AT |
412 | (source |
413 | (origin | |
414 | (inherit (package-source emacs-next)) | |
f7565101 AT |
415 | (patches |
416 | (append (search-patches "emacs-pgtk-super-key-fix.patch") | |
417 | (origin-patches (package-source emacs-next)))))) | |
52795294 LMP |
418 | (arguments |
419 | (substitute-keyword-arguments (package-arguments emacs-next) | |
9a520eb2 LMP |
420 | ((#:configure-flags flags #~'()) |
421 | #~(cons* "--with-pgtk" "--with-xwidgets" #$flags)))) | |
52795294 LMP |
422 | (propagated-inputs |
423 | (list gsettings-desktop-schemas glib-networking)) | |
424 | (inputs | |
9a520eb2 LMP |
425 | (modify-inputs (package-inputs emacs-next) |
426 | (prepend webkitgtk-with-libsoup2))) | |
52795294 LMP |
427 | (home-page "https://github.com/masm11/emacs") |
428 | (synopsis "Emacs text editor with @code{pgtk} and @code{xwidgets} support") | |
429 | (description "This Emacs build implements graphical UI purely in terms of | |
430 | GTK and also enables xwidgets."))) | |
2a1eda5a | 431 | |
b2eaf7ba | 432 | (define-public emacs-minimal |
4fd540b7 LC |
433 | ;; This is the version that you should use as an input to packages that just |
434 | ;; need to byte-compile .el files. | |
36a09d18 | 435 | (package/inherit emacs |
b2eaf7ba AK |
436 | (name "emacs-minimal") |
437 | (synopsis "The extensible text editor (used only for byte-compilation)") | |
438 | (build-system gnu-build-system) | |
439 | (arguments | |
4e941436 | 440 | (substitute-keyword-arguments (package-arguments emacs) |
3443cbf8 | 441 | ((#:configure-flags flags #~'()) |
35707e50 | 442 | #~(list "--with-gnutls=no" "--disable-build-details")) |
dbcba75c | 443 | ((#:modules _) (%emacs-modules build-system)) |
36a09d18 | 444 | ((#:phases phases) |
35707e50 LMP |
445 | #~(modify-phases #$phases |
446 | (delete 'restore-emacs-pdmp) | |
447 | (delete 'strip-double-wrap))))) | |
dbcba75c LMP |
448 | (inputs (list ncurses coreutils gzip |
449 | (make-ld-wrapper "ld-wrapper" #:binutils binutils) | |
450 | binutils glibc libgccjit zlib)) | |
3443cbf8 | 451 | (native-inputs (list autoconf pkg-config)))) |
b2eaf7ba | 452 | |
5bbb04f9 | 453 | (define-public emacs-xwidgets |
36a09d18 | 454 | (package/inherit emacs |
5bbb04f9 AB |
455 | (name "emacs-xwidgets") |
456 | (synopsis "The extensible, customizable, self-documenting text | |
457 | editor (with xwidgets support)") | |
458 | (build-system gnu-build-system) | |
459 | (arguments | |
4e941436 | 460 | (substitute-keyword-arguments (package-arguments emacs) |
a56a3fa7 LMP |
461 | ((#:configure-flags flags #~'()) |
462 | #~(cons "--with-xwidgets" #$flags)) | |
dbcba75c | 463 | ((#:modules _) (%emacs-modules build-system)) |
36a09d18 | 464 | ((#:phases phases) |
a56a3fa7 LMP |
465 | #~(modify-phases #$phases |
466 | (delete 'restore-emacs-pdmp) | |
467 | (delete 'strip-double-wrap))))) | |
5bbb04f9 | 468 | (inputs |
a56a3fa7 LMP |
469 | (modify-inputs (package-inputs emacs) |
470 | (prepend webkitgtk-with-libsoup2 libxcomposite))))) | |
5bbb04f9 | 471 | |
b2eaf7ba | 472 | (define-public emacs-no-x |
36a09d18 | 473 | (package/inherit emacs |
4fd540b7 LC |
474 | (name "emacs-no-x") |
475 | (synopsis "The extensible, customizable, self-documenting text | |
476 | editor (console only)") | |
477 | (build-system gnu-build-system) | |
4949188d LMP |
478 | (inputs (modify-inputs (package-inputs emacs) |
479 | (delete "libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg" | |
480 | "imagemagick" "libpng" "librsvg" "libxpm" "libice" | |
481 | "libsm" "cairo" "pango" "harfbuzz" | |
482 | ;; These depend on libx11, so remove them as well. | |
483 | "libotf" "m17n-lib" "dbus"))) | |
36a09d18 MW |
484 | (arguments |
485 | (substitute-keyword-arguments (package-arguments emacs) | |
4949188d LMP |
486 | ((#:configure-flags flags #~'()) |
487 | #~(delete "--with-cairo" #$flags)) | |
dbcba75c | 488 | ((#:modules _) (%emacs-modules build-system)) |
36a09d18 | 489 | ((#:phases phases) |
4949188d LMP |
490 | #~(modify-phases #$phases |
491 | (delete 'restore-emacs-pdmp) | |
492 | (delete 'strip-double-wrap))))))) | |
4fd540b7 | 493 | |
4a3e602c | 494 | (define-public emacs-no-x-toolkit |
36a09d18 | 495 | (package/inherit emacs |
4a3e602c TUBK |
496 | (name "emacs-no-x-toolkit") |
497 | (synopsis "The extensible, customizable, self-documenting text | |
498 | editor (without an X toolkit)" ) | |
71f57158 | 499 | (build-system gnu-build-system) |
484dd71a LMP |
500 | (inputs (modify-inputs (package-inputs emacs) |
501 | (delete "gtk+") | |
502 | (prepend inotify-tools))) | |
f862697b | 503 | (arguments |
36a09d18 | 504 | (substitute-keyword-arguments (package-arguments emacs) |
484dd71a LMP |
505 | ((#:configure-flags flags #~'()) |
506 | #~(cons "--with-x-toolkit=no" #$flags)) | |
dbcba75c | 507 | ((#:modules _) (%emacs-modules build-system)) |
36a09d18 | 508 | ((#:phases phases) |
484dd71a | 509 | #~(modify-phases #$phases |
68be4da8 LP |
510 | (delete 'restore-emacs-pdmp) |
511 | (delete 'strip-double-wrap))))))) | |
4a3e602c | 512 | |
abbca232 | 513 | (define-public emacs-wide-int |
36a09d18 | 514 | (package/inherit emacs |
abbca232 DNB |
515 | (name "emacs-wide-int") |
516 | (synopsis "The extensible, customizable, self-documenting text | |
517 | editor (with wide ints)" ) | |
518 | (arguments | |
519 | (substitute-keyword-arguments (package-arguments emacs) | |
520 | ((#:configure-flags flags) | |
1110479d | 521 | #~(cons "--with-wide-int" #$flags)))))) |
abbca232 | 522 | |
f906d30c | 523 | (define-public guile-emacs |
ef5fa91c LF |
524 | (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b") |
525 | (revision "0")) | |
dbcf2b61 MB |
526 | (package |
527 | (inherit emacs) | |
ef5fa91c LF |
528 | (name "guile-emacs") |
529 | (version (git-version "0.0.0" revision commit)) | |
530 | (source (origin | |
531 | (method git-fetch) | |
532 | (uri (git-reference | |
533 | (url "https://git.hcoop.net/git/bpt/emacs.git") | |
534 | (commit commit))) | |
535 | (file-name (git-file-name name version)) | |
536 | (patches (search-patches "guile-emacs-fix-configure.patch")) | |
537 | (sha256 | |
538 | (base32 | |
539 | "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6")))) | |
540 | (native-inputs | |
6b819f82 LC |
541 | (modify-inputs (package-native-inputs emacs) |
542 | (prepend autoconf automake guile-for-guile-emacs))) | |
ef5fa91c LF |
543 | (arguments |
544 | (substitute-keyword-arguments `(;; Build fails if we allow parallel build. | |
545 | #:parallel-build? #f | |
546 | ;; Tests aren't passing for now. | |
547 | #:tests? #f | |
548 | ,@(package-arguments emacs)) | |
36a09d18 | 549 | ((#:configure-flags flags ''()) |
5645307f | 550 | #~(delete "--with-cairo" #$flags)) |
ef5fa91c | 551 | ((#:phases phases) |
5645307f LC |
552 | #~(modify-phases #$phases |
553 | (add-after 'unpack 'autogen | |
554 | (lambda _ | |
555 | (invoke "sh" "autogen.sh"))) | |
556 | ;; Build sometimes fails: deps/dispnew.d: No such file or directory | |
557 | (add-before 'build 'make-deps-dir | |
558 | (lambda _ | |
559 | (invoke "mkdir" "-p" "src/deps"))) | |
560 | (delete 'restore-emacs-pdmp) | |
561 | (delete 'strip-double-wrap)))))))) | |
f906d30c | 562 | |
eeb883cb | 563 | (define-public m17n-db |
9a4c9715 | 564 | (package |
eeb883cb RW |
565 | (name "m17n-db") |
566 | (version "1.8.0") | |
567 | (source | |
568 | (origin | |
569 | (method url-fetch) | |
570 | (uri (string-append "mirror://savannah/m17n/m17n-db-" | |
571 | version ".tar.gz")) | |
572 | (sha256 | |
573 | (base32 | |
574 | "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5")))) | |
9a4c9715 | 575 | (build-system gnu-build-system) |
08fc0d68 | 576 | (inputs |
eeb883cb | 577 | `(("gettext" ,gettext-minimal))) |
77c9286d | 578 | (arguments |
eeb883cb RW |
579 | `(#:configure-flags |
580 | (list (string-append "--with-charmaps=" | |
581 | (assoc-ref %build-inputs "libc") | |
582 | "/share/i18n/charmaps")))) | |
583 | ;; With `guix lint' the home-page URI returns a small page saying | |
584 | ;; that your browser does not handle frames. This triggers the "URI | |
585 | ;; returns suspiciously small file" warning. | |
586 | (home-page "https://www.nongnu.org/m17n/") | |
587 | (synopsis "Multilingual text processing library (database)") | |
588 | (description "The m17n library realizes multilingualization of | |
589 | many aspects of applications. The m17n library represents | |
590 | multilingual text as an object named M-text. M-text is a string with | |
591 | attributes called text properties, and designed to substitute for | |
592 | string in C. Text properties carry any information required to input, | |
593 | display and edit the text. | |
c7e553a3 | 594 | |
eeb883cb RW |
595 | This package contains the library database.") |
596 | (license license:lgpl2.1+))) | |
1095bd1d | 597 | |
eeb883cb | 598 | (define-public m17n-lib |
2316078a | 599 | (package |
eeb883cb RW |
600 | (name "m17n-lib") |
601 | (version "1.8.0") | |
2316078a RW |
602 | (source |
603 | (origin | |
604 | (method url-fetch) | |
eeb883cb RW |
605 | (uri (string-append "mirror://savannah/m17n/m17n-lib-" |
606 | version ".tar.gz")) | |
2316078a RW |
607 | (sha256 |
608 | (base32 | |
eeb883cb | 609 | "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq")))) |
64e43c67 | 610 | (build-system gnu-build-system) |
64e43c67 | 611 | (inputs |
8394619b LC |
612 | (list fribidi |
613 | gd | |
614 | libotf | |
615 | libxft | |
616 | libxml2 | |
617 | m17n-db)) | |
85777fe5 | 618 | (arguments |
eeb883cb RW |
619 | `(#:parallel-build? #f)) |
620 | ;; With `guix lint' the home-page URI returns a small page saying | |
621 | ;; that your browser does not handle frames. This triggers the "URI | |
622 | ;; returns suspiciously small file" warning. | |
623 | (home-page "https://www.nongnu.org/m17n/") | |
624 | (synopsis "Multilingual text processing library (runtime)") | |
625 | (description "The m17n library realizes multilingualization of | |
626 | many aspects of applications. The m17n library represents | |
627 | multilingual text as an object named M-text. M-text is a string with | |
628 | attributes called text properties, and designed to substitute for | |
629 | string in C. Text properties carry any information required to input, | |
630 | display and edit the text. | |
cf9ce01f | 631 | |
eeb883cb RW |
632 | This package contains the library runtime.") |
633 | (license license:lgpl2.1+))) |