Correct name and email address for ng0.
[jackhill/guix/guix.git] / gnu / packages / emacs.scm
CommitLineData
468bdabb 1;;; GNU Guix --- Functional package management for GNU
eeb883cb
RW
2;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4a3e602c 4;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
84fe4420 5;;; Copyright © 2014, 2015, 2016, 2017, 2018 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>
47956fa0 10;;; Copyright © 2016 ng0 <ng0@n0.is>
eeb883cb
RW
11;;; Copyright © 2017 Marius Bakke <mbakke@fastmail.com>
12;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
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>
18;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
468bdabb
LC
19;;;
20;;; This file is part of GNU Guix.
21;;;
22;;; GNU Guix is free software; you can redistribute it and/or modify it
23;;; under the terms of the GNU General Public License as published by
24;;; the Free Software Foundation; either version 3 of the License, or (at
25;;; your option) any later version.
26;;;
27;;; GNU Guix is distributed in the hope that it will be useful, but
28;;; WITHOUT ANY WARRANTY; without even the implied warranty of
29;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
30;;; GNU General Public License for more details.
31;;;
32;;; You should have received a copy of the GNU General Public License
33;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
34
1ffa7090 35(define-module (gnu packages emacs)
f61e0e79 36 #:use-module ((guix licenses) #:prefix license:)
468bdabb
LC
37 #:use-module (guix packages)
38 #:use-module (guix download)
f906d30c 39 #:use-module (guix git-download)
468bdabb 40 #:use-module (guix build-system gnu)
71f57158 41 #:use-module (guix build-system glib-or-gtk)
59a43334 42 #:use-module (gnu packages)
eeb883cb 43 #:use-module (gnu packages acl)
18d26210 44 #:use-module (gnu packages autotools)
be379ee7 45 #:use-module (gnu packages base)
f61e0e79 46 #:use-module (gnu packages compression)
eeb883cb 47 #:use-module (gnu packages fontutils)
a80b60f4
AI
48 #:use-module (gnu packages fribidi)
49 #:use-module (gnu packages gd)
eeb883cb
RW
50 #:use-module (gnu packages gettext)
51 #:use-module (gnu packages glib)
52 #:use-module (gnu packages gnome) ; for librsvg
53 #:use-module (gnu packages gtk)
54 #:use-module (gnu packages guile)
55 #:use-module (gnu packages image)
56 #:use-module (gnu packages imagemagick)
57 #:use-module (gnu packages linux) ; alsa-lib
58 #:use-module (gnu packages ncurses)
59 #:use-module (gnu packages pkg-config)
60 #:use-module (gnu packages texinfo)
61 #:use-module (gnu packages tls)
5bbb04f9 62 #:use-module (gnu packages webkit)
eeb883cb
RW
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages xorg)
4a3e602c 65 #:use-module (guix utils)
eeb883cb 66 #:use-module (srfi srfi-1))
468bdabb
LC
67
68(define-public emacs
69 (package
70 (name "emacs")
2206c7ad 71 (version "26.1")
468bdabb
LC
72 (source (origin
73 (method url-fetch)
74 (uri (string-append "mirror://gnu/emacs/emacs-"
3be9f724 75 version ".tar.xz"))
468bdabb
LC
76 (sha256
77 (base32
2206c7ad 78 "0b6k1wq44rc8gkvxhi1bbjxbz3cwg29qbq8mklq2az6p1hjgrx0w"))
fc1adab1 79 (patches (search-patches "emacs-exec-path.patch"
4509ec72 80 "emacs-fix-scheme-indent-function.patch"
0cdb6ab4 81 "emacs-source-date-epoch.patch"))
486f36eb
AK
82 (modules '((guix build utils)))
83 (snippet
84 ;; Delete the bundled byte-compiled elisp files and
85 ;; generated autoloads.
86 '(with-directory-excursion "lisp"
87 (for-each delete-file
88 (append (find-files "." "\\.elc$")
89 (find-files "." "loaddefs\\.el$")
90 ;; This is the only "autoloads" file that
91 ;; does not have "*loaddefs.el" name.
dc701091
LC
92 '("eshell/esh-groups.el")))
93
94 ;; Make sure Tramp looks for binaries in the right places on
59e80445 95 ;; remote Guix System machines, where 'getconf PATH' returns
dc701091
LC
96 ;; something bogus.
97 (substitute* "net/tramp-sh.el"
98 ;; Patch the line after "(defcustom tramp-remote-path".
99 (("\\(tramp-default-remote-path")
100 (format #f "(tramp-default-remote-path ~s ~s ~s ~s "
101 "~/.guix-profile/bin" "~/.guix-profile/sbin"
102 "/run/current-system/profile/bin"
d1c11418
OP
103 "/run/current-system/profile/sbin")))
104
105 ;; Make sure Man looks for C header files in the right
106 ;; places.
107 (substitute* "man.el"
108 (("\"/usr/local/include\"" line)
109 (string-join
110 (list line
111 "\"~/.guix-profile/include\""
112 "\"/var/guix/profiles/system/profile/include\"")
6cbee49d
MW
113 " ")))
114 #t))))
71f57158 115 (build-system glib-or-gtk-build-system)
468bdabb 116 (arguments
2206c7ad 117 `(#:tests? #f ; no check target
94be7c8b 118 #:configure-flags (list "--with-modules")
2206c7ad 119 #:phases
13fe4891
FB
120 (modify-phases %standard-phases
121 (add-before 'configure 'fix-/bin/pwd
122 (lambda _
123 ;; Use `pwd', not `/bin/pwd'.
124 (substitute* (find-files "." "^Makefile\\.in$")
125 (("/bin/pwd")
e2d90ee4
MW
126 "pwd"))
127 #t))
13fe4891 128 (add-after 'install 'install-site-start
59d04f63
AK
129 ;; Use 'guix-emacs' in "site-start.el". This way, Emacs packages
130 ;; provided by Guix and installed in
13fe4891
FB
131 ;; ~/.guix-profile/share/emacs/site-lisp/guix.d/PACKAGE-VERSION are
132 ;; automatically found.
133 (lambda* (#:key inputs outputs #:allow-other-keys)
59d04f63
AK
134 (let* ((out (assoc-ref outputs "out"))
135 (lisp-dir (string-append out "/share/emacs/site-lisp")))
136 (copy-file (assoc-ref inputs "guix-emacs.el")
137 (string-append lisp-dir "/guix-emacs.el"))
13fe4891
FB
138 (with-output-to-file (string-append lisp-dir "/site-start.el")
139 (lambda ()
9bd94544
AK
140 (display
141 (string-append "(when (require 'guix-emacs nil t)\n"
142 " (guix-emacs-autoload-packages))\n"))))
13fe4891 143 #t))))))
468bdabb 144 (inputs
c4c4cc05 145 `(("gnutls" ,gnutls)
468bdabb
LC
146 ("ncurses" ,ncurses)
147
148 ;; TODO: Add the optional dependencies.
fa275717 149 ("libx11" ,libx11)
0a9e9a63 150 ("gtk+" ,gtk+)
fa275717 151 ("libxft" ,libxft)
50efa797 152 ("libtiff" ,libtiff)
504a83af 153 ("giflib" ,giflib)
71e304ed 154 ("libjpeg" ,libjpeg)
eb737a27 155 ("imagemagick" ,imagemagick)
388fd01b 156 ("acl" ,acl)
50efa797
LC
157
158 ;; When looking for libpng `configure' links with `-lpng -lz', so we
159 ;; must also provide zlib as an input.
160 ("libpng" ,libpng)
f61e0e79 161 ("zlib" ,zlib)
50efa797 162
8ba4dc63 163 ("librsvg" ,librsvg)
fa275717 164 ("libxpm" ,libxpm)
50efa797 165 ("libxml2" ,libxml2)
504a83af
MW
166 ("libice" ,libice)
167 ("libsm" ,libsm)
168 ("alsa-lib" ,alsa-lib)
13fe4891 169 ("dbus" ,dbus)
01c5c21a
AI
170
171 ;; multilingualization support
172 ("libotf" ,libotf)
173 ("m17n-lib" ,m17n-lib)))
c4c4cc05 174 (native-inputs
59d04f63
AK
175 `(("guix-emacs.el" ,(search-auxiliary-file "emacs/guix-emacs.el"))
176 ("pkg-config" ,pkg-config)
c4c4cc05 177 ("texinfo" ,texinfo)))
64c98347
LC
178
179 (native-search-paths
180 (list (search-path-specification
181 (variable "INFOPATH")
182 (files '("share/info")))))
183
6fd52309 184 (home-page "https://www.gnu.org/software/emacs/")
f50d2669 185 (synopsis "The extensible, customizable, self-documenting text editor")
468bdabb 186 (description
79c311b8
LC
187 "GNU Emacs is an extensible and highly customizable text editor. It is
188based on an Emacs Lisp interpreter with extensions for text editing. Emacs
189has been extended in essentially all areas of computing, giving rise to a
190vast array of packages supporting, e.g., email, IRC and XMPP messaging,
191spreadsheets, remote server editing, and much more. Emacs includes extensive
192documentation on all aspects of the system, from basic editing to writing
193large Lisp programs. It has full Unicode support for nearly all human
194languages.")
f61e0e79 195 (license license:gpl3+)))
4f028c8f 196
b2eaf7ba 197(define-public emacs-minimal
4fd540b7
LC
198 ;; This is the version that you should use as an input to packages that just
199 ;; need to byte-compile .el files.
b2eaf7ba
AK
200 (package (inherit emacs)
201 (name "emacs-minimal")
202 (synopsis "The extensible text editor (used only for byte-compilation)")
203 (build-system gnu-build-system)
204 (arguments
0132f3e6 205 `(,@(substitute-keyword-arguments (package-arguments emacs)
bd6a699d
RW
206 ((#:phases phases)
207 `(modify-phases ,phases
0132f3e6
EF
208 (delete 'install-site-start))))
209 #:configure-flags (list "--with-gnutls=no")))
b2eaf7ba
AK
210 (inputs
211 `(("ncurses" ,ncurses)))
212 (native-inputs
213 `(("pkg-config" ,pkg-config)))))
214
5bbb04f9
AB
215(define-public emacs-xwidgets
216 (package
217 (inherit emacs)
218 (name "emacs-xwidgets")
219 (synopsis "The extensible, customizable, self-documenting text
220editor (with xwidgets support)")
221 (build-system gnu-build-system)
222 (arguments
223 `(#:configure-flags
224 '("--with-xwidgets")
225 ,@(package-arguments emacs)))
226 (inputs
227 `(("webkitgtk" ,webkitgtk)
228 ("libxcomposite" ,libxcomposite)
229 ,@(package-inputs emacs)))))
230
b2eaf7ba 231(define-public emacs-no-x
4fd540b7 232 (package (inherit emacs)
4fd540b7
LC
233 (name "emacs-no-x")
234 (synopsis "The extensible, customizable, self-documenting text
235editor (console only)")
236 (build-system gnu-build-system)
237 (inputs (fold alist-delete
238 (package-inputs emacs)
239 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
4adde2a9
MW
240 "imagemagick" "libpng" "librsvg" "libxpm" "libice"
241 "libsm"
4fd540b7 242
4adde2a9
MW
243 ;; These depend on libx11, so remove them as well.
244 "libotf" "m17n-lib" "dbus")))))
4fd540b7 245
4a3e602c
TUBK
246(define-public emacs-no-x-toolkit
247 (package (inherit emacs)
248 (name "emacs-no-x-toolkit")
249 (synopsis "The extensible, customizable, self-documenting text
250editor (without an X toolkit)" )
71f57158 251 (build-system gnu-build-system)
388fd01b
MW
252 (inputs (append `(("inotify-tools" ,inotify-tools))
253 (alist-delete "gtk+" (package-inputs emacs))))
f862697b
EF
254 (arguments
255 `(,@(substitute-keyword-arguments (package-arguments emacs)
256 ((#:configure-flags cf)
257 `(cons "--with-x-toolkit=no" ,cf)))))))
4a3e602c 258
f906d30c 259(define-public guile-emacs
ef5fa91c
LF
260 (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b")
261 (revision "0"))
262 (package (inherit emacs)
263 (name "guile-emacs")
264 (version (git-version "0.0.0" revision commit))
265 (source (origin
266 (method git-fetch)
267 (uri (git-reference
268 (url "https://git.hcoop.net/git/bpt/emacs.git")
269 (commit commit)))
270 (file-name (git-file-name name version))
271 (patches (search-patches "guile-emacs-fix-configure.patch"))
272 (sha256
273 (base32
274 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
275 (native-inputs
276 `(("autoconf" ,autoconf)
277 ("automake" ,automake)
278 ("guile" ,guile-for-guile-emacs)
279 ,@(package-native-inputs emacs)))
280 (arguments
281 (substitute-keyword-arguments `(;; Build fails if we allow parallel build.
282 #:parallel-build? #f
283 ;; Tests aren't passing for now.
284 #:tests? #f
285 ,@(package-arguments emacs))
286 ((#:phases phases)
287 `(modify-phases ,phases
288 (add-after 'unpack 'autogen
289 (lambda _
290 (invoke "sh" "autogen.sh")))
291 ;; Build sometimes fails: deps/dispnew.d: No such file or directory
292 (add-before 'build 'make-deps-dir
293 (lambda _
294 (invoke "mkdir" "-p" "src/deps"))))))))))
f906d30c 295
eeb883cb 296(define-public m17n-db
9a4c9715 297 (package
eeb883cb
RW
298 (name "m17n-db")
299 (version "1.8.0")
300 (source
301 (origin
302 (method url-fetch)
303 (uri (string-append "mirror://savannah/m17n/m17n-db-"
304 version ".tar.gz"))
305 (sha256
306 (base32
307 "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5"))))
9a4c9715 308 (build-system gnu-build-system)
08fc0d68 309 (inputs
eeb883cb 310 `(("gettext" ,gettext-minimal)))
77c9286d 311 (arguments
eeb883cb
RW
312 `(#:configure-flags
313 (list (string-append "--with-charmaps="
314 (assoc-ref %build-inputs "libc")
315 "/share/i18n/charmaps"))))
316 ;; With `guix lint' the home-page URI returns a small page saying
317 ;; that your browser does not handle frames. This triggers the "URI
318 ;; returns suspiciously small file" warning.
319 (home-page "https://www.nongnu.org/m17n/")
320 (synopsis "Multilingual text processing library (database)")
321 (description "The m17n library realizes multilingualization of
322many aspects of applications. The m17n library represents
323multilingual text as an object named M-text. M-text is a string with
324attributes called text properties, and designed to substitute for
325string in C. Text properties carry any information required to input,
326display and edit the text.
c7e553a3 327
eeb883cb
RW
328This package contains the library database.")
329 (license license:lgpl2.1+)))
1095bd1d 330
eeb883cb 331(define-public m17n-lib
2316078a 332 (package
eeb883cb
RW
333 (name "m17n-lib")
334 (version "1.8.0")
2316078a
RW
335 (source
336 (origin
337 (method url-fetch)
eeb883cb
RW
338 (uri (string-append "mirror://savannah/m17n/m17n-lib-"
339 version ".tar.gz"))
2316078a
RW
340 (sha256
341 (base32
eeb883cb 342 "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq"))))
64e43c67 343 (build-system gnu-build-system)
64e43c67 344 (inputs
eeb883cb
RW
345 `(("fribidi" ,fribidi)
346 ("gd" ,gd)
347 ("libotf" ,libotf)
348 ("libxft" ,libxft)
349 ("libxml2" ,libxml2)
350 ("m17n-db" ,m17n-db)))
85777fe5 351 (arguments
eeb883cb
RW
352 `(#:parallel-build? #f))
353 ;; With `guix lint' the home-page URI returns a small page saying
354 ;; that your browser does not handle frames. This triggers the "URI
355 ;; returns suspiciously small file" warning.
356 (home-page "https://www.nongnu.org/m17n/")
357 (synopsis "Multilingual text processing library (runtime)")
358 (description "The m17n library realizes multilingualization of
359many aspects of applications. The m17n library represents
360multilingual text as an object named M-text. M-text is a string with
361attributes called text properties, and designed to substitute for
362string in C. Text properties carry any information required to input,
363display and edit the text.
cf9ce01f 364
eeb883cb
RW
365This package contains the library runtime.")
366 (license license:lgpl2.1+)))