1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
3 ;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
7 ;;; This file is part of GNU Guix.
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
22 (define-module (gnu packages emacs)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (guix packages)
25 #:use-module (guix download)
26 #:use-module (guix build-system gnu)
27 #:use-module (guix build-system glib-or-gtk)
28 #:use-module (guix build-system trivial)
29 #:use-module (gnu packages)
30 #:use-module (gnu packages gtk)
31 #:use-module (gnu packages gnome)
32 #:use-module (gnu packages ncurses)
33 #:use-module (gnu packages texinfo)
34 #:use-module (gnu packages gnutls)
35 #:use-module (gnu packages pkg-config)
36 #:use-module (gnu packages guile)
37 #:use-module (gnu packages xorg)
38 #:use-module (gnu packages lesstif)
39 #:use-module (gnu packages image)
40 #:use-module (gnu packages linux)
41 #:use-module (gnu packages version-control)
42 #:use-module (gnu packages imagemagick)
43 #:use-module (gnu packages w3m)
44 #:use-module (gnu packages wget)
45 #:use-module (gnu packages autotools)
46 #:use-module (gnu packages compression)
47 #:use-module (gnu packages xml)
48 #:use-module (gnu packages glib)
49 #:use-module (gnu packages acl)
50 #:use-module (gnu packages perl)
51 #:use-module (gnu packages linux) ;alsa
52 #:use-module (gnu packages xiph)
53 #:use-module (gnu packages mp3)
54 #:use-module (guix utils)
55 #:use-module (srfi srfi-1))
63 (uri (string-append "mirror://gnu/emacs/emacs-"
67 "1zflm6ac34s6v166p58ilxrxbxjm0q2wfc25f8y0mjml1lbr3qs7"))))
68 (build-system glib-or-gtk-build-system)
70 '(#:phases (alist-cons-before
71 'configure 'fix-/bin/pwd
73 ;; Use `pwd', not `/bin/pwd'.
74 (substitute* (find-files "." "^Makefile\\.in$")
82 ;; TODO: Add the optional dependencies.
88 ("libjpeg" ,libjpeg-8)
91 ;; When looking for libpng `configure' links with `-lpng -lz', so we
92 ;; must also provide zlib as an input.
101 ("alsa-lib" ,alsa-lib)
104 `(("pkg-config" ,pkg-config)
105 ("texinfo" ,texinfo)))
106 (home-page "http://www.gnu.org/software/emacs/")
107 (synopsis "The extensible, customizable, self-documenting text editor")
109 "GNU Emacs is an extensible and highly customizable text editor. It is
110 based on an Emacs Lisp interpreter with extensions for text editing. Emacs
111 has been extended in essentially all areas of computing, giving rise to a
112 vast array of packages supporting, e.g., email, IRC and XMPP messaging,
113 spreadsheets, remote server editing, and much more. Emacs includes extensive
114 documentation on all aspects of the system, from basic editing to writing
115 large Lisp programs. It has full Unicode support for nearly all human
117 (license license:gpl3+)))
119 (define-public emacs-no-x
120 ;; This is the version that you should use as an input to packages that just
121 ;; need to byte-compile .el files.
122 (package (inherit emacs)
123 (location (source-properties->location (current-source-location)))
125 (synopsis "The extensible, customizable, self-documenting text
126 editor (console only)")
127 (build-system gnu-build-system)
128 (inputs (fold alist-delete
129 (package-inputs emacs)
130 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
131 "libpng" "librsvg" "libxpm" "libice" "libsm"
133 ;; D-Bus depends on libx11, so remove it as well.
136 (define-public emacs-no-x-toolkit
137 (package (inherit emacs)
138 (location (source-properties->location (current-source-location)))
139 (name "emacs-no-x-toolkit")
140 (synopsis "The extensible, customizable, self-documenting text
141 editor (without an X toolkit)" )
142 (build-system gnu-build-system)
143 (inputs (append `(("inotify-tools" ,inotify-tools))
144 (alist-delete "gtk+" (package-inputs emacs))))
145 (arguments (append '(#:configure-flags '("--with-x-toolkit=no"))
146 (package-arguments emacs)))))
153 (define-public geiser
159 (uri (string-append "mirror://savannah/geiser/" version
160 "/geiser-" version ".tar.gz"))
163 "0cp7r91ibw45yw9k3fz1s13y7ryfsxjgpk57qv37qsznb9lmqylx"))))
164 (build-system gnu-build-system)
166 '(#:phases (alist-cons-after
167 'install 'post-install
168 (lambda* (#:key outputs #:allow-other-keys)
169 (symlink "geiser-install.el"
170 (string-append (assoc-ref outputs "out")
171 "/share/emacs/site-lisp/"
172 "geiser-autoloads.el")))
174 (inputs `(("guile" ,guile-2.0)
175 ("emacs" ,emacs-no-x)))
176 (home-page "http://nongnu.org/geiser/")
177 (synopsis "Collection of Emacs modes for Guile and Racket hacking")
179 "Geiser is a collection of Emacs major and minor modes that conspire with
180 one or more Scheme implementations to keep the Lisp Machine Spirit alive. The
181 continuously running Scheme interpreter takes the center of the stage in
182 Geiser. A bundle of Elisp shims orchestrates the dialog between the Scheme
183 implementation, Emacs and, ultimately, the schemer, giving them access to live
185 (license license:bsd-3)))
187 (define-public paredit
193 (uri (string-append "http://mumble.net/~campbell/emacs/paredit-"
196 (base32 "1np882jzvxckljx3cjz4absyzmc5hw65cs21sjmbic82163m9lf8"))))
197 (build-system trivial-build-system)
198 (inputs `(("emacs" ,emacs-no-x)))
200 `(#:modules ((guix build utils)
201 (guix build emacs-utils))
204 (use-modules (guix build utils))
205 (use-modules (guix build emacs-utils))
207 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
209 (source (assoc-ref %build-inputs "source"))
210 (lisp-dir (string-append %output
211 "/share/emacs/site-lisp"))
212 (target (string-append lisp-dir "/paredit.el")))
214 (copy-file source target)
215 (with-directory-excursion lisp-dir
216 (parameterize ((%emacs emacs))
217 (emacs-generate-autoloads ,name lisp-dir)
218 (emacs-batch-eval '(byte-compile-file "paredit.el"))))))))
219 (home-page "http://mumble.net/~campbell/emacs/paredit/")
220 (synopsis "Emacs minor mode for editing parentheses")
222 "ParEdit (paredit.el) is a minor mode for performing structured editing
223 of S-expression data. The typical example of this would be Lisp or Scheme
226 ParEdit helps **keep parentheses balanced** and adds many keys for moving
227 S-expressions and moving around in S-expressions. Its behavior can be jarring
228 for those who may want transient periods of unbalanced parentheses, such as
229 when typing parentheses directly or commenting out code line by line.")
230 (license license:gpl3+)))
239 "https://github.com/magit/magit/releases/download/"
240 version "/" name "-" version ".tar.gz"))
242 (base32 "1in48g5l5xdc9cf2apnpgx73mqlz2njrpi1w52dgql4qxv3kg6gr"))))
243 (build-system gnu-build-system)
244 (native-inputs `(("texinfo" ,texinfo)))
245 (inputs `(("emacs" ,emacs-no-x)
247 ("git:gui" ,git "gui")))
249 `(#:modules ((guix build gnu-build-system)
251 (guix build emacs-utils))
252 #:imported-modules (,@%gnu-build-system-modules
253 (guix build emacs-utils))
254 #:tests? #f ; no check target
258 (lambda* (#:key outputs #:allow-other-keys)
259 (let ((out (assoc-ref outputs "out")))
260 (substitute* "Makefile"
262 (("/etc") (string-append out "/etc")))))
264 'build 'patch-exec-paths
265 (lambda* (#:key inputs #:allow-other-keys)
266 (let ((git (assoc-ref inputs "git"))
267 (git:gui (assoc-ref inputs "git:gui")))
268 (emacs-substitute-variables "magit.el"
269 ("magit-git-executable" (string-append git "/bin/git"))
270 ("magit-gitk-executable" (string-append git:gui "/bin/gitk")))))
272 'install 'post-install
273 (lambda* (#:key outputs #:allow-other-keys)
274 (emacs-generate-autoloads
275 ,name (string-append (assoc-ref outputs "out")
276 "/share/emacs/site-lisp/")))
277 %standard-phases)))))
278 (home-page "http://magit.github.io/")
279 (synopsis "Emacs interface for the Git version control system")
281 "With Magit, you can inspect and modify your Git repositories with Emacs.
282 You can review and commit the changes you have made to the tracked files, for
283 example, and you can browse the history of past changes. There is support for
284 cherry picking, reverting, merging, rebasing, and other common Git
286 (license license:gpl3+)))
293 (define-public emacs-w3m
296 (version "1.4.483+0.20120614")
299 (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
300 version ".orig.tar.gz"))
302 (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
303 (build-system gnu-build-system)
304 (native-inputs `(("autoconf" ,autoconf)))
305 (inputs `(("w3m" ,w3m)
306 ("imagemagick" ,imagemagick)
307 ("emacs" ,emacs-no-x)))
309 '(#:modules ((guix build gnu-build-system)
311 (guix build emacs-utils))
312 #:imported-modules (,@%gnu-build-system-modules
313 (guix build emacs-utils))
315 (let ((out (assoc-ref %outputs "out")))
316 (list (string-append "--with-lispdir="
317 out "/share/emacs/site-lisp")
318 (string-append "--with-icondir="
319 out "/share/images/emacs-w3m")))
320 #:tests? #f ; no check target
325 (zero? (system* "autoconf")))
327 'build 'patch-exec-paths
328 (lambda* (#:key inputs outputs #:allow-other-keys)
329 (let ((out (assoc-ref outputs "out"))
330 (w3m (assoc-ref inputs "w3m"))
331 (imagemagick (assoc-ref inputs "imagemagick"))
332 (coreutils (assoc-ref inputs "coreutils")))
333 (emacs-substitute-variables "w3m.el"
334 ("w3m-command" (string-append w3m "/bin/w3m"))
335 ("w3m-touch-command" (string-append coreutils "/bin/touch"))
336 ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
337 ("w3m-icon-directory" (string-append out
338 "/share/images/emacs-w3m")))
339 (emacs-substitute-variables "w3m-image.el"
340 ("w3m-imagick-convert-program" (string-append imagemagick
342 ("w3m-imagick-identify-program" (string-append imagemagick
347 (lambda* (#:key outputs #:allow-other-keys)
348 (and (zero? (system* "make" "install" "install-icons"))
349 (with-directory-excursion
350 (string-append (assoc-ref outputs "out")
351 "/share/emacs/site-lisp")
352 (for-each delete-file '("ChangeLog" "ChangeLog.1"))
353 (symlink "w3m-load.el" "w3m-autoloads.el")
355 %standard-phases)))))
356 (home-page "http://emacs-w3m.namazu.org/")
357 (synopsis "Simple Web browser for Emacs based on w3m")
359 "Emacs-w3m is an emacs interface for the w3m web browser.")
360 (license license:gpl2+)))
362 (define-public emacs-wget
368 (uri (string-append "mirror://debian/pool/main/w/wget-el/wget-el_"
369 version ".orig.tar.gz"))
371 (base32 "10byvyv9dk0ib55gfqm7bcpxmx2qbih1jd03gmihrppr2mn52nff"))))
372 (build-system gnu-build-system)
373 (inputs `(("wget" ,wget)
374 ("emacs" ,emacs-no-x)))
376 '(#:modules ((guix build gnu-build-system)
378 (guix build emacs-utils))
379 #:imported-modules (,%gnu-build-system-modules
380 (guix build emacs-utils))
381 #:tests? #f ; no check target
385 (lambda* (#:key outputs #:allow-other-keys)
386 (substitute* "Makefile"
387 (("/usr/local") (assoc-ref outputs "out"))
388 (("/site-lisp/emacs-wget") "/site-lisp")))
390 'build 'patch-exec-paths
391 (lambda* (#:key inputs outputs #:allow-other-keys)
392 (let ((wget (assoc-ref inputs "wget")))
393 (emacs-substitute-variables "wget.el"
394 ("wget-command" (string-append wget "/bin/wget")))))
396 'install 'post-install
397 (lambda* (#:key outputs #:allow-other-keys)
398 (emacs-generate-autoloads
399 "wget" (string-append (assoc-ref outputs "out")
400 "/share/emacs/site-lisp/")))
401 %standard-phases)))))
402 (home-page "http://www.emacswiki.org/emacs/EmacsWget")
403 (synopsis "Simple file downloader for Emacs based on wget")
405 "Emacs-wget is an emacs interface for the wget file downloader.")
406 (license license:gpl2+)))
419 (uri (string-append "mirror://gnu/emms/emms-"
423 "1q0n3iwva8bvai2rl9sm49sdjmk0wi7vajz4knz01l7g67nrp87l"))
424 (modules '((guix build utils)))
426 '(substitute* "Makefile"
427 (("/usr/bin/install-info")
428 ;; No need to use 'install-info' since it would create a
429 ;; useless 'dir' file.
432 ;; Install Info files to $out/share/info, not $out/info.
433 "INFODIR := $(PREFIX)/share/info\n")
435 ;; Install directly in share/emacs/site-lisp, not in a
438 (("^all: (.*)\n" _ rest)
439 ;; Build 'emms-print-metadata'.
440 (string-append "all: " rest " emms-print-metadata\n"))))))
441 (build-system gnu-build-system)
443 '(#:modules ((guix build gnu-build-system)
445 (guix build emacs-utils))
446 #:imported-modules (,%gnu-build-system-modules
447 (guix build emacs-utils))
449 #:phases (alist-replace
451 (lambda* (#:key inputs outputs #:allow-other-keys)
452 (let ((out (assoc-ref outputs "out"))
453 (vorbis (assoc-ref inputs "vorbis-tools"))
454 (alsa (assoc-ref inputs "alsa-utils"))
455 (mpg321 (assoc-ref inputs "mpg321"))
456 (mp3info (assoc-ref inputs "mp3info")))
457 ;; Specify the installation directory.
458 (substitute* "Makefile"
460 (string-append "PREFIX := " out "\n")))
462 (setenv "SHELL" (which "sh"))
465 ;; Specify the absolute file names of the various
466 ;; programs so that everything works out-of-the-box.
467 (with-directory-excursion "lisp"
468 (emacs-substitute-variables
469 "emms-player-mpg321-remote.el"
470 ("emms-player-mpg321-remote-command"
471 (string-append mpg321 "/bin/mpg321")))
472 (substitute* "emms-player-simple.el"
474 (string-append "\"" vorbis "/bin/ogg123\"")))
475 (emacs-substitute-variables "emms-info-ogginfo.el"
476 ("emms-info-ogginfo-program-name"
477 (string-append vorbis "/bin/ogginfo")))
478 (emacs-substitute-variables "emms-info-libtag.el"
479 ("emms-info-libtag-program-name"
480 (string-append out "/bin/emms-print-metadata")))
481 (emacs-substitute-variables "emms-info-mp3info.el"
482 ("emms-info-mp3info-program-name"
483 (string-append mp3info "/bin/mp3info")))
484 (substitute* "emms-volume-amixer.el"
486 (string-append "\"" alsa "/bin/amixer\"")))
487 (substitute* "emms-tag-editor.el"
489 (string-append "\"" mp3info "/bin/mp3info\""))))))
491 'install 'pre-install
492 (lambda* (#:key outputs #:allow-other-keys)
493 ;; The 'install' rule expects the target directory to
495 (let* ((out (assoc-ref outputs "out"))
496 (man1 (string-append out "/share/man/man1")))
500 'install 'post-install
501 (lambda* (#:key outputs #:allow-other-keys)
502 (let* ((out (assoc-ref outputs "out"))
503 (target (string-append
504 out "/bin/emms-print-metadata")))
505 (symlink "emms-auto.el"
506 (string-append out "/share/emacs/site-lisp/"
507 "emms-autoloads.el"))
508 (mkdir-p (dirname target))
509 (copy-file "src/emms-print-metadata" target)
510 (chmod target #o555)))
513 (native-inputs `(("emacs" ,emacs-no-x) ;for (guix build emacs-utils)
514 ("texinfo" ,texinfo)))
515 (inputs `(("alsa-utils" ,alsa-utils)
516 ("vorbis-tools" ,vorbis-tools)
519 ("mp3info" ,mp3info)))
520 (synopsis "Emacs Multimedia System")
522 "EMMS is the Emacs Multimedia System. It is a small front-end which
523 can control one of the supported external players. Thus, it supports
524 whatever formats are supported by your music player. It also
525 supports tagging and playlist management, all behind a clean and
526 light user interface.")
527 (home-page "http://www.gnu.org/software/emms/")
528 (license license:gpl3+)))
541 (uri (string-append "mirror://savannah/bbdb/bbdb-"
545 "1gs16bbpiiy01w9pyg12868r57kx1v3hnw04gmqsmpc40l1hyy05"))
546 (modules '((guix build utils)))
548 ;; We don't want to build and install the PDF.
549 '(substitute* "doc/Makefile.in"
552 (build-system gnu-build-system)
554 '(#:phases (alist-cons-after
555 'install 'post-install
556 (lambda* (#:key outputs #:allow-other-keys)
557 ;; Add an autoloads file with the right name for guix.el.
558 (let* ((out (assoc-ref outputs "out"))
559 (site (string-append out "/share/emacs/site-lisp")))
560 (with-directory-excursion site
561 (symlink "bbdb-loaddefs.el" "bbdb-autoloads.el"))))
563 (native-inputs `(("emacs" ,emacs-no-x)))
564 (home-page "http://savannah.nongnu.org/projects/bbdb/")
565 (synopsis "Contact management utility for Emacs")
567 "BBDB is the Insidious Big Brother Database for GNU Emacs. It provides
568 an address book for email and snail mail addresses, phone numbers and the
569 like. It can be linked with various Emacs mail clients (Message and Mail
570 mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable.")
571 (license license:gpl3+)))