utils: Add 'install-file'.
[jackhill/guix/guix.git] / gnu / packages / emacs.scm
CommitLineData
468bdabb 1;;; GNU Guix --- Functional package management for GNU
4a3e602c 2;;; Copyright © 2014 Taylan Ulrich Bayirli/Kammer <taylanbayirli@gmail.com>
c72aed6d 3;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
4c2a38c2 4;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
55f29c39 5;;; Copyright © 2014, 2015 Alex Kost <alezost@gmail.com>
78395334 6;;; Copyright © 2015 Federico Beffa <beffa@fbengineering.ch>
ec9825d6 7;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
468bdabb
LC
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
1ffa7090 24(define-module (gnu packages emacs)
f61e0e79 25 #:use-module ((guix licenses) #:prefix license:)
468bdabb
LC
26 #:use-module (guix packages)
27 #:use-module (guix download)
f906d30c 28 #:use-module (guix git-download)
468bdabb 29 #:use-module (guix build-system gnu)
78395334 30 #:use-module (guix build-system emacs)
71f57158 31 #:use-module (guix build-system glib-or-gtk)
fe4163f3 32 #:use-module (guix build-system trivial)
59a43334 33 #:use-module (gnu packages)
f906d30c 34 #:use-module (gnu packages guile)
7abe1965 35 #:use-module (gnu packages gtk)
8ba4dc63 36 #:use-module (gnu packages gnome)
1ffa7090
LC
37 #:use-module (gnu packages ncurses)
38 #:use-module (gnu packages texinfo)
a7fd7b68 39 #:use-module (gnu packages tls)
4f028c8f 40 #:use-module (gnu packages pkg-config)
50efa797
LC
41 #:use-module (gnu packages xorg)
42 #:use-module (gnu packages lesstif)
e55354b8 43 #:use-module (gnu packages image)
504a83af 44 #:use-module (gnu packages linux)
9a4c9715 45 #:use-module (gnu packages version-control)
18d26210
MW
46 #:use-module (gnu packages imagemagick)
47 #:use-module (gnu packages w3m)
89925972 48 #:use-module (gnu packages wget)
18d26210 49 #:use-module (gnu packages autotools)
be379ee7 50 #:use-module (gnu packages base)
f61e0e79 51 #:use-module (gnu packages compression)
50efa797 52 #:use-module (gnu packages xml)
4a3e602c 53 #:use-module (gnu packages glib)
388fd01b 54 #:use-module (gnu packages acl)
77c9286d 55 #:use-module (gnu packages perl)
ec9825d6 56 #:use-module (gnu packages pdf)
77c9286d
LC
57 #:use-module (gnu packages xiph)
58 #:use-module (gnu packages mp3)
4a3e602c
TUBK
59 #:use-module (guix utils)
60 #:use-module (srfi srfi-1))
468bdabb
LC
61
62(define-public emacs
63 (package
64 (name "emacs")
4c2a38c2 65 (version "24.5")
468bdabb
LC
66 (source (origin
67 (method url-fetch)
68 (uri (string-append "mirror://gnu/emacs/emacs-"
3be9f724 69 version ".tar.xz"))
468bdabb
LC
70 (sha256
71 (base32
1bef37ee
LC
72 "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"))
73 (patches (list (search-patch "emacs-exec-path.patch")))))
71f57158 74 (build-system glib-or-gtk-build-system)
468bdabb 75 (arguments
388fd01b 76 '(#:phases (alist-cons-before
468bdabb
LC
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
c4c4cc05 85 `(("gnutls" ,gnutls)
468bdabb
LC
86 ("ncurses" ,ncurses)
87
88 ;; TODO: Add the optional dependencies.
fa275717 89 ("libx11" ,libx11)
0a9e9a63 90 ("gtk+" ,gtk+)
fa275717 91 ("libxft" ,libxft)
50efa797 92 ("libtiff" ,libtiff)
504a83af 93 ("giflib" ,giflib)
50efa797 94 ("libjpeg" ,libjpeg-8)
388fd01b 95 ("acl" ,acl)
50efa797
LC
96
97 ;; When looking for libpng `configure' links with `-lpng -lz', so we
98 ;; must also provide zlib as an input.
99 ("libpng" ,libpng)
f61e0e79 100 ("zlib" ,zlib)
50efa797 101
8ba4dc63 102 ("librsvg" ,librsvg)
fa275717 103 ("libxpm" ,libxpm)
50efa797 104 ("libxml2" ,libxml2)
504a83af
MW
105 ("libice" ,libice)
106 ("libsm" ,libsm)
107 ("alsa-lib" ,alsa-lib)
01eafd38 108 ("dbus" ,dbus)))
c4c4cc05
JD
109 (native-inputs
110 `(("pkg-config" ,pkg-config)
111 ("texinfo" ,texinfo)))
468bdabb 112 (home-page "http://www.gnu.org/software/emacs/")
f50d2669 113 (synopsis "The extensible, customizable, self-documenting text editor")
468bdabb 114 (description
79c311b8
LC
115 "GNU Emacs is an extensible and highly customizable text editor. It is
116based on an Emacs Lisp interpreter with extensions for text editing. Emacs
117has been extended in essentially all areas of computing, giving rise to a
118vast array of packages supporting, e.g., email, IRC and XMPP messaging,
119spreadsheets, remote server editing, and much more. Emacs includes extensive
120documentation on all aspects of the system, from basic editing to writing
121large Lisp programs. It has full Unicode support for nearly all human
122languages.")
f61e0e79 123 (license license:gpl3+)))
4f028c8f 124
4fd540b7
LC
125(define-public emacs-no-x
126 ;; This is the version that you should use as an input to packages that just
127 ;; need to byte-compile .el files.
128 (package (inherit emacs)
4fd540b7
LC
129 (name "emacs-no-x")
130 (synopsis "The extensible, customizable, self-documenting text
131editor (console only)")
132 (build-system gnu-build-system)
133 (inputs (fold alist-delete
134 (package-inputs emacs)
135 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
8ba4dc63 136 "libpng" "librsvg" "libxpm" "libice" "libsm"
4fd540b7
LC
137
138 ;; D-Bus depends on libx11, so remove it as well.
139 "dbus")))))
140
4a3e602c
TUBK
141(define-public emacs-no-x-toolkit
142 (package (inherit emacs)
143 (name "emacs-no-x-toolkit")
144 (synopsis "The extensible, customizable, self-documenting text
145editor (without an X toolkit)" )
71f57158 146 (build-system gnu-build-system)
388fd01b
MW
147 (inputs (append `(("inotify-tools" ,inotify-tools))
148 (alist-delete "gtk+" (package-inputs emacs))))
149 (arguments (append '(#:configure-flags '("--with-x-toolkit=no"))
150 (package-arguments emacs)))))
4a3e602c 151
f906d30c
CAW
152(define-public guile-emacs
153 (package (inherit emacs)
154 (name "guile-emacs")
155 (version "20150512.41120e0")
156 (source (origin
157 (method git-fetch)
158 (uri (git-reference
159 (url "git://git.hcoop.net/git/bpt/emacs.git")
160 (commit "41120e0f595b16387eebfbf731fff70481de1b4b")))
161 (sha256
162 (base32
163 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
164 (native-inputs
165 `(("autoconf" ,autoconf)
166 ("automake" ,automake)
167 ("guile" ,guile-for-guile-emacs)
168 ,@(package-native-inputs emacs)))
169 (arguments
170 (substitute-keyword-arguments `(;; Build fails if we allow parallel build.
171 #:parallel-build? #f
172 ;; Tests aren't passing for now.
173 #:tests? #f
174 ,@(package-arguments emacs))
175 ((#:phases phases)
176 `(modify-phases ,phases
177 (add-after 'unpack 'autogen
178 (lambda _
179 (zero? (system* "sh" "autogen.sh"))))))))))
180
4f028c8f
LC
181\f
182;;;
183;;; Emacs hacking.
184;;;
185
186(define-public geiser
187 (package
188 (name "geiser")
1f8ad12a 189 (version "0.7")
4f028c8f
LC
190 (source (origin
191 (method url-fetch)
cf8f58b2
LC
192 (uri (string-append "mirror://savannah/geiser/" version
193 "/geiser-" version ".tar.gz"))
4f028c8f 194 (sha256
1f8ad12a
LC
195 (base32
196 "0cp7r91ibw45yw9k3fz1s13y7ryfsxjgpk57qv37qsznb9lmqylx"))))
4f028c8f 197 (build-system gnu-build-system)
d51cafb0
AK
198 (arguments
199 '(#:phases (alist-cons-after
200 'install 'post-install
201 (lambda* (#:key outputs #:allow-other-keys)
202 (symlink "geiser-install.el"
203 (string-append (assoc-ref outputs "out")
204 "/share/emacs/site-lisp/"
205 "geiser-autoloads.el")))
206 %standard-phases)))
4f028c8f 207 (inputs `(("guile" ,guile-2.0)
2d32d153 208 ("emacs" ,emacs-no-x)))
4f028c8f
LC
209 (home-page "http://nongnu.org/geiser/")
210 (synopsis "Collection of Emacs modes for Guile and Racket hacking")
211 (description
9586011d
LC
212 "Geiser is a collection of Emacs major and minor modes that conspire with
213one or more Scheme implementations to keep the Lisp Machine Spirit alive. The
214continuously running Scheme interpreter takes the center of the stage in
215Geiser. A bundle of Elisp shims orchestrates the dialog between the Scheme
216implementation, Emacs and, ultimately, the schemer, giving them access to live
217metadata.")
f61e0e79 218 (license license:bsd-3)))
9a4c9715 219
fe4163f3
MW
220(define-public paredit
221 (package
222 (name "paredit")
223 (version "23")
224 (source (origin
225 (method url-fetch)
226 (uri (string-append "http://mumble.net/~campbell/emacs/paredit-"
227 version ".el"))
228 (sha256
229 (base32 "1np882jzvxckljx3cjz4absyzmc5hw65cs21sjmbic82163m9lf8"))))
230 (build-system trivial-build-system)
2d32d153 231 (inputs `(("emacs" ,emacs-no-x)))
fe4163f3
MW
232 (arguments
233 `(#:modules ((guix build utils)
234 (guix build emacs-utils))
235 #:builder
236 (begin
237 (use-modules (guix build utils))
238 (use-modules (guix build emacs-utils))
239
240 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
241 "/bin/emacs"))
242 (source (assoc-ref %build-inputs "source"))
243 (lisp-dir (string-append %output
244 "/share/emacs/site-lisp"))
245 (target (string-append lisp-dir "/paredit.el")))
246 (mkdir-p lisp-dir)
247 (copy-file source target)
248 (with-directory-excursion lisp-dir
249 (parameterize ((%emacs emacs))
d51cafb0 250 (emacs-generate-autoloads ,name lisp-dir)
fe4163f3
MW
251 (emacs-batch-eval '(byte-compile-file "paredit.el"))))))))
252 (home-page "http://mumble.net/~campbell/emacs/paredit/")
253 (synopsis "Emacs minor mode for editing parentheses")
254 (description
255 "ParEdit (paredit.el) is a minor mode for performing structured editing
256of S-expression data. The typical example of this would be Lisp or Scheme
257source code.
258
259ParEdit helps **keep parentheses balanced** and adds many keys for moving
260S-expressions and moving around in S-expressions. Its behavior can be jarring
261for those who may want transient periods of unbalanced parentheses, such as
262when typing parentheses directly or commenting out code line by line.")
f61e0e79 263 (license license:gpl3+)))
fe4163f3 264
2f910ef6
LC
265(define-public git-modes
266 (package
267 (name "git-modes")
89949e8f 268 (version "1.2.0")
2f910ef6
LC
269 (source (origin
270 (method url-fetch)
271 (uri (string-append
272 "https://github.com/magit/git-modes/archive/"
273 version ".tar.gz"))
8fd3c1ff 274 (file-name (string-append name "-" version ".tar.gz"))
2f910ef6
LC
275 (sha256
276 (base32
89949e8f 277 "09dv7ikbj2bi4y3lmvjfzqpdmx2f9bd4w7jkp10bkap62d05iqhk"))))
2f910ef6
LC
278 (build-system gnu-build-system)
279 (arguments
280 `(#:modules ((guix build gnu-build-system)
281 (guix build emacs-utils)
282 (guix build utils))
283 #:imported-modules (,@%gnu-build-system-modules
284 (guix build emacs-utils))
285
286 #:make-flags (list (string-append "PREFIX="
287 (assoc-ref %outputs "out"))
288 ;; Don't put .el files in a 'git-modes'
289 ;; sub-directory.
290 (string-append "LISPDIR="
291 (assoc-ref %outputs "out")
292 "/share/emacs/site-lisp"))
89949e8f 293 #:tests? #f ; no check target
2f910ef6
LC
294 #:phases (modify-phases %standard-phases
295 (delete 'configure)
296 (add-after 'install 'emacs-autoloads
297 (lambda* (#:key outputs #:allow-other-keys)
298 (let* ((out (assoc-ref outputs "out"))
299 (lisp (string-append
300 out "/share/emacs/site-lisp/")))
301 (emacs-generate-autoloads ,name lisp)))))))
302 (native-inputs `(("emacs" ,emacs-no-x)))
303 (home-page "https://github.com/magit/git-modes")
304 (synopsis "Emacs major modes for Git configuration files")
305 (description
306 "This package provides Emacs major modes for editing various Git
307configuration files, such as .gitattributes, .gitignore, and .git/config.")
308 (license license:gpl3+)))
309
9a4c9715
MW
310(define-public magit
311 (package
312 (name "magit")
55f29c39 313 (version "2.2.1")
9a4c9715
MW
314 (source (origin
315 (method url-fetch)
fac8b30b
MW
316 (uri (string-append
317 "https://github.com/magit/magit/releases/download/"
318 version "/" name "-" version ".tar.gz"))
9a4c9715 319 (sha256
7e4871ba 320 (base32
55f29c39 321 "0bjdj4468i5w3j2i945b6psb6n04z34vhjaqr0iz4xgixk3wiqmh"))))
9a4c9715 322 (build-system gnu-build-system)
2c047b4a
LC
323 (native-inputs `(("texinfo" ,texinfo)
324 ("emacs" ,emacs-no-x)))
55f29c39
AK
325 (inputs `(("git" ,git)))
326 (propagated-inputs `(("dash" ,emacs-dash)))
9a4c9715
MW
327 (arguments
328 `(#:modules ((guix build gnu-build-system)
329 (guix build utils)
330 (guix build emacs-utils))
8ff3df5b 331 #:imported-modules (,@%gnu-build-system-modules
9a4c9715 332 (guix build emacs-utils))
7e4871ba
LC
333
334 #:test-target "test"
55f29c39 335 #:tests? #f ; tests are not included in the release
7e4871ba 336
55f29c39
AK
337 #:make-flags
338 (list (string-append "PREFIX=" %output)
339 ;; Don't put .el files in a sub-directory.
340 (string-append "lispdir=" %output "/share/emacs/site-lisp")
341 (string-append "DASH_DIR="
342 (assoc-ref %build-inputs "dash")
343 "/share/emacs/site-lisp/guix.d/dash-"
344 ,(package-version emacs-dash)))
d41a8a07 345
9a4c9715 346 #:phases
c466bfd1 347 (modify-phases %standard-phases
55f29c39 348 (delete 'configure)
c466bfd1
LC
349 (add-before
350 'build 'patch-exec-paths
351 (lambda* (#:key inputs #:allow-other-keys)
55f29c39
AK
352 (let ((git (assoc-ref inputs "git")))
353 (emacs-substitute-variables "lisp/magit-git.el"
354 ("magit-git-executable" (string-append git "/bin/git")))
355 #t))))))
9a4c9715
MW
356 (home-page "http://magit.github.io/")
357 (synopsis "Emacs interface for the Git version control system")
358 (description
359 "With Magit, you can inspect and modify your Git repositories with Emacs.
360You can review and commit the changes you have made to the tracked files, for
361example, and you can browse the history of past changes. There is support for
362cherry picking, reverting, merging, rebasing, and other common Git
363operations.")
f61e0e79 364 (license license:gpl3+)))
18d26210 365
97cc51f8
LC
366(define-public magit-svn
367 (package
368 (name "magit-svn")
be379ee7 369 (version "2.1.0")
97cc51f8 370 (source (origin
be379ee7
AK
371 (method url-fetch)
372 (uri (string-append
373 "https://github.com/magit/magit-svn/archive/"
374 version ".tar.gz"))
375 (file-name (string-append name "-" version ".tar.gz"))
97cc51f8
LC
376 (sha256
377 (base32
be379ee7 378 "09sz93g7x7g9q75jsw8bdh7yr4jr1igfb4fpg5i302a7l2ahxfr8"))))
97cc51f8 379 (build-system trivial-build-system)
be379ee7
AK
380 (native-inputs `(("emacs" ,emacs-no-x)
381 ("tar" ,tar)
382 ("gzip" ,gzip)))
383 (propagated-inputs `(("dash" ,emacs-dash)
384 ("magit" ,magit)))
97cc51f8
LC
385 (arguments
386 `(#:modules ((guix build utils)
387 (guix build emacs-utils))
388
389 #:builder
390 (begin
391 (use-modules (guix build utils)
392 (guix build emacs-utils))
393
be379ee7
AK
394 (let* ((tar (string-append (assoc-ref %build-inputs "tar")
395 "/bin/tar"))
396 (PATH (string-append (assoc-ref %build-inputs "gzip")
397 "/bin"))
398 (emacs (string-append (assoc-ref %build-inputs "emacs")
97cc51f8
LC
399 "/bin/emacs"))
400 (magit (string-append (assoc-ref %build-inputs "magit")
401 "/share/emacs/site-lisp"))
be379ee7
AK
402 (dash (string-append (assoc-ref %build-inputs "dash")
403 "/share/emacs/site-lisp/guix.d/dash-"
404 ,(package-version emacs-dash)))
97cc51f8
LC
405 (source (assoc-ref %build-inputs "source"))
406 (lisp-dir (string-append %output "/share/emacs/site-lisp")))
be379ee7
AK
407 (setenv "PATH" PATH)
408 (system* tar "xvf" source)
97cc51f8 409 (mkdir-p lisp-dir)
be379ee7 410 (copy-file (string-append ,name "-" ,version "/magit-svn.el")
97cc51f8
LC
411 (string-append lisp-dir "/magit-svn.el"))
412
413 (with-directory-excursion lisp-dir
414 (parameterize ((%emacs emacs))
415 (emacs-generate-autoloads ,name lisp-dir)
416 (setenv "EMACSLOADPATH"
be379ee7 417 (string-append ":" magit ":" dash))
97cc51f8
LC
418 (emacs-batch-eval '(byte-compile-file "magit-svn.el"))))))))
419 (home-page "https://github.com/magit/magit-svn")
420 (synopsis "Git-SVN extension to Magit")
421 (description
422 "This package is an extension to Magit, the Git Emacs mode, providing
423support for Git-SVN.")
424 (license license:gpl3+)))
425
00f4bd50
FB
426(define-public haskell-mode
427 (package
428 (name "haskell-mode")
429 (version "13.14.2")
430 (source (origin
431 (method url-fetch)
432 (file-name (string-append name "-" version ".tar.gz"))
433 (uri (string-append
434 "https://github.com/haskell/haskell-mode/archive/v"
435 version ".tar.gz"))
436 (sha256
437 (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"))))
438 (inputs `(("emacs" ,emacs-no-x)))
439 (native-inputs
440 `(("texinfo" ,texinfo)))
441 (build-system gnu-build-system)
442 (arguments
443 `(#:make-flags (list (string-append "EMACS="
444 (assoc-ref %build-inputs "emacs")
445 "/bin/emacs"))
446 #:phases
447 (modify-phases %standard-phases
448 (delete 'configure)
449 (add-before
450 'build 'pre-build
451 (lambda* (#:key inputs #:allow-other-keys)
452 (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
453 (setenv "SHELL" "sh")
454 (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
455 #t)))
456 (replace
457 'install
458 (lambda* (#:key outputs #:allow-other-keys)
459 (let* ((out (assoc-ref outputs "out"))
460 (el-dir (string-append out "/share/emacs/site-lisp"))
461 (doc (string-append
462 out "/share/doc/haskell-mode-" ,version))
463 (info (string-append out "/share/info")))
464 (define (copy-to-dir dir files)
465 (mkdir-p dir)
466 (for-each
467 (lambda (f)
468 (copy-file f (string-append dir "/" (basename f))))
469 files))
470
471 (with-directory-excursion "doc"
472 (unless (zero? (system* "makeinfo" "haskell-mode.texi"))
473 (error "makeinfo failed"))
474 (mkdir-p info)
475 (copy-file "haskell-mode.info"
476 (string-append info "/haskell-mode.info")))
477 (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
478 (copy-to-dir el-dir (find-files "." "\\.elc?"))
479 ;; these are now distributed with emacs
480 (with-directory-excursion el-dir
481 (for-each delete-file '("cl-lib.el" "ert.el")))
482 #t))))))
483 (home-page "https://github.com/haskell/haskell-mode")
484 (synopsis "Haskell mode for Emacs")
485 (description
486 "This is an Emacs mode for editing, debugging and developing Haskell
487programs.")
488 (license license:gpl3+)))
489
18d26210
MW
490\f
491;;;
492;;; Web browsing.
493;;;
494
495(define-public emacs-w3m
496 (package
497 (name "emacs-w3m")
498 (version "1.4.483+0.20120614")
499 (source (origin
500 (method url-fetch)
501 (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
502 version ".orig.tar.gz"))
503 (sha256
504 (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
505 (build-system gnu-build-system)
506 (native-inputs `(("autoconf" ,autoconf)))
507 (inputs `(("w3m" ,w3m)
508 ("imagemagick" ,imagemagick)
2d32d153 509 ("emacs" ,emacs-no-x)))
18d26210 510 (arguments
caaf1933 511 `(#:modules ((guix build gnu-build-system)
18d26210
MW
512 (guix build utils)
513 (guix build emacs-utils))
8ff3df5b 514 #:imported-modules (,@%gnu-build-system-modules
18d26210
MW
515 (guix build emacs-utils))
516 #:configure-flags
517 (let ((out (assoc-ref %outputs "out")))
518 (list (string-append "--with-lispdir="
519 out "/share/emacs/site-lisp")
520 (string-append "--with-icondir="
521 out "/share/images/emacs-w3m")))
522 #:tests? #f ; no check target
523 #:phases
722ec722
MW
524 (alist-cons-after
525 'unpack 'autoconf
18d26210
MW
526 (lambda _
527 (zero? (system* "autoconf")))
528 (alist-cons-before
529 'build 'patch-exec-paths
530 (lambda* (#:key inputs outputs #:allow-other-keys)
531 (let ((out (assoc-ref outputs "out"))
532 (w3m (assoc-ref inputs "w3m"))
533 (imagemagick (assoc-ref inputs "imagemagick"))
534 (coreutils (assoc-ref inputs "coreutils")))
535 (emacs-substitute-variables "w3m.el"
536 ("w3m-command" (string-append w3m "/bin/w3m"))
537 ("w3m-touch-command" (string-append coreutils "/bin/touch"))
538 ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
539 ("w3m-icon-directory" (string-append out
540 "/share/images/emacs-w3m")))
541 (emacs-substitute-variables "w3m-image.el"
542 ("w3m-imagick-convert-program" (string-append imagemagick
543 "/bin/convert"))
544 ("w3m-imagick-identify-program" (string-append imagemagick
545 "/bin/identify")))
546 #t))
547 (alist-replace
548 'install
549 (lambda* (#:key outputs #:allow-other-keys)
550 (and (zero? (system* "make" "install" "install-icons"))
551 (with-directory-excursion
552 (string-append (assoc-ref outputs "out")
553 "/share/emacs/site-lisp")
554 (for-each delete-file '("ChangeLog" "ChangeLog.1"))
d51cafb0 555 (symlink "w3m-load.el" "w3m-autoloads.el")
18d26210
MW
556 #t)))
557 %standard-phases)))))
558 (home-page "http://emacs-w3m.namazu.org/")
559 (synopsis "Simple Web browser for Emacs based on w3m")
560 (description
35b9e423 561 "Emacs-w3m is an emacs interface for the w3m web browser.")
f61e0e79 562 (license license:gpl2+)))
89925972
MW
563
564(define-public emacs-wget
565 (package
566 (name "emacs-wget")
567 (version "0.5.0")
568 (source (origin
569 (method url-fetch)
570 (uri (string-append "mirror://debian/pool/main/w/wget-el/wget-el_"
571 version ".orig.tar.gz"))
572 (sha256
573 (base32 "10byvyv9dk0ib55gfqm7bcpxmx2qbih1jd03gmihrppr2mn52nff"))))
574 (build-system gnu-build-system)
575 (inputs `(("wget" ,wget)
2d32d153 576 ("emacs" ,emacs-no-x)))
89925972 577 (arguments
caaf1933 578 `(#:modules ((guix build gnu-build-system)
89925972
MW
579 (guix build utils)
580 (guix build emacs-utils))
caaf1933 581 #:imported-modules (,@%gnu-build-system-modules
89925972
MW
582 (guix build emacs-utils))
583 #:tests? #f ; no check target
584 #:phases
585 (alist-replace
586 'configure
587 (lambda* (#:key outputs #:allow-other-keys)
588 (substitute* "Makefile"
589 (("/usr/local") (assoc-ref outputs "out"))
590 (("/site-lisp/emacs-wget") "/site-lisp")))
591 (alist-cons-before
592 'build 'patch-exec-paths
593 (lambda* (#:key inputs outputs #:allow-other-keys)
594 (let ((wget (assoc-ref inputs "wget")))
595 (emacs-substitute-variables "wget.el"
596 ("wget-command" (string-append wget "/bin/wget")))))
d51cafb0
AK
597 (alist-cons-after
598 'install 'post-install
599 (lambda* (#:key outputs #:allow-other-keys)
600 (emacs-generate-autoloads
601 "wget" (string-append (assoc-ref outputs "out")
602 "/share/emacs/site-lisp/")))
603 %standard-phases)))))
89925972 604 (home-page "http://www.emacswiki.org/emacs/EmacsWget")
ae2189a9 605 (synopsis "Simple file downloader for Emacs based on wget")
89925972 606 (description
35b9e423 607 "Emacs-wget is an emacs interface for the wget file downloader.")
f61e0e79 608 (license license:gpl2+)))
77c9286d
LC
609
610\f
611;;;
612;;; Multimedia.
613;;;
614
615(define-public emms
616 (package
617 (name "emms")
618 (version "4.0")
619 (source (origin
620 (method url-fetch)
621 (uri (string-append "mirror://gnu/emms/emms-"
622 version ".tar.gz"))
623 (sha256
624 (base32
625 "1q0n3iwva8bvai2rl9sm49sdjmk0wi7vajz4knz01l7g67nrp87l"))
626 (modules '((guix build utils)))
627 (snippet
628 '(substitute* "Makefile"
629 (("/usr/bin/install-info")
630 ;; No need to use 'install-info' since it would create a
631 ;; useless 'dir' file.
632 "true")
633 (("^INFODIR=.*")
634 ;; Install Info files to $out/share/info, not $out/info.
635 "INFODIR := $(PREFIX)/share/info\n")
636 (("/site-lisp/emms")
637 ;; Install directly in share/emacs/site-lisp, not in a
638 ;; sub-directory.
639 "/site-lisp")
640 (("^all: (.*)\n" _ rest)
641 ;; Build 'emms-print-metadata'.
642 (string-append "all: " rest " emms-print-metadata\n"))))))
643 (build-system gnu-build-system)
644 (arguments
caaf1933 645 `(#:modules ((guix build gnu-build-system)
77c9286d
LC
646 (guix build utils)
647 (guix build emacs-utils))
caaf1933 648 #:imported-modules (,@%gnu-build-system-modules
77c9286d
LC
649 (guix build emacs-utils))
650
651 #:phases (alist-replace
652 'configure
653 (lambda* (#:key inputs outputs #:allow-other-keys)
654 (let ((out (assoc-ref outputs "out"))
655 (vorbis (assoc-ref inputs "vorbis-tools"))
656 (alsa (assoc-ref inputs "alsa-utils"))
657 (mpg321 (assoc-ref inputs "mpg321"))
658 (mp3info (assoc-ref inputs "mp3info")))
659 ;; Specify the installation directory.
660 (substitute* "Makefile"
661 (("PREFIX=.*$")
662 (string-append "PREFIX := " out "\n")))
663
664 (setenv "SHELL" (which "sh"))
665 (setenv "CC" "gcc")
666
667 ;; Specify the absolute file names of the various
668 ;; programs so that everything works out-of-the-box.
669 (with-directory-excursion "lisp"
670 (emacs-substitute-variables
671 "emms-player-mpg321-remote.el"
672 ("emms-player-mpg321-remote-command"
673 (string-append mpg321 "/bin/mpg321")))
674 (substitute* "emms-player-simple.el"
675 (("\"ogg123\"")
676 (string-append "\"" vorbis "/bin/ogg123\"")))
677 (emacs-substitute-variables "emms-info-ogginfo.el"
678 ("emms-info-ogginfo-program-name"
679 (string-append vorbis "/bin/ogginfo")))
680 (emacs-substitute-variables "emms-info-libtag.el"
681 ("emms-info-libtag-program-name"
682 (string-append out "/bin/emms-print-metadata")))
2d2a2bac
LC
683 (emacs-substitute-variables "emms-info-mp3info.el"
684 ("emms-info-mp3info-program-name"
685 (string-append mp3info "/bin/mp3info")))
77c9286d
LC
686 (substitute* "emms-volume-amixer.el"
687 (("\"amixer\"")
688 (string-append "\"" alsa "/bin/amixer\"")))
689 (substitute* "emms-tag-editor.el"
690 (("\"mp3info\"")
a5f60659 691 (string-append "\"" mp3info "/bin/mp3info\""))))))
77c9286d
LC
692 (alist-cons-before
693 'install 'pre-install
694 (lambda* (#:key outputs #:allow-other-keys)
c72aed6d
LC
695 ;; The 'install' rule expects the target directory to
696 ;; exist.
77c9286d
LC
697 (let* ((out (assoc-ref outputs "out"))
698 (man1 (string-append out "/share/man/man1")))
699 (mkdir-p man1)
c72aed6d 700 #t))
77c9286d
LC
701 (alist-cons-after
702 'install 'post-install
703 (lambda* (#:key outputs #:allow-other-keys)
704 (let* ((out (assoc-ref outputs "out"))
705 (target (string-append
706 out "/bin/emms-print-metadata")))
d51cafb0
AK
707 (symlink "emms-auto.el"
708 (string-append out "/share/emacs/site-lisp/"
709 "emms-autoloads.el"))
77c9286d
LC
710 (mkdir-p (dirname target))
711 (copy-file "src/emms-print-metadata" target)
712 (chmod target #o555)))
713 %standard-phases)))
714 #:tests? #f))
2d32d153 715 (native-inputs `(("emacs" ,emacs-no-x) ;for (guix build emacs-utils)
77c9286d 716 ("texinfo" ,texinfo)))
c72aed6d 717 (inputs `(("alsa-utils" ,alsa-utils)
77c9286d
LC
718 ("vorbis-tools" ,vorbis-tools)
719 ("mpg321" ,mpg321)
720 ("taglib" ,taglib)
721 ("mp3info" ,mp3info)))
722 (synopsis "Emacs Multimedia System")
723 (description
724 "EMMS is the Emacs Multimedia System. It is a small front-end which
725can control one of the supported external players. Thus, it supports
726whatever formats are supported by your music player. It also
727supports tagging and playlist management, all behind a clean and
728light user interface.")
729 (home-page "http://www.gnu.org/software/emms/")
f61e0e79 730 (license license:gpl3+)))
c7e553a3
LC
731
732\f
733;;;
734;;; Miscellaneous.
735;;;
736
737(define-public bbdb
738 (package
739 (name "bbdb")
740 (version "3.1.2")
741 (source (origin
742 (method url-fetch)
743 (uri (string-append "mirror://savannah/bbdb/bbdb-"
744 version ".tar.gz"))
745 (sha256
746 (base32
747 "1gs16bbpiiy01w9pyg12868r57kx1v3hnw04gmqsmpc40l1hyy05"))
748 (modules '((guix build utils)))
749 (snippet
750 ;; We don't want to build and install the PDF.
751 '(substitute* "doc/Makefile.in"
752 (("^doc_DATA = .*$")
753 "doc_DATA =\n")))))
754 (build-system gnu-build-system)
755 (arguments
756 '(#:phases (alist-cons-after
757 'install 'post-install
758 (lambda* (#:key outputs #:allow-other-keys)
759 ;; Add an autoloads file with the right name for guix.el.
760 (let* ((out (assoc-ref outputs "out"))
761 (site (string-append out "/share/emacs/site-lisp")))
762 (with-directory-excursion site
763 (symlink "bbdb-loaddefs.el" "bbdb-autoloads.el"))))
764 %standard-phases)))
2d32d153 765 (native-inputs `(("emacs" ,emacs-no-x)))
c7e553a3
LC
766 (home-page "http://savannah.nongnu.org/projects/bbdb/")
767 (synopsis "Contact management utility for Emacs")
768 (description
769 "BBDB is the Insidious Big Brother Database for GNU Emacs. It provides
770an address book for email and snail mail addresses, phone numbers and the
771like. It can be linked with various Emacs mail clients (Message and Mail
772mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable.")
f61e0e79 773 (license license:gpl3+)))
78395334
FB
774
775(define-public emacs-auctex
776 (package
777 (name "emacs-auctex")
778 (version "11.88.6")
779 (source
780 (origin
781 (method url-fetch)
782 (uri (string-append
783 "http://elpa.gnu.org/packages/auctex-"
784 version
785 ".tar"))
786 (sha256
787 (base32
788 "1pmki8hdjjikxlvip3pzi350bln3gcimr27yjf0xfwjvnp5hh9nc"))))
789 (build-system emacs-build-system)
790 (native-inputs
791 `(("perl" ,perl)))
792 (home-page "http://www.gnu.org/software/auctex/")
793 (synopsis "Integrated environment for TeX")
794 (description
795 "AUCTeX is a comprehensive customizable integrated environment for
796writing input files for TeX, LaTeX, ConTeXt, Texinfo, and docTeX using Emacs
797or XEmacs.")
798 (license license:gpl3+)))
85ef742c
FB
799
800(define-public emacs-mmm-mode
801 (package
802 (name "emacs-mmm-mode")
803 (version "0.5.4")
804 (source
805 (origin
806 (method url-fetch)
807 (uri (string-append
0c909c05
AK
808 "https://github.com/purcell/mmm-mode/archive/"
809 version ".tar.gz"))
810 (file-name (string-append name "-" version ".tar.gz"))
85ef742c
FB
811 (sha256
812 (base32
0c909c05
AK
813 "10kwslnflbjqm62wkrq420crqzdqalzfflp9pqk1i12zm6dm4mfv"))))
814 (build-system gnu-build-system)
815 (arguments
816 '(#:phases
817 (modify-phases %standard-phases
818 (add-after 'unpack 'autogen
819 (lambda _
820 (zero? (system* "sh" "autogen.sh")))))))
821 (native-inputs
822 `(("autoconf" ,autoconf)
823 ("automake" ,automake)
824 ("emacs" ,emacs-no-x)
825 ("texinfo" ,texinfo)))
85ef742c 826 (home-page "https://github.com/purcell/mmm-mode")
0c909c05 827 (synopsis "Allow multiple major modes in an Emacs buffer")
85ef742c 828 (description
0c909c05 829 "MMM Mode is a minor mode that allows multiple major modes to coexist in a
85ef742c
FB
830single buffer.")
831 (license license:gpl3+)))
ec9825d6
RW
832
833(define-public emacs-pdf-tools
834 (package
835 (name "emacs-pdf-tools")
836 (version "0.60")
837 (source (origin
838 (method url-fetch)
839 (uri (string-append
840 "https://github.com/politza/pdf-tools/archive/v"
841 version ".tar.gz"))
842 (file-name (string-append name "-" version ".tar.gz"))
843 (sha256
844 (base32
845 "1y8k5n2jbyaxby0j6f4m9xbm0ddpmbkrfj6rp6ll5sb97lcg3vrx"))))
846 (build-system gnu-build-system)
847 (arguments
848 `(#:tests? #f ; there are no tests
849 #:modules ((guix build gnu-build-system)
850 (guix build utils)
851 (guix build emacs-utils))
852 #:imported-modules (,@%gnu-build-system-modules
853 (guix build emacs-utils))
854 #:phases
855 (modify-phases %standard-phases
856 (add-after 'unpack 'enter-dir (lambda _ (chdir "server") #t))
857 (add-before
858 'configure 'autogen
859 (lambda _
860 (zero? (system* "bash" "autogen.sh"))))
861 (add-before
862 'build 'patch-variables
863 (lambda* (#:key outputs #:allow-other-keys)
864 (with-directory-excursion "../lisp"
865 ;; Set path to epdfinfo program.
866 (emacs-substitute-variables "pdf-info.el"
867 ("pdf-info-epdfinfo-program"
868 (string-append (assoc-ref outputs "out")
869 "/bin/epdfinfo")))
870 ;; Set 'pdf-tools-handle-upgrades' to nil to avoid "auto
871 ;; upgrading" that pdf-tools tries to perform.
872 (emacs-substitute-variables "pdf-tools.el"
873 ("pdf-tools-handle-upgrades" '())))))
874 (add-after
875 'install 'install-lisp
876 (lambda* (#:key outputs #:allow-other-keys)
877 (let ((target (string-append (assoc-ref outputs "out")
878 "/share/emacs/site-lisp/")))
879 (mkdir-p target)
880 (for-each
881 (lambda (file)
882 (copy-file file (string-append target (basename file))))
883 (find-files "../lisp" "^(pdf|tab).*\\.elc?"))
884 (emacs-byte-compile-directory target)
885 (emacs-generate-autoloads "pdf-tools" target)))))))
886 (native-inputs `(("autoconf" ,autoconf)
887 ("automake" ,automake)
888 ("pkg-config" ,pkg-config)
889 ("emacs" ,emacs-no-x)))
890 (inputs `(("poppler" ,poppler)
891 ("cairo" ,cairo)
892 ("glib" ,glib)
893 ("libpng" ,libpng)
894 ("zlib" ,zlib)))
895 (synopsis "Emacs support library for PDF files")
896 (description
897 "PDF Tools is, among other things, a replacement of DocView for PDF
898files. The key difference is that pages are not pre-rendered by
899e.g. ghostscript and stored in the file-system, but rather created on-demand
900and stored in memory.")
901 (home-page "https://github.com/politza/pdf-tools")
902 (license license:gpl3+)))
d4dbf10e
FB
903
904(define-public emacs-dash
905 (package
906 (name "emacs-dash")
907 (version "2.11.0")
908 (source (origin
909 (method url-fetch)
910 (uri (string-append
911 "https://github.com/magnars/dash.el/archive/"
912 version ".tar.gz"))
913 (file-name (string-append name "-" version ".tar.gz"))
914 (sha256
915 (base32
916 "1piwcwilkxcbjxx832mhb7q3pz1fgwp203r581bpqcw6kd5x726q"))))
917 (build-system emacs-build-system)
918 (arguments
919 `(#:phases
920 (modify-phases %standard-phases
921 (add-before 'install 'check
922 (lambda _
923 (zero? (system* "./run-tests.sh")))))))
924 (home-page "https://github.com/magnars/dash.el")
925 (synopsis "Modern list library for Emacs")
926 (description "This package provides a modern list API library for Emacs.")
927 (license license:gpl3+)))
85777fe5
FB
928
929(define-public emacs-s
930 (package
931 (name "emacs-s")
932 (version "1.9.0")
933 (source (origin
934 (method url-fetch)
935 (uri (string-append
936 "https://github.com/magnars/s.el/archive/"
937 version ".tar.gz"))
938 (file-name (string-append name "-" version ".tar.gz"))
939 (sha256
940 (base32
941 "1gah2k577gvnmxlpw7zrz0jr571vghzhdv2hbgchlgah07czd091"))))
942 (build-system emacs-build-system)
943 (arguments
944 `(#:phases
945 (modify-phases %standard-phases
946 (add-before 'install 'check
947 (lambda _
948 (zero? (system* "./run-tests.sh")))))))
949 (home-page "https://github.com/magnars/s.el")
950 (synopsis "Emacs string manipulation library.")
951 (description "This package provides an Emacs library for manipulating
952strings.")
953 (license license:gpl3+)))
cf9ce01f
FB
954
955(define-public emacs-f
956 (package
957 (name "emacs-f")
958 (version "0.17.2")
959 (source (origin
960 (method url-fetch)
961 (uri (string-append
962 "https://github.com/rejeep/f.el/archive/v"
963 version ".tar.gz"))
964 (file-name (string-append name "-" version ".tar.gz"))
965 (sha256
966 (base32
967 "1n5gcldf43wmkr7jxgs519v21zavwr0yn8048iv6gvgfwicnyjlx"))))
968 (build-system emacs-build-system)
969 (propagated-inputs
970 `(("emacs-s" ,emacs-s)
971 ("emacs-dash" ,emacs-dash)))
972 (home-page "http://github.com/rejeep/f.el")
973 (synopsis "Emacs API for working with files and directories")
974 (description "This package provides an Emacs library for working with
975files and directories.")
976 (license license:gpl3+)))
48dbeef7
FB
977
978(define-public emacs-ob-ipython
979 (package
980 (name "emacs-ob-ipython")
981 (version "20150704.8807064693")
982 (source (origin
983 (method git-fetch)
984 (uri (git-reference
985 (commit "8807064693")
986 (url "https://github.com/gregsexton/ob-ipython.git")))
987 (sha256
988 (base32
989 "1scf25snbds9ymagpny30ijbsg479r3nm0ih01dy4m9d0g7qryb7"))))
990 (build-system emacs-build-system)
991 (propagated-inputs
992 `(("emacs-f" ,emacs-f)))
993 (home-page "http://www.gregsexton.org")
994 (synopsis "Org-Babel functions for IPython evaluation")
995 (description "This package adds support to Org-Babel for evaluating Python
996source code using IPython.")
997 (license license:gpl3+)))