gnu: emacs-dash: Update to 2.12.1.
[jackhill/guix/guix.git] / gnu / packages / emacs.scm
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, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
6 ;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
7 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
8 ;;;
9 ;;; This file is part of GNU Guix.
10 ;;;
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
12 ;;; under the terms of the GNU General Public License as published by
13 ;;; the Free Software Foundation; either version 3 of the License, or (at
14 ;;; your option) any later version.
15 ;;;
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
17 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
18 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 ;;; GNU General Public License for more details.
20 ;;;
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
23
24 (define-module (gnu packages emacs)
25 #:use-module ((guix licenses) #:prefix license:)
26 #:use-module (guix packages)
27 #:use-module (guix download)
28 #:use-module (guix git-download)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system emacs)
31 #:use-module (guix build-system glib-or-gtk)
32 #:use-module (guix build-system trivial)
33 #:use-module (gnu packages)
34 #:use-module (gnu packages guile)
35 #:use-module (gnu packages gtk)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages texinfo)
39 #:use-module (gnu packages tls)
40 #:use-module (gnu packages pkg-config)
41 #:use-module (gnu packages xorg)
42 #:use-module (gnu packages lesstif)
43 #:use-module (gnu packages image)
44 #:use-module (gnu packages linux)
45 #:use-module (gnu packages version-control)
46 #:use-module (gnu packages imagemagick)
47 #:use-module (gnu packages w3m)
48 #:use-module (gnu packages wget)
49 #:use-module (gnu packages autotools)
50 #:use-module (gnu packages base)
51 #:use-module (gnu packages compression)
52 #:use-module (gnu packages xml)
53 #:use-module (gnu packages glib)
54 #:use-module (gnu packages acl)
55 #:use-module (gnu packages perl)
56 #:use-module (gnu packages pdf)
57 #:use-module (gnu packages xiph)
58 #:use-module (gnu packages mp3)
59 #:use-module (guix utils)
60 #:use-module (srfi srfi-1))
61
62 (define-public emacs
63 (package
64 (name "emacs")
65 (version "24.5")
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "mirror://gnu/emacs/emacs-"
69 version ".tar.xz"))
70 (sha256
71 (base32
72 "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"))
73 (patches (list (search-patch "emacs-exec-path.patch")))))
74 (build-system glib-or-gtk-build-system)
75 (arguments
76 '(#:phases (alist-cons-before
77 'configure 'fix-/bin/pwd
78 (lambda _
79 ;; Use `pwd', not `/bin/pwd'.
80 (substitute* (find-files "." "^Makefile\\.in$")
81 (("/bin/pwd")
82 "pwd")))
83 %standard-phases)))
84 (inputs
85 `(("gnutls" ,gnutls)
86 ("ncurses" ,ncurses)
87
88 ;; TODO: Add the optional dependencies.
89 ("libx11" ,libx11)
90 ("gtk+" ,gtk+)
91 ("libxft" ,libxft)
92 ("libtiff" ,libtiff)
93 ("giflib" ,giflib)
94 ("libjpeg" ,libjpeg-8)
95 ("acl" ,acl)
96
97 ;; When looking for libpng `configure' links with `-lpng -lz', so we
98 ;; must also provide zlib as an input.
99 ("libpng" ,libpng)
100 ("zlib" ,zlib)
101
102 ("librsvg" ,librsvg)
103 ("libxpm" ,libxpm)
104 ("libxml2" ,libxml2)
105 ("libice" ,libice)
106 ("libsm" ,libsm)
107 ("alsa-lib" ,alsa-lib)
108 ("dbus" ,dbus)))
109 (native-inputs
110 `(("pkg-config" ,pkg-config)
111 ("texinfo" ,texinfo)))
112
113 (native-search-paths
114 (list (search-path-specification
115 (variable "INFOPATH")
116 (files '("share/info")))))
117
118 (home-page "http://www.gnu.org/software/emacs/")
119 (synopsis "The extensible, customizable, self-documenting text editor")
120 (description
121 "GNU Emacs is an extensible and highly customizable text editor. It is
122 based on an Emacs Lisp interpreter with extensions for text editing. Emacs
123 has been extended in essentially all areas of computing, giving rise to a
124 vast array of packages supporting, e.g., email, IRC and XMPP messaging,
125 spreadsheets, remote server editing, and much more. Emacs includes extensive
126 documentation on all aspects of the system, from basic editing to writing
127 large Lisp programs. It has full Unicode support for nearly all human
128 languages.")
129 (license license:gpl3+)))
130
131 (define-public emacs-no-x
132 ;; This is the version that you should use as an input to packages that just
133 ;; need to byte-compile .el files.
134 (package (inherit emacs)
135 (name "emacs-no-x")
136 (synopsis "The extensible, customizable, self-documenting text
137 editor (console only)")
138 (build-system gnu-build-system)
139 (inputs (fold alist-delete
140 (package-inputs emacs)
141 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
142 "libpng" "librsvg" "libxpm" "libice" "libsm"
143
144 ;; D-Bus depends on libx11, so remove it as well.
145 "dbus")))))
146
147 (define-public emacs-no-x-toolkit
148 (package (inherit emacs)
149 (name "emacs-no-x-toolkit")
150 (synopsis "The extensible, customizable, self-documenting text
151 editor (without an X toolkit)" )
152 (build-system gnu-build-system)
153 (inputs (append `(("inotify-tools" ,inotify-tools))
154 (alist-delete "gtk+" (package-inputs emacs))))
155 (arguments (append '(#:configure-flags '("--with-x-toolkit=no"))
156 (package-arguments emacs)))))
157
158 (define-public guile-emacs
159 (package (inherit emacs)
160 (name "guile-emacs")
161 (version "20150512.41120e0")
162 (source (origin
163 (method git-fetch)
164 (uri (git-reference
165 (url "git://git.hcoop.net/git/bpt/emacs.git")
166 (commit "41120e0f595b16387eebfbf731fff70481de1b4b")))
167 (sha256
168 (base32
169 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
170 (native-inputs
171 `(("autoconf" ,autoconf)
172 ("automake" ,automake)
173 ("guile" ,guile-for-guile-emacs)
174 ,@(package-native-inputs emacs)))
175 (arguments
176 (substitute-keyword-arguments `(;; Build fails if we allow parallel build.
177 #:parallel-build? #f
178 ;; Tests aren't passing for now.
179 #:tests? #f
180 ,@(package-arguments emacs))
181 ((#:phases phases)
182 `(modify-phases ,phases
183 (add-after 'unpack 'autogen
184 (lambda _
185 (zero? (system* "sh" "autogen.sh"))))))))))
186
187 \f
188 ;;;
189 ;;; Emacs hacking.
190 ;;;
191
192 (define-public geiser
193 (package
194 (name "geiser")
195 (version "0.8.1")
196 (source (origin
197 (method url-fetch)
198 (uri (string-append "mirror://savannah/geiser/" version
199 "/geiser-" version ".tar.gz"))
200 (sha256
201 (base32
202 "163zh8qf1q8l485d94a51a9xixirj8r2xvrbgxyw06vkaqrz5qvc"))))
203 (build-system gnu-build-system)
204 (arguments
205 '(#:phases (alist-cons-after
206 'install 'post-install
207 (lambda* (#:key outputs #:allow-other-keys)
208 (symlink "geiser-install.el"
209 (string-append (assoc-ref outputs "out")
210 "/share/emacs/site-lisp/"
211 "geiser-autoloads.el")))
212 %standard-phases)))
213 (inputs `(("guile" ,guile-2.0)
214 ("emacs" ,emacs-no-x)))
215 (home-page "http://nongnu.org/geiser/")
216 (synopsis "Collection of Emacs modes for Guile and Racket hacking")
217 (description
218 "Geiser is a collection of Emacs major and minor modes that conspire with
219 one or more Scheme implementations to keep the Lisp Machine Spirit alive. The
220 continuously running Scheme interpreter takes the center of the stage in
221 Geiser. A bundle of Elisp shims orchestrates the dialog between the Scheme
222 implementation, Emacs and, ultimately, the schemer, giving them access to live
223 metadata.")
224 (license license:bsd-3)))
225
226 (define-public paredit
227 (package
228 (name "paredit")
229 (version "23")
230 (source (origin
231 (method url-fetch)
232 (uri (string-append "http://mumble.net/~campbell/emacs/paredit-"
233 version ".el"))
234 (sha256
235 (base32 "1np882jzvxckljx3cjz4absyzmc5hw65cs21sjmbic82163m9lf8"))))
236 (build-system trivial-build-system)
237 (inputs `(("emacs" ,emacs-no-x)))
238 (arguments
239 `(#:modules ((guix build utils)
240 (guix build emacs-utils))
241 #:builder
242 (begin
243 (use-modules (guix build utils))
244 (use-modules (guix build emacs-utils))
245
246 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
247 "/bin/emacs"))
248 (source (assoc-ref %build-inputs "source"))
249 (lisp-dir (string-append %output
250 "/share/emacs/site-lisp"))
251 (target (string-append lisp-dir "/paredit.el")))
252 (mkdir-p lisp-dir)
253 (copy-file source target)
254 (with-directory-excursion lisp-dir
255 (parameterize ((%emacs emacs))
256 (emacs-generate-autoloads ,name lisp-dir)
257 (emacs-batch-eval '(byte-compile-file "paredit.el"))))))))
258 (home-page "http://mumble.net/~campbell/emacs/paredit/")
259 (synopsis "Emacs minor mode for editing parentheses")
260 (description
261 "ParEdit (paredit.el) is a minor mode for performing structured editing
262 of S-expression data. The typical example of this would be Lisp or Scheme
263 source code.
264
265 ParEdit helps **keep parentheses balanced** and adds many keys for moving
266 S-expressions and moving around in S-expressions. Its behavior can be jarring
267 for those who may want transient periods of unbalanced parentheses, such as
268 when typing parentheses directly or commenting out code line by line.")
269 (license license:gpl3+)))
270
271 (define-public git-modes
272 (package
273 (name "git-modes")
274 (version "1.2.0")
275 (source (origin
276 (method url-fetch)
277 (uri (string-append
278 "https://github.com/magit/git-modes/archive/"
279 version ".tar.gz"))
280 (file-name (string-append name "-" version ".tar.gz"))
281 (sha256
282 (base32
283 "09dv7ikbj2bi4y3lmvjfzqpdmx2f9bd4w7jkp10bkap62d05iqhk"))))
284 (build-system gnu-build-system)
285 (arguments
286 `(#:modules ((guix build gnu-build-system)
287 (guix build emacs-utils)
288 (guix build utils))
289 #:imported-modules (,@%gnu-build-system-modules
290 (guix build emacs-utils))
291
292 #:make-flags (list (string-append "PREFIX="
293 (assoc-ref %outputs "out"))
294 ;; Don't put .el files in a 'git-modes'
295 ;; sub-directory.
296 (string-append "LISPDIR="
297 (assoc-ref %outputs "out")
298 "/share/emacs/site-lisp"))
299 #:tests? #f ; no check target
300 #:phases (modify-phases %standard-phases
301 (delete 'configure)
302 (add-after 'install 'emacs-autoloads
303 (lambda* (#:key outputs #:allow-other-keys)
304 (let* ((out (assoc-ref outputs "out"))
305 (lisp (string-append
306 out "/share/emacs/site-lisp/")))
307 (emacs-generate-autoloads ,name lisp)))))))
308 (native-inputs `(("emacs" ,emacs-no-x)))
309 (home-page "https://github.com/magit/git-modes")
310 (synopsis "Emacs major modes for Git configuration files")
311 (description
312 "This package provides Emacs major modes for editing various Git
313 configuration files, such as .gitattributes, .gitignore, and .git/config.")
314 (license license:gpl3+)))
315
316 (define-public magit
317 (package
318 (name "magit")
319 (version "2.3.0")
320 (source (origin
321 (method url-fetch)
322 (uri (string-append
323 "https://github.com/magit/magit/releases/download/"
324 version "/" name "-" version ".tar.gz"))
325 (sha256
326 (base32
327 "0bi0vqp9802f00vnii3x80iqycji20bw4pjysy6al0d86mkggjx5"))))
328 (build-system gnu-build-system)
329 (native-inputs `(("texinfo" ,texinfo)
330 ("emacs" ,emacs-no-x)))
331 (inputs `(("git" ,git)))
332 (propagated-inputs `(("dash" ,emacs-dash)))
333 (arguments
334 `(#:modules ((guix build gnu-build-system)
335 (guix build utils)
336 (guix build emacs-utils))
337 #:imported-modules (,@%gnu-build-system-modules
338 (guix build emacs-utils))
339
340 #:test-target "test"
341 #:tests? #f ; tests are not included in the release
342
343 #:make-flags
344 (list (string-append "PREFIX=" %output)
345 ;; Don't put .el files in a sub-directory.
346 (string-append "lispdir=" %output "/share/emacs/site-lisp")
347 (string-append "DASH_DIR="
348 (assoc-ref %build-inputs "dash")
349 "/share/emacs/site-lisp/guix.d/dash-"
350 ,(package-version emacs-dash)))
351
352 #:phases
353 (modify-phases %standard-phases
354 (delete 'configure)
355 (add-before
356 'build 'patch-exec-paths
357 (lambda* (#:key inputs #:allow-other-keys)
358 (let ((git (assoc-ref inputs "git")))
359 (emacs-substitute-variables "lisp/magit-git.el"
360 ("magit-git-executable" (string-append git "/bin/git")))
361 #t))))))
362 (home-page "http://magit.github.io/")
363 (synopsis "Emacs interface for the Git version control system")
364 (description
365 "With Magit, you can inspect and modify your Git repositories with Emacs.
366 You can review and commit the changes you have made to the tracked files, for
367 example, and you can browse the history of past changes. There is support for
368 cherry picking, reverting, merging, rebasing, and other common Git
369 operations.")
370 (license license:gpl3+)))
371
372 (define-public magit-svn
373 (package
374 (name "magit-svn")
375 (version "2.1.1")
376 (source (origin
377 (method url-fetch)
378 (uri (string-append
379 "https://github.com/magit/magit-svn/archive/"
380 version ".tar.gz"))
381 (file-name (string-append name "-" version ".tar.gz"))
382 (sha256
383 (base32
384 "04y88j7q9h8xjbx5dbick6n5nr1522sn9i1znp0qwk3vjb4b5mzz"))))
385 (build-system trivial-build-system)
386 (native-inputs `(("emacs" ,emacs-no-x)
387 ("tar" ,tar)
388 ("gzip" ,gzip)))
389 (propagated-inputs `(("dash" ,emacs-dash)
390 ("magit" ,magit)))
391 (arguments
392 `(#:modules ((guix build utils)
393 (guix build emacs-utils))
394
395 #:builder
396 (begin
397 (use-modules (guix build utils)
398 (guix build emacs-utils))
399
400 (let* ((tar (string-append (assoc-ref %build-inputs "tar")
401 "/bin/tar"))
402 (PATH (string-append (assoc-ref %build-inputs "gzip")
403 "/bin"))
404 (emacs (string-append (assoc-ref %build-inputs "emacs")
405 "/bin/emacs"))
406 (magit (string-append (assoc-ref %build-inputs "magit")
407 "/share/emacs/site-lisp"))
408 (dash (string-append (assoc-ref %build-inputs "dash")
409 "/share/emacs/site-lisp/guix.d/dash-"
410 ,(package-version emacs-dash)))
411 (source (assoc-ref %build-inputs "source"))
412 (lisp-dir (string-append %output "/share/emacs/site-lisp")))
413 (setenv "PATH" PATH)
414 (system* tar "xvf" source)
415
416 (install-file (string-append ,name "-" ,version "/magit-svn.el")
417 lisp-dir)
418
419 (with-directory-excursion lisp-dir
420 (parameterize ((%emacs emacs))
421 (emacs-generate-autoloads ,name lisp-dir)
422 (setenv "EMACSLOADPATH"
423 (string-append ":" magit ":" dash))
424 (emacs-batch-eval '(byte-compile-file "magit-svn.el"))))))))
425 (home-page "https://github.com/magit/magit-svn")
426 (synopsis "Git-SVN extension to Magit")
427 (description
428 "This package is an extension to Magit, the Git Emacs mode, providing
429 support for Git-SVN.")
430 (license license:gpl3+)))
431
432 (define-public haskell-mode
433 (package
434 (name "haskell-mode")
435 (version "13.14.2")
436 (source (origin
437 (method url-fetch)
438 (file-name (string-append name "-" version ".tar.gz"))
439 (uri (string-append
440 "https://github.com/haskell/haskell-mode/archive/v"
441 version ".tar.gz"))
442 (sha256
443 (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"))))
444 (inputs `(("emacs" ,emacs-no-x)))
445 (native-inputs
446 `(("texinfo" ,texinfo)))
447 (build-system gnu-build-system)
448 (arguments
449 `(#:make-flags (list (string-append "EMACS="
450 (assoc-ref %build-inputs "emacs")
451 "/bin/emacs"))
452 #:phases
453 (modify-phases %standard-phases
454 (delete 'configure)
455 (add-before
456 'build 'pre-build
457 (lambda* (#:key inputs #:allow-other-keys)
458 (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
459 (setenv "SHELL" "sh")
460 (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
461 #t)))
462 (replace
463 'install
464 (lambda* (#:key outputs #:allow-other-keys)
465 (let* ((out (assoc-ref outputs "out"))
466 (el-dir (string-append out "/share/emacs/site-lisp"))
467 (doc (string-append
468 out "/share/doc/haskell-mode-" ,version))
469 (info (string-append out "/share/info")))
470 (define (copy-to-dir dir files)
471 (for-each (lambda (f)
472 (install-file f dir))
473 files))
474
475 (with-directory-excursion "doc"
476 (unless (zero? (system* "makeinfo" "haskell-mode.texi"))
477 (error "makeinfo failed"))
478 (install-file "haskell-mode.info" info))
479 (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
480 (copy-to-dir el-dir (find-files "." "\\.elc?"))
481 ;; these are now distributed with emacs
482 (with-directory-excursion el-dir
483 (for-each delete-file '("cl-lib.el" "ert.el")))
484 #t))))))
485 (home-page "https://github.com/haskell/haskell-mode")
486 (synopsis "Haskell mode for Emacs")
487 (description
488 "This is an Emacs mode for editing, debugging and developing Haskell
489 programs.")
490 (license license:gpl3+)))
491
492 (define-public let-alist
493 (package
494 (name "emacs-let-alist")
495 (version "1.0.4")
496 (source (origin
497 (method url-fetch)
498 (uri (string-append "http://elpa.gnu.org/packages/let-alist-"
499 version ".el"))
500 (sha256
501 (base32
502 "07312bvvyz86lf64vdkxg2l1wgfjl25ljdjwlf1bdzj01c4hm88x"))))
503 (build-system trivial-build-system)
504 (arguments
505 `(#:modules ((guix build utils)
506 (guix build emacs-utils))
507
508 #:builder (begin
509 (use-modules (guix build emacs-utils)
510 (guix build utils))
511
512 (let* ((out (assoc-ref %outputs "out"))
513 (lispdir (string-append out
514 "/share/emacs/site-lisp/"
515 "guix.d/let-alist-"
516 ,version))
517 (emacs (assoc-ref %build-inputs "emacs")))
518
519 (mkdir-p lispdir)
520 (copy-file (assoc-ref %build-inputs "source")
521 (string-append lispdir "/let-alist.el"))
522
523 (setenv "PATH" (string-append emacs "/bin"))
524 (emacs-byte-compile-directory lispdir)
525 #t))))
526 (native-inputs `(("emacs" ,emacs-no-x)))
527 (home-page "http://elpa.gnu.org/packages/let-alist.html")
528 (synopsis "Easily let-bind values of an assoc-list by their names")
529 (description
530 "This package offers a single Emacs Lisp macro, @code{let-alist}. This
531 macro takes a first argument, whose value must be an alist (association list),
532 and a body.
533
534 The macro expands to a let form containing the body, where each dotted symbol
535 inside body is let-bound to their cdrs in the alist. Only those present in
536 the body are let-bound and this search is done at compile time.")
537 (license license:gpl3+)))
538
539 (define-public flycheck
540 (package
541 (name "emacs-flycheck")
542 (version "0.23")
543 (source (origin
544 (method url-fetch)
545 (uri (string-append
546 "https://github.com/flycheck/flycheck/releases/download/"
547 version "/flycheck-" version ".tar"))
548 (sha256
549 (base32
550 "1n2cifzsl5dbv42l82bi3y1vk6q33msi8dd4bj7b9nvnl9jfjj5b"))))
551 (build-system emacs-build-system)
552 (propagated-inputs
553 `(("emacs-dash" ,emacs-dash)
554 ("emacs-let-alist" ,let-alist)))
555 (home-page "https://www.flycheck.org")
556 (synopsis "On-the-fly syntax checking")
557 (description
558 "This package provides on-the-fly syntax checking for GNU Emacs. It is a
559 replacement for the older Flymake extension which is part of GNU Emacs, with
560 many improvements and additional features.
561
562 Flycheck provides fully-automatic, fail-safe, on-the-fly background syntax
563 checking for over 30 programming and markup languages with more than 70
564 different tools. It highlights errors and warnings inline in the buffer, and
565 provides an optional IDE-like error list.")
566 (license license:gpl3+))) ;+GFDLv1.3+ for the manual
567
568 \f
569 ;;;
570 ;;; Web browsing.
571 ;;;
572
573 (define-public emacs-w3m
574 (package
575 (name "emacs-w3m")
576 (version "1.4.483+0.20120614")
577 (source (origin
578 (method url-fetch)
579 (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
580 version ".orig.tar.gz"))
581 (sha256
582 (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
583 (build-system gnu-build-system)
584 (native-inputs `(("autoconf" ,autoconf)))
585 (inputs `(("w3m" ,w3m)
586 ("imagemagick" ,imagemagick)
587 ("emacs" ,emacs-no-x)))
588 (arguments
589 `(#:modules ((guix build gnu-build-system)
590 (guix build utils)
591 (guix build emacs-utils))
592 #:imported-modules (,@%gnu-build-system-modules
593 (guix build emacs-utils))
594 #:configure-flags
595 (let ((out (assoc-ref %outputs "out")))
596 (list (string-append "--with-lispdir="
597 out "/share/emacs/site-lisp")
598 (string-append "--with-icondir="
599 out "/share/images/emacs-w3m")))
600 #:tests? #f ; no check target
601 #:phases
602 (alist-cons-after
603 'unpack 'autoconf
604 (lambda _
605 (zero? (system* "autoconf")))
606 (alist-cons-before
607 'build 'patch-exec-paths
608 (lambda* (#:key inputs outputs #:allow-other-keys)
609 (let ((out (assoc-ref outputs "out"))
610 (w3m (assoc-ref inputs "w3m"))
611 (imagemagick (assoc-ref inputs "imagemagick"))
612 (coreutils (assoc-ref inputs "coreutils")))
613 (emacs-substitute-variables "w3m.el"
614 ("w3m-command" (string-append w3m "/bin/w3m"))
615 ("w3m-touch-command" (string-append coreutils "/bin/touch"))
616 ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
617 ("w3m-icon-directory" (string-append out
618 "/share/images/emacs-w3m")))
619 (emacs-substitute-variables "w3m-image.el"
620 ("w3m-imagick-convert-program" (string-append imagemagick
621 "/bin/convert"))
622 ("w3m-imagick-identify-program" (string-append imagemagick
623 "/bin/identify")))
624 #t))
625 (alist-replace
626 'install
627 (lambda* (#:key outputs #:allow-other-keys)
628 (and (zero? (system* "make" "install" "install-icons"))
629 (with-directory-excursion
630 (string-append (assoc-ref outputs "out")
631 "/share/emacs/site-lisp")
632 (for-each delete-file '("ChangeLog" "ChangeLog.1"))
633 (symlink "w3m-load.el" "w3m-autoloads.el")
634 #t)))
635 %standard-phases)))))
636 (home-page "http://emacs-w3m.namazu.org/")
637 (synopsis "Simple Web browser for Emacs based on w3m")
638 (description
639 "Emacs-w3m is an emacs interface for the w3m web browser.")
640 (license license:gpl2+)))
641
642 (define-public emacs-wget
643 (package
644 (name "emacs-wget")
645 (version "0.5.0")
646 (source (origin
647 (method url-fetch)
648 (uri (string-append "mirror://debian/pool/main/w/wget-el/wget-el_"
649 version ".orig.tar.gz"))
650 (sha256
651 (base32 "10byvyv9dk0ib55gfqm7bcpxmx2qbih1jd03gmihrppr2mn52nff"))))
652 (build-system gnu-build-system)
653 (inputs `(("wget" ,wget)
654 ("emacs" ,emacs-no-x)))
655 (arguments
656 `(#:modules ((guix build gnu-build-system)
657 (guix build utils)
658 (guix build emacs-utils))
659 #:imported-modules (,@%gnu-build-system-modules
660 (guix build emacs-utils))
661 #:tests? #f ; no check target
662 #:phases
663 (alist-replace
664 'configure
665 (lambda* (#:key outputs #:allow-other-keys)
666 (substitute* "Makefile"
667 (("/usr/local") (assoc-ref outputs "out"))
668 (("/site-lisp/emacs-wget") "/site-lisp")))
669 (alist-cons-before
670 'build 'patch-exec-paths
671 (lambda* (#:key inputs outputs #:allow-other-keys)
672 (let ((wget (assoc-ref inputs "wget")))
673 (emacs-substitute-variables "wget.el"
674 ("wget-command" (string-append wget "/bin/wget")))))
675 (alist-cons-after
676 'install 'post-install
677 (lambda* (#:key outputs #:allow-other-keys)
678 (emacs-generate-autoloads
679 "wget" (string-append (assoc-ref outputs "out")
680 "/share/emacs/site-lisp/")))
681 %standard-phases)))))
682 (home-page "http://www.emacswiki.org/emacs/EmacsWget")
683 (synopsis "Simple file downloader for Emacs based on wget")
684 (description
685 "Emacs-wget is an emacs interface for the wget file downloader.")
686 (license license:gpl2+)))
687
688 \f
689 ;;;
690 ;;; Multimedia.
691 ;;;
692
693 (define-public emms
694 (package
695 (name "emms")
696 (version "4.0")
697 (source (origin
698 (method url-fetch)
699 (uri (string-append "mirror://gnu/emms/emms-"
700 version ".tar.gz"))
701 (sha256
702 (base32
703 "1q0n3iwva8bvai2rl9sm49sdjmk0wi7vajz4knz01l7g67nrp87l"))
704 (modules '((guix build utils)))
705 (snippet
706 '(substitute* "Makefile"
707 (("/usr/bin/install-info")
708 ;; No need to use 'install-info' since it would create a
709 ;; useless 'dir' file.
710 "true")
711 (("^INFODIR=.*")
712 ;; Install Info files to $out/share/info, not $out/info.
713 "INFODIR := $(PREFIX)/share/info\n")
714 (("/site-lisp/emms")
715 ;; Install directly in share/emacs/site-lisp, not in a
716 ;; sub-directory.
717 "/site-lisp")
718 (("^all: (.*)\n" _ rest)
719 ;; Build 'emms-print-metadata'.
720 (string-append "all: " rest " emms-print-metadata\n"))))))
721 (build-system gnu-build-system)
722 (arguments
723 `(#:modules ((guix build gnu-build-system)
724 (guix build utils)
725 (guix build emacs-utils))
726 #:imported-modules (,@%gnu-build-system-modules
727 (guix build emacs-utils))
728
729 #:phases (alist-replace
730 'configure
731 (lambda* (#:key inputs outputs #:allow-other-keys)
732 (let ((out (assoc-ref outputs "out"))
733 (vorbis (assoc-ref inputs "vorbis-tools"))
734 (alsa (assoc-ref inputs "alsa-utils"))
735 (mpg321 (assoc-ref inputs "mpg321"))
736 (mp3info (assoc-ref inputs "mp3info")))
737 ;; Specify the installation directory.
738 (substitute* "Makefile"
739 (("PREFIX=.*$")
740 (string-append "PREFIX := " out "\n")))
741
742 (setenv "SHELL" (which "sh"))
743 (setenv "CC" "gcc")
744
745 ;; Specify the absolute file names of the various
746 ;; programs so that everything works out-of-the-box.
747 (with-directory-excursion "lisp"
748 (emacs-substitute-variables
749 "emms-player-mpg321-remote.el"
750 ("emms-player-mpg321-remote-command"
751 (string-append mpg321 "/bin/mpg321")))
752 (substitute* "emms-player-simple.el"
753 (("\"ogg123\"")
754 (string-append "\"" vorbis "/bin/ogg123\"")))
755 (emacs-substitute-variables "emms-info-ogginfo.el"
756 ("emms-info-ogginfo-program-name"
757 (string-append vorbis "/bin/ogginfo")))
758 (emacs-substitute-variables "emms-info-libtag.el"
759 ("emms-info-libtag-program-name"
760 (string-append out "/bin/emms-print-metadata")))
761 (emacs-substitute-variables "emms-info-mp3info.el"
762 ("emms-info-mp3info-program-name"
763 (string-append mp3info "/bin/mp3info")))
764 (substitute* "emms-volume-amixer.el"
765 (("\"amixer\"")
766 (string-append "\"" alsa "/bin/amixer\"")))
767 (substitute* "emms-tag-editor.el"
768 (("\"mp3info\"")
769 (string-append "\"" mp3info "/bin/mp3info\""))))))
770 (alist-cons-before
771 'install 'pre-install
772 (lambda* (#:key outputs #:allow-other-keys)
773 ;; The 'install' rule expects the target directory to
774 ;; exist.
775 (let* ((out (assoc-ref outputs "out"))
776 (man1 (string-append out "/share/man/man1")))
777 (mkdir-p man1)
778 #t))
779 (alist-cons-after
780 'install 'post-install
781 (lambda* (#:key outputs #:allow-other-keys)
782 (let* ((out (assoc-ref outputs "out"))
783 (target (string-append
784 out "/bin/emms-print-metadata")))
785 (symlink "emms-auto.el"
786 (string-append out "/share/emacs/site-lisp/"
787 "emms-autoloads.el"))
788 (mkdir-p (dirname target))
789 (copy-file "src/emms-print-metadata" target)
790 (chmod target #o555)))
791 %standard-phases)))
792 #:tests? #f))
793 (native-inputs `(("emacs" ,emacs-no-x) ;for (guix build emacs-utils)
794 ("texinfo" ,texinfo)))
795 (inputs `(("alsa-utils" ,alsa-utils)
796 ("vorbis-tools" ,vorbis-tools)
797 ("mpg321" ,mpg321)
798 ("taglib" ,taglib)
799 ("mp3info" ,mp3info)))
800 (synopsis "Emacs Multimedia System")
801 (description
802 "EMMS is the Emacs Multimedia System. It is a small front-end which
803 can control one of the supported external players. Thus, it supports
804 whatever formats are supported by your music player. It also
805 supports tagging and playlist management, all behind a clean and
806 light user interface.")
807 (home-page "http://www.gnu.org/software/emms/")
808 (license license:gpl3+)))
809
810 \f
811 ;;;
812 ;;; Miscellaneous.
813 ;;;
814
815 (define-public bbdb
816 (package
817 (name "bbdb")
818 (version "3.1.2")
819 (source (origin
820 (method url-fetch)
821 (uri (string-append "mirror://savannah/bbdb/bbdb-"
822 version ".tar.gz"))
823 (sha256
824 (base32
825 "1gs16bbpiiy01w9pyg12868r57kx1v3hnw04gmqsmpc40l1hyy05"))
826 (modules '((guix build utils)))
827 (snippet
828 ;; We don't want to build and install the PDF.
829 '(substitute* "doc/Makefile.in"
830 (("^doc_DATA = .*$")
831 "doc_DATA =\n")))))
832 (build-system gnu-build-system)
833 (arguments
834 '(#:phases (alist-cons-after
835 'install 'post-install
836 (lambda* (#:key outputs #:allow-other-keys)
837 ;; Add an autoloads file with the right name for guix.el.
838 (let* ((out (assoc-ref outputs "out"))
839 (site (string-append out "/share/emacs/site-lisp")))
840 (with-directory-excursion site
841 (symlink "bbdb-loaddefs.el" "bbdb-autoloads.el"))))
842 %standard-phases)))
843 (native-inputs `(("emacs" ,emacs-no-x)))
844 (home-page "http://savannah.nongnu.org/projects/bbdb/")
845 (synopsis "Contact management utility for Emacs")
846 (description
847 "BBDB is the Insidious Big Brother Database for GNU Emacs. It provides
848 an address book for email and snail mail addresses, phone numbers and the
849 like. It can be linked with various Emacs mail clients (Message and Mail
850 mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable.")
851 (license license:gpl3+)))
852
853 (define-public emacs-auctex
854 (package
855 (name "emacs-auctex")
856 (version "11.88.6")
857 (source
858 (origin
859 (method url-fetch)
860 (uri (string-append
861 "http://elpa.gnu.org/packages/auctex-"
862 version
863 ".tar"))
864 (sha256
865 (base32
866 "1pmki8hdjjikxlvip3pzi350bln3gcimr27yjf0xfwjvnp5hh9nc"))))
867 (build-system emacs-build-system)
868 (native-inputs
869 `(("perl" ,perl)))
870 (home-page "http://www.gnu.org/software/auctex/")
871 (synopsis "Integrated environment for TeX")
872 (description
873 "AUCTeX is a comprehensive customizable integrated environment for
874 writing input files for TeX, LaTeX, ConTeXt, Texinfo, and docTeX using Emacs
875 or XEmacs.")
876 (license license:gpl3+)))
877
878 (define-public emacs-mmm-mode
879 (package
880 (name "emacs-mmm-mode")
881 (version "0.5.4")
882 (source
883 (origin
884 (method url-fetch)
885 (uri (string-append
886 "https://github.com/purcell/mmm-mode/archive/"
887 version ".tar.gz"))
888 (file-name (string-append name "-" version ".tar.gz"))
889 (sha256
890 (base32
891 "10kwslnflbjqm62wkrq420crqzdqalzfflp9pqk1i12zm6dm4mfv"))))
892 (build-system gnu-build-system)
893 (arguments
894 '(#:phases
895 (modify-phases %standard-phases
896 (add-after 'unpack 'autogen
897 (lambda _
898 (zero? (system* "sh" "autogen.sh")))))))
899 (native-inputs
900 `(("autoconf" ,autoconf)
901 ("automake" ,automake)
902 ("emacs" ,emacs-no-x)
903 ("texinfo" ,texinfo)))
904 (home-page "https://github.com/purcell/mmm-mode")
905 (synopsis "Allow multiple major modes in an Emacs buffer")
906 (description
907 "MMM Mode is a minor mode that allows multiple major modes to coexist in a
908 single buffer.")
909 (license license:gpl3+)))
910
911 (define-public emacs-pdf-tools
912 (package
913 (name "emacs-pdf-tools")
914 (version "0.70")
915 (source (origin
916 (method url-fetch)
917 (uri (string-append
918 "https://github.com/politza/pdf-tools/archive/v"
919 version ".tar.gz"))
920 (file-name (string-append name "-" version ".tar.gz"))
921 (sha256
922 (base32
923 "1m0api6wiawswyk46bdsyk6r5rg3b86a4paar6nassm6x6c6vr77"))))
924 (build-system gnu-build-system)
925 (arguments
926 `(#:tests? #f ; there are no tests
927 #:modules ((guix build gnu-build-system)
928 (guix build utils)
929 (guix build emacs-utils))
930 #:imported-modules (,@%gnu-build-system-modules
931 (guix build emacs-utils))
932 #:phases
933 (modify-phases %standard-phases
934 (add-after 'unpack 'enter-dir (lambda _ (chdir "server") #t))
935 (add-before
936 'configure 'autogen
937 (lambda _
938 (zero? (system* "bash" "autogen.sh"))))
939 (add-before
940 'build 'patch-variables
941 (lambda* (#:key outputs #:allow-other-keys)
942 (with-directory-excursion "../lisp"
943 ;; Set path to epdfinfo program.
944 (emacs-substitute-variables "pdf-info.el"
945 ("pdf-info-epdfinfo-program"
946 (string-append (assoc-ref outputs "out")
947 "/bin/epdfinfo")))
948 ;; Set 'pdf-tools-handle-upgrades' to nil to avoid "auto
949 ;; upgrading" that pdf-tools tries to perform.
950 (emacs-substitute-variables "pdf-tools.el"
951 ("pdf-tools-handle-upgrades" '())))))
952 (add-after
953 'install 'install-lisp
954 (lambda* (#:key outputs #:allow-other-keys)
955 (let ((target (string-append (assoc-ref outputs "out")
956 "/share/emacs/site-lisp/")))
957 (for-each (lambda (file)
958 (install-file file target))
959 (find-files "../lisp" "^(pdf|tab).*\\.elc?"))
960 (emacs-byte-compile-directory target)
961 (emacs-generate-autoloads "pdf-tools" target)))))))
962 (native-inputs `(("autoconf" ,autoconf)
963 ("automake" ,automake)
964 ("pkg-config" ,pkg-config)
965 ("emacs" ,emacs-no-x)))
966 (inputs `(("poppler" ,poppler)
967 ("cairo" ,cairo)
968 ("glib" ,glib)
969 ("libpng" ,libpng)
970 ("zlib" ,zlib)))
971 (synopsis "Emacs support library for PDF files")
972 (description
973 "PDF Tools is, among other things, a replacement of DocView for PDF
974 files. The key difference is that pages are not pre-rendered by
975 e.g. ghostscript and stored in the file-system, but rather created on-demand
976 and stored in memory.")
977 (home-page "https://github.com/politza/pdf-tools")
978 (license license:gpl3+)))
979
980 (define-public emacs-dash
981 (package
982 (name "emacs-dash")
983 (version "2.12.1")
984 (source (origin
985 (method url-fetch)
986 (uri (string-append
987 "https://github.com/magnars/dash.el/archive/"
988 version ".tar.gz"))
989 (file-name (string-append name "-" version ".tar.gz"))
990 (sha256
991 (base32
992 "082jl7mp4x063bpj5ad2pc5125k0d6p7rb89gcj7ny3lma9h2ij1"))))
993 (build-system emacs-build-system)
994 (arguments
995 `(#:phases
996 (modify-phases %standard-phases
997 (add-before 'install 'check
998 (lambda _
999 (zero? (system* "./run-tests.sh")))))))
1000 (home-page "https://github.com/magnars/dash.el")
1001 (synopsis "Modern list library for Emacs")
1002 (description "This package provides a modern list API library for Emacs.")
1003 (license license:gpl3+)))
1004
1005 (define-public emacs-s
1006 (package
1007 (name "emacs-s")
1008 (version "1.9.0")
1009 (source (origin
1010 (method url-fetch)
1011 (uri (string-append
1012 "https://github.com/magnars/s.el/archive/"
1013 version ".tar.gz"))
1014 (file-name (string-append name "-" version ".tar.gz"))
1015 (sha256
1016 (base32
1017 "1gah2k577gvnmxlpw7zrz0jr571vghzhdv2hbgchlgah07czd091"))))
1018 (build-system emacs-build-system)
1019 (arguments
1020 `(#:phases
1021 (modify-phases %standard-phases
1022 (add-before 'install 'check
1023 (lambda _
1024 (zero? (system* "./run-tests.sh")))))))
1025 (home-page "https://github.com/magnars/s.el")
1026 (synopsis "Emacs string manipulation library")
1027 (description "This package provides an Emacs library for manipulating
1028 strings.")
1029 (license license:gpl3+)))
1030
1031 (define-public emacs-f
1032 (package
1033 (name "emacs-f")
1034 (version "0.17.2")
1035 (source (origin
1036 (method url-fetch)
1037 (uri (string-append
1038 "https://github.com/rejeep/f.el/archive/v"
1039 version ".tar.gz"))
1040 (file-name (string-append name "-" version ".tar.gz"))
1041 (sha256
1042 (base32
1043 "1n5gcldf43wmkr7jxgs519v21zavwr0yn8048iv6gvgfwicnyjlx"))))
1044 (build-system emacs-build-system)
1045 (propagated-inputs
1046 `(("emacs-s" ,emacs-s)
1047 ("emacs-dash" ,emacs-dash)))
1048 (home-page "http://github.com/rejeep/f.el")
1049 (synopsis "Emacs API for working with files and directories")
1050 (description "This package provides an Emacs library for working with
1051 files and directories.")
1052 (license license:gpl3+)))
1053
1054 (define-public emacs-ob-ipython
1055 (package
1056 (name "emacs-ob-ipython")
1057 (version "20150704.8807064693")
1058 (source (origin
1059 (method git-fetch)
1060 (uri (git-reference
1061 (commit "8807064693")
1062 (url "https://github.com/gregsexton/ob-ipython.git")))
1063 (sha256
1064 (base32
1065 "1scf25snbds9ymagpny30ijbsg479r3nm0ih01dy4m9d0g7qryb7"))))
1066 (build-system emacs-build-system)
1067 (propagated-inputs
1068 `(("emacs-f" ,emacs-f)))
1069 (home-page "http://www.gregsexton.org")
1070 (synopsis "Org-Babel functions for IPython evaluation")
1071 (description "This package adds support to Org-Babel for evaluating Python
1072 source code using IPython.")
1073 (license license:gpl3+)))
1074
1075 (define-public emacs-debbugs
1076 (package
1077 (name "emacs-debbugs")
1078 (version "0.7")
1079 (source (origin
1080 (method url-fetch)
1081 (uri (string-append "http://elpa.gnu.org/packages/debbugs-"
1082 version ".tar"))
1083 (sha256
1084 (base32
1085 "0pbglx3paa8icazgxlg4jf40wl8war63y9j2jmbb7gbd1xp95v72"))))
1086 (build-system emacs-build-system)
1087 (home-page "http://elpa.gnu.org/packages/debbugs.html")
1088 (synopsis "Access the Debbugs bug tracker in Emacs")
1089 (description
1090 "This package lets you access the @uref{http://bugs.gnu.org,GNU Bug
1091 Tracker} from within Emacs.
1092
1093 For instance, it defines the command @code{M-x debbugs-gnu} for listing bugs,
1094 and the command @code{M-x debbugs-gnu-search} for bug searching. If you
1095 prefer the listing of bugs as TODO items of @code{org-mode}, you could use
1096 @code{M-x debbugs-org} and related commands.
1097
1098 A minor mode @code{debbugs-browse-mode} let you browse URLs to the GNU Bug
1099 Tracker as well as bug identifiers prepared for @code{bug-reference-mode}.")
1100 (license license:gpl3+)))
1101
1102 (define-public emacs-deferred
1103 (package
1104 (name "emacs-deferred")
1105 (version "0.3.2")
1106 (home-page "https://github.com/kiwanami/emacs-deferred")
1107 (source (origin
1108 (method git-fetch)
1109 (uri (git-reference
1110 (url home-page)
1111 (commit (string-append "v" version))))
1112 (sha256
1113 (base32
1114 "0059jy01ni5irpgrj9fa81ayd9j25nvmjjm79ms3210ysx4pgqdr"))
1115 (file-name (string-append name "-" version))))
1116 (build-system emacs-build-system)
1117 ;; FIXME: Would need 'el-expectations' to actually run tests.
1118 (synopsis "Simple asynchronous functions for Emacs Lisp")
1119 (description
1120 "The @code{deferred.el} library provides support for asynchronous tasks.
1121 The API is almost the same as that of
1122 @uref{https://github.com/cho45/jsdeferred, JSDeferred}, a JavaScript library
1123 for asynchronous tasks.")
1124 (license license:gpl3+)))
1125
1126 (define-public butler
1127 (package
1128 (name "emacs-butler")
1129 (version "0.2.4")
1130 (home-page "https://github.com/AshtonKem/Butler")
1131 (source (origin
1132 (method git-fetch)
1133 (uri (git-reference
1134 (url home-page)
1135 (commit version)))
1136 (sha256
1137 (base32
1138 "1pii9dw4skq7nr4na6qxqasl36av8cwjp71bf1fgppqpcd9z8skj"))
1139 (file-name (string-append name "-" version))))
1140 (build-system emacs-build-system)
1141 (propagated-inputs
1142 `(("emacs-deferred" ,emacs-deferred)))
1143 (synopsis "Emacs client for Jenkins")
1144 (description
1145 "Butler provides an interface to connect to Jenkins continuous
1146 integration servers. Users can specify a list of server in the
1147 @code{butler-server-list} variable and then use @code{M-x butler-status} to
1148 view the build status of those servers' build jobs, and possibly to trigger
1149 build jobs.")
1150 (license license:gpl3+)))
1151
1152 (define-public typo
1153 (package
1154 (name "emacs-typo")
1155 (version "1.1")
1156 (home-page "https://github.com/jorgenschaefer/typoel")
1157 (source (origin
1158 (method git-fetch)
1159 (uri (git-reference
1160 (url home-page)
1161 (commit (string-append "v" version))))
1162 (sha256
1163 (base32
1164 "1jhd4grch5iz12gyxwfbsgh4dmz5hj4bg4gnvphccg8dsnni05k2"))
1165 (file-name (string-append name "-" version))))
1166 (build-system emacs-build-system)
1167 (synopsis "Minor mode for typographic editing")
1168 (description
1169 "This package provides two Emacs modes, @code{typo-mode} and
1170 @code{typo-global-mode}. These modes automatically insert Unicode characters
1171 for quotation marks, dashes, and ellipses. For example, typing @kbd{\"}
1172 automatically inserts a Unicode opening or closing quotation mark, depending
1173 on context.")
1174 (license license:gpl3+)))