1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2013 Andreas Enge <andreas@enge.fr>
4 ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
5 ;;; Copyright © 2014, 2015, 2016, 2017, 2018 Mark H Weaver <mhw@netris.org>
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>
10 ;;; Copyright © 2016 Nils Gillmann <ng0@n0.is>
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>
15 ;;; Copyright © 2017 Jan Nieuwenhuizen <janneke@gnu.org>
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>
20 ;;; This file is part of GNU Guix.
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.
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.
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/>.
35 (define-module (gnu packages emacs)
36 #:use-module ((guix licenses) #:prefix license:)
37 #:use-module (guix packages)
38 #:use-module (guix download)
39 #:use-module (guix git-download)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system glib-or-gtk)
42 #:use-module (gnu packages)
43 #:use-module (gnu packages acl)
44 #:use-module (gnu packages autotools)
45 #:use-module (gnu packages base)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages fontutils)
48 #:use-module (gnu packages fribidi)
49 #:use-module (gnu packages gd)
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)
62 #:use-module (gnu packages webkit)
63 #:use-module (gnu packages xml)
64 #:use-module (gnu packages xorg)
65 #:use-module (guix utils)
66 #:use-module (srfi srfi-1))
74 (uri (string-append "mirror://gnu/emacs/emacs-"
78 "0b6k1wq44rc8gkvxhi1bbjxbz3cwg29qbq8mklq2az6p1hjgrx0w"))
79 (patches (search-patches "emacs-exec-path.patch"
80 "emacs-fix-scheme-indent-function.patch"
81 "emacs-source-date-epoch.patch"))
82 (modules '((guix build utils)))
84 ;; Delete the bundled byte-compiled elisp files and
85 ;; generated autoloads.
86 '(with-directory-excursion "lisp"
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.
92 '("eshell/esh-groups.el")))
94 ;; Make sure Tramp looks for binaries in the right places on
95 ;; remote GuixSD machines, where 'getconf PATH' returns
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"
103 "/run/current-system/profile/sbin")))
105 ;; Make sure Man looks for C header files in the right
107 (substitute* "man.el"
108 (("\"/usr/local/include\"" line)
111 "\"~/.guix-profile/include\""
112 "\"/var/guix/profiles/system/profile/include\"")
115 (build-system glib-or-gtk-build-system)
117 `(#:tests? #f ; no check target
118 #:configure-flags (list "--with-modules")
120 (modify-phases %standard-phases
121 (add-before 'configure 'fix-/bin/pwd
123 ;; Use `pwd', not `/bin/pwd'.
124 (substitute* (find-files "." "^Makefile\\.in$")
128 (add-after 'install 'install-site-start
129 ;; Use 'guix-emacs' in "site-start.el". This way, Emacs packages
130 ;; provided by Guix and installed in
131 ;; ~/.guix-profile/share/emacs/site-lisp/guix.d/PACKAGE-VERSION are
132 ;; automatically found.
133 (lambda* (#:key inputs outputs #:allow-other-keys)
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"))
138 (with-output-to-file (string-append lisp-dir "/site-start.el")
141 (string-append "(when (require 'guix-emacs nil t)\n"
142 " (guix-emacs-autoload-packages))\n"))))
148 ;; TODO: Add the optional dependencies.
155 ("imagemagick" ,imagemagick)
158 ;; When looking for libpng `configure' links with `-lpng -lz', so we
159 ;; must also provide zlib as an input.
168 ("alsa-lib" ,alsa-lib)
171 ;; multilingualization support
173 ("m17n-lib" ,m17n-lib)))
175 `(("guix-emacs.el" ,(search-auxiliary-file "emacs/guix-emacs.el"))
176 ("pkg-config" ,pkg-config)
177 ("texinfo" ,texinfo)))
180 (list (search-path-specification
181 (variable "INFOPATH")
182 (files '("share/info")))))
184 (home-page "https://www.gnu.org/software/emacs/")
185 (synopsis "The extensible, customizable, self-documenting text editor")
187 "GNU Emacs is an extensible and highly customizable text editor. It is
188 based on an Emacs Lisp interpreter with extensions for text editing. Emacs
189 has been extended in essentially all areas of computing, giving rise to a
190 vast array of packages supporting, e.g., email, IRC and XMPP messaging,
191 spreadsheets, remote server editing, and much more. Emacs includes extensive
192 documentation on all aspects of the system, from basic editing to writing
193 large Lisp programs. It has full Unicode support for nearly all human
195 (license license:gpl3+)))
197 (define-public emacs-minimal
198 ;; This is the version that you should use as an input to packages that just
199 ;; need to byte-compile .el files.
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)
205 `(,@(substitute-keyword-arguments (package-arguments emacs)
207 `(modify-phases ,phases
208 (delete 'install-site-start))))
209 #:configure-flags (list "--with-gnutls=no")))
211 `(("ncurses" ,ncurses)))
213 `(("pkg-config" ,pkg-config)))))
215 (define-public emacs-xwidgets
218 (name "emacs-xwidgets")
219 (synopsis "The extensible, customizable, self-documenting text
220 editor (with xwidgets support)")
221 (build-system gnu-build-system)
225 ,@(package-arguments emacs)))
227 `(("webkitgtk" ,webkitgtk)
228 ("libxcomposite" ,libxcomposite)
229 ,@(package-inputs emacs)))))
231 (define-public emacs-no-x
232 (package (inherit emacs)
234 (synopsis "The extensible, customizable, self-documenting text
235 editor (console only)")
236 (build-system gnu-build-system)
237 (inputs (fold alist-delete
238 (package-inputs emacs)
239 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
240 "imagemagick" "libpng" "librsvg" "libxpm" "libice"
243 ;; These depend on libx11, so remove them as well.
244 "libotf" "m17n-lib" "dbus")))))
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
250 editor (without an X toolkit)" )
251 (build-system gnu-build-system)
252 (inputs (append `(("inotify-tools" ,inotify-tools))
253 (alist-delete "gtk+" (package-inputs emacs))))
254 (arguments (append '(#:configure-flags '("--with-x-toolkit=no"))
255 (package-arguments emacs)))))
257 (define-public guile-emacs
258 (let ((commit "41120e0f595b16387eebfbf731fff70481de1b4b")
260 (package (inherit emacs)
262 (version (git-version "0.0.0" revision commit))
266 (url "https://git.hcoop.net/git/bpt/emacs.git")
268 (file-name (git-file-name name version))
269 (patches (search-patches "guile-emacs-fix-configure.patch"))
272 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
274 `(("autoconf" ,autoconf)
275 ("automake" ,automake)
276 ("guile" ,guile-for-guile-emacs)
277 ,@(package-native-inputs emacs)))
279 (substitute-keyword-arguments `(;; Build fails if we allow parallel build.
281 ;; Tests aren't passing for now.
283 ,@(package-arguments emacs))
285 `(modify-phases ,phases
286 (add-after 'unpack 'autogen
288 (invoke "sh" "autogen.sh")))
289 ;; Build sometimes fails: deps/dispnew.d: No such file or directory
290 (add-before 'build 'make-deps-dir
292 (invoke "mkdir" "-p" "src/deps"))))))))))
294 (define-public m17n-db
301 (uri (string-append "mirror://savannah/m17n/m17n-db-"
305 "0vfw7z9i2s9np6nmx1d4dlsywm044rkaqarn7akffmb6bf1j6zv5"))))
306 (build-system gnu-build-system)
308 `(("gettext" ,gettext-minimal)))
311 (list (string-append "--with-charmaps="
312 (assoc-ref %build-inputs "libc")
313 "/share/i18n/charmaps"))))
314 ;; With `guix lint' the home-page URI returns a small page saying
315 ;; that your browser does not handle frames. This triggers the "URI
316 ;; returns suspiciously small file" warning.
317 (home-page "https://www.nongnu.org/m17n/")
318 (synopsis "Multilingual text processing library (database)")
319 (description "The m17n library realizes multilingualization of
320 many aspects of applications. The m17n library represents
321 multilingual text as an object named M-text. M-text is a string with
322 attributes called text properties, and designed to substitute for
323 string in C. Text properties carry any information required to input,
324 display and edit the text.
326 This package contains the library database.")
327 (license license:lgpl2.1+)))
329 (define-public m17n-lib
336 (uri (string-append "mirror://savannah/m17n/m17n-lib-"
340 "0jp61y09xqj10mclpip48qlfhniw8gwy8b28cbzxy8hq8pkwmfkq"))))
341 (build-system gnu-build-system)
343 `(("fribidi" ,fribidi)
348 ("m17n-db" ,m17n-db)))
350 `(#:parallel-build? #f))
351 ;; With `guix lint' the home-page URI returns a small page saying
352 ;; that your browser does not handle frames. This triggers the "URI
353 ;; returns suspiciously small file" warning.
354 (home-page "https://www.nongnu.org/m17n/")
355 (synopsis "Multilingual text processing library (runtime)")
356 (description "The m17n library realizes multilingualization of
357 many aspects of applications. The m17n library represents
358 multilingual text as an object named M-text. M-text is a string with
359 attributes called text properties, and designed to substitute for
360 string in C. Text properties carry any information required to input,
361 display and edit the text.
363 This package contains the library runtime.")
364 (license license:lgpl2.1+)))