gnu: Rename module gnutls to tls.
[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>
d51cafb0 5;;; Copyright © 2014 Alex Kost <alezost@gmail.com>
468bdabb
LC
6;;;
7;;; This file is part of GNU Guix.
8;;;
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.
13;;;
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.
18;;;
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/>.
21
1ffa7090 22(define-module (gnu packages emacs)
f61e0e79 23 #:use-module ((guix licenses) #:prefix license:)
468bdabb
LC
24 #:use-module (guix packages)
25 #:use-module (guix download)
f906d30c 26 #:use-module (guix git-download)
468bdabb 27 #:use-module (guix build-system gnu)
71f57158 28 #:use-module (guix build-system glib-or-gtk)
fe4163f3 29 #:use-module (guix build-system trivial)
59a43334 30 #:use-module (gnu packages)
f906d30c 31 #:use-module (gnu packages guile)
7abe1965 32 #:use-module (gnu packages gtk)
8ba4dc63 33 #:use-module (gnu packages gnome)
1ffa7090
LC
34 #:use-module (gnu packages ncurses)
35 #:use-module (gnu packages texinfo)
a7fd7b68 36 #:use-module (gnu packages tls)
4f028c8f 37 #:use-module (gnu packages pkg-config)
50efa797
LC
38 #:use-module (gnu packages guile)
39 #:use-module (gnu packages xorg)
40 #:use-module (gnu packages lesstif)
e55354b8 41 #:use-module (gnu packages image)
504a83af 42 #:use-module (gnu packages linux)
9a4c9715 43 #:use-module (gnu packages version-control)
18d26210
MW
44 #:use-module (gnu packages imagemagick)
45 #:use-module (gnu packages w3m)
89925972 46 #:use-module (gnu packages wget)
18d26210 47 #:use-module (gnu packages autotools)
f61e0e79 48 #:use-module (gnu packages compression)
50efa797 49 #:use-module (gnu packages xml)
4a3e602c 50 #:use-module (gnu packages glib)
388fd01b 51 #:use-module (gnu packages acl)
77c9286d
LC
52 #:use-module (gnu packages perl)
53 #:use-module (gnu packages linux) ;alsa
54 #:use-module (gnu packages xiph)
55 #:use-module (gnu packages mp3)
4a3e602c
TUBK
56 #:use-module (guix utils)
57 #:use-module (srfi srfi-1))
468bdabb
LC
58
59(define-public emacs
60 (package
61 (name "emacs")
4c2a38c2 62 (version "24.5")
468bdabb
LC
63 (source (origin
64 (method url-fetch)
65 (uri (string-append "mirror://gnu/emacs/emacs-"
3be9f724 66 version ".tar.xz"))
468bdabb
LC
67 (sha256
68 (base32
1bef37ee
LC
69 "0kn3rzm91qiswi0cql89kbv6mqn27rwsyjfb8xmwy9m5s8fxfiyx"))
70 (patches (list (search-patch "emacs-exec-path.patch")))))
71f57158 71 (build-system glib-or-gtk-build-system)
468bdabb 72 (arguments
388fd01b 73 '(#:phases (alist-cons-before
468bdabb
LC
74 'configure 'fix-/bin/pwd
75 (lambda _
76 ;; Use `pwd', not `/bin/pwd'.
77 (substitute* (find-files "." "^Makefile\\.in$")
78 (("/bin/pwd")
79 "pwd")))
80 %standard-phases)))
81 (inputs
c4c4cc05 82 `(("gnutls" ,gnutls)
468bdabb
LC
83 ("ncurses" ,ncurses)
84
85 ;; TODO: Add the optional dependencies.
fa275717 86 ("libx11" ,libx11)
0a9e9a63 87 ("gtk+" ,gtk+)
fa275717 88 ("libxft" ,libxft)
50efa797 89 ("libtiff" ,libtiff)
504a83af 90 ("giflib" ,giflib)
50efa797 91 ("libjpeg" ,libjpeg-8)
388fd01b 92 ("acl" ,acl)
50efa797
LC
93
94 ;; When looking for libpng `configure' links with `-lpng -lz', so we
95 ;; must also provide zlib as an input.
96 ("libpng" ,libpng)
f61e0e79 97 ("zlib" ,zlib)
50efa797 98
8ba4dc63 99 ("librsvg" ,librsvg)
fa275717 100 ("libxpm" ,libxpm)
50efa797 101 ("libxml2" ,libxml2)
504a83af
MW
102 ("libice" ,libice)
103 ("libsm" ,libsm)
104 ("alsa-lib" ,alsa-lib)
01eafd38 105 ("dbus" ,dbus)))
c4c4cc05
JD
106 (native-inputs
107 `(("pkg-config" ,pkg-config)
108 ("texinfo" ,texinfo)))
468bdabb 109 (home-page "http://www.gnu.org/software/emacs/")
f50d2669 110 (synopsis "The extensible, customizable, self-documenting text editor")
468bdabb 111 (description
79c311b8
LC
112 "GNU Emacs is an extensible and highly customizable text editor. It is
113based on an Emacs Lisp interpreter with extensions for text editing. Emacs
114has been extended in essentially all areas of computing, giving rise to a
115vast array of packages supporting, e.g., email, IRC and XMPP messaging,
116spreadsheets, remote server editing, and much more. Emacs includes extensive
117documentation on all aspects of the system, from basic editing to writing
118large Lisp programs. It has full Unicode support for nearly all human
119languages.")
f61e0e79 120 (license license:gpl3+)))
4f028c8f 121
4fd540b7
LC
122(define-public emacs-no-x
123 ;; This is the version that you should use as an input to packages that just
124 ;; need to byte-compile .el files.
125 (package (inherit emacs)
4fd540b7
LC
126 (name "emacs-no-x")
127 (synopsis "The extensible, customizable, self-documenting text
128editor (console only)")
129 (build-system gnu-build-system)
130 (inputs (fold alist-delete
131 (package-inputs emacs)
132 '("libx11" "gtk+" "libxft" "libtiff" "giflib" "libjpeg"
8ba4dc63 133 "libpng" "librsvg" "libxpm" "libice" "libsm"
4fd540b7
LC
134
135 ;; D-Bus depends on libx11, so remove it as well.
136 "dbus")))))
137
4a3e602c
TUBK
138(define-public emacs-no-x-toolkit
139 (package (inherit emacs)
140 (name "emacs-no-x-toolkit")
141 (synopsis "The extensible, customizable, self-documenting text
142editor (without an X toolkit)" )
71f57158 143 (build-system gnu-build-system)
388fd01b
MW
144 (inputs (append `(("inotify-tools" ,inotify-tools))
145 (alist-delete "gtk+" (package-inputs emacs))))
146 (arguments (append '(#:configure-flags '("--with-x-toolkit=no"))
147 (package-arguments emacs)))))
4a3e602c 148
f906d30c
CAW
149(define-public guile-emacs
150 (package (inherit emacs)
151 (name "guile-emacs")
152 (version "20150512.41120e0")
153 (source (origin
154 (method git-fetch)
155 (uri (git-reference
156 (url "git://git.hcoop.net/git/bpt/emacs.git")
157 (commit "41120e0f595b16387eebfbf731fff70481de1b4b")))
158 (sha256
159 (base32
160 "0lvcvsz0f4mawj04db35p1dvkffdqkz8pkhc0jzh9j9x2i63kcz6"))))
161 (native-inputs
162 `(("autoconf" ,autoconf)
163 ("automake" ,automake)
164 ("guile" ,guile-for-guile-emacs)
165 ,@(package-native-inputs emacs)))
166 (arguments
167 (substitute-keyword-arguments `(;; Build fails if we allow parallel build.
168 #:parallel-build? #f
169 ;; Tests aren't passing for now.
170 #:tests? #f
171 ,@(package-arguments emacs))
172 ((#:phases phases)
173 `(modify-phases ,phases
174 (add-after 'unpack 'autogen
175 (lambda _
176 (zero? (system* "sh" "autogen.sh"))))))))))
177
4f028c8f
LC
178\f
179;;;
180;;; Emacs hacking.
181;;;
182
183(define-public geiser
184 (package
185 (name "geiser")
1f8ad12a 186 (version "0.7")
4f028c8f
LC
187 (source (origin
188 (method url-fetch)
cf8f58b2
LC
189 (uri (string-append "mirror://savannah/geiser/" version
190 "/geiser-" version ".tar.gz"))
4f028c8f 191 (sha256
1f8ad12a
LC
192 (base32
193 "0cp7r91ibw45yw9k3fz1s13y7ryfsxjgpk57qv37qsznb9lmqylx"))))
4f028c8f 194 (build-system gnu-build-system)
d51cafb0
AK
195 (arguments
196 '(#:phases (alist-cons-after
197 'install 'post-install
198 (lambda* (#:key outputs #:allow-other-keys)
199 (symlink "geiser-install.el"
200 (string-append (assoc-ref outputs "out")
201 "/share/emacs/site-lisp/"
202 "geiser-autoloads.el")))
203 %standard-phases)))
4f028c8f 204 (inputs `(("guile" ,guile-2.0)
2d32d153 205 ("emacs" ,emacs-no-x)))
4f028c8f
LC
206 (home-page "http://nongnu.org/geiser/")
207 (synopsis "Collection of Emacs modes for Guile and Racket hacking")
208 (description
9586011d
LC
209 "Geiser is a collection of Emacs major and minor modes that conspire with
210one or more Scheme implementations to keep the Lisp Machine Spirit alive. The
211continuously running Scheme interpreter takes the center of the stage in
212Geiser. A bundle of Elisp shims orchestrates the dialog between the Scheme
213implementation, Emacs and, ultimately, the schemer, giving them access to live
214metadata.")
f61e0e79 215 (license license:bsd-3)))
9a4c9715 216
fe4163f3
MW
217(define-public paredit
218 (package
219 (name "paredit")
220 (version "23")
221 (source (origin
222 (method url-fetch)
223 (uri (string-append "http://mumble.net/~campbell/emacs/paredit-"
224 version ".el"))
225 (sha256
226 (base32 "1np882jzvxckljx3cjz4absyzmc5hw65cs21sjmbic82163m9lf8"))))
227 (build-system trivial-build-system)
2d32d153 228 (inputs `(("emacs" ,emacs-no-x)))
fe4163f3
MW
229 (arguments
230 `(#:modules ((guix build utils)
231 (guix build emacs-utils))
232 #:builder
233 (begin
234 (use-modules (guix build utils))
235 (use-modules (guix build emacs-utils))
236
237 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
238 "/bin/emacs"))
239 (source (assoc-ref %build-inputs "source"))
240 (lisp-dir (string-append %output
241 "/share/emacs/site-lisp"))
242 (target (string-append lisp-dir "/paredit.el")))
243 (mkdir-p lisp-dir)
244 (copy-file source target)
245 (with-directory-excursion lisp-dir
246 (parameterize ((%emacs emacs))
d51cafb0 247 (emacs-generate-autoloads ,name lisp-dir)
fe4163f3
MW
248 (emacs-batch-eval '(byte-compile-file "paredit.el"))))))))
249 (home-page "http://mumble.net/~campbell/emacs/paredit/")
250 (synopsis "Emacs minor mode for editing parentheses")
251 (description
252 "ParEdit (paredit.el) is a minor mode for performing structured editing
253of S-expression data. The typical example of this would be Lisp or Scheme
254source code.
255
256ParEdit helps **keep parentheses balanced** and adds many keys for moving
257S-expressions and moving around in S-expressions. Its behavior can be jarring
258for those who may want transient periods of unbalanced parentheses, such as
259when typing parentheses directly or commenting out code line by line.")
f61e0e79 260 (license license:gpl3+)))
fe4163f3 261
2f910ef6
LC
262(define-public git-modes
263 (package
264 (name "git-modes")
265 (version "1.0.0")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append
269 "https://github.com/magit/git-modes/archive/"
270 version ".tar.gz"))
271 (sha256
272 (base32
273 "1biiss75bswx4alk85k3g9p0a3q3sc9i74h4mnrxc2rsk2iwhws0"))))
274 (build-system gnu-build-system)
275 (arguments
276 `(#:modules ((guix build gnu-build-system)
277 (guix build emacs-utils)
278 (guix build utils))
279 #:imported-modules (,@%gnu-build-system-modules
280 (guix build emacs-utils))
281
282 #:make-flags (list (string-append "PREFIX="
283 (assoc-ref %outputs "out"))
284 ;; Don't put .el files in a 'git-modes'
285 ;; sub-directory.
286 (string-append "LISPDIR="
287 (assoc-ref %outputs "out")
288 "/share/emacs/site-lisp"))
289 #:test-target "test"
290 #:phases (modify-phases %standard-phases
291 (delete 'configure)
292 (add-after 'install 'emacs-autoloads
293 (lambda* (#:key outputs #:allow-other-keys)
294 (let* ((out (assoc-ref outputs "out"))
295 (lisp (string-append
296 out "/share/emacs/site-lisp/")))
297 (emacs-generate-autoloads ,name lisp)))))))
298 (native-inputs `(("emacs" ,emacs-no-x)))
299 (home-page "https://github.com/magit/git-modes")
300 (synopsis "Emacs major modes for Git configuration files")
301 (description
302 "This package provides Emacs major modes for editing various Git
303configuration files, such as .gitattributes, .gitignore, and .git/config.")
304 (license license:gpl3+)))
305
9a4c9715
MW
306(define-public magit
307 (package
308 (name "magit")
7e4871ba 309 (version "1.4.1")
9a4c9715
MW
310 (source (origin
311 (method url-fetch)
fac8b30b
MW
312 (uri (string-append
313 "https://github.com/magit/magit/releases/download/"
314 version "/" name "-" version ".tar.gz"))
9a4c9715 315 (sha256
7e4871ba
LC
316 (base32
317 "0bbvz6cma5vj6qxx9v2m60zqkjwgwjrdf9kp04iacybvrcm8vcg7"))))
9a4c9715 318 (build-system gnu-build-system)
2c047b4a
LC
319 (native-inputs `(("texinfo" ,texinfo)
320 ("emacs" ,emacs-no-x)))
321 (inputs `(("git" ,git)
9a4c9715 322 ("git:gui" ,git "gui")))
7e4871ba 323 (propagated-inputs `(("git-modes" ,git-modes)))
9a4c9715
MW
324 (arguments
325 `(#:modules ((guix build gnu-build-system)
326 (guix build utils)
327 (guix build emacs-utils))
8ff3df5b 328 #:imported-modules (,@%gnu-build-system-modules
9a4c9715 329 (guix build emacs-utils))
7e4871ba
LC
330
331 #:test-target "test"
332 #:tests? #f ;'tests/magit-tests.el' is missing
333
d41a8a07
LC
334 #:make-flags (list
335 ;; Don't put .el files in a sub-directory.
336 (string-append "lispdir=" (assoc-ref %outputs "out")
337 "/share/emacs/site-lisp"))
338
9a4c9715 339 #:phases
c466bfd1
LC
340 (modify-phases %standard-phases
341 (replace
342 'configure
343 (lambda* (#:key outputs #:allow-other-keys)
344 (let ((out (assoc-ref outputs "out")))
345 (substitute* "Makefile"
346 (("/usr/local") out)
347 (("/etc") (string-append out "/etc"))))))
348 (add-before
349 'build 'patch-exec-paths
350 (lambda* (#:key inputs #:allow-other-keys)
351 (let ((git (assoc-ref inputs "git"))
352 (git:gui (assoc-ref inputs "git:gui")))
353 (emacs-substitute-variables "magit.el"
354 ("magit-git-executable" (string-append git "/bin/git"))
7e4871ba
LC
355 ("magit-gitk-executable" (string-append git:gui
356 "/bin/gitk"))))))
357 (add-before
358 'build 'augment-load-path
359 (lambda* (#:key inputs #:allow-other-keys)
360 ;; Allow git-commit-mode.el & co. to be found.
361 (let ((git-modes (assoc-ref inputs "git-modes")))
362 (setenv "EMACSLOADPATH"
363 (string-append ":" git-modes "/share/emacs/site-lisp"))
364 #t)))
c466bfd1 365 (add-after
d51cafb0
AK
366 'install 'post-install
367 (lambda* (#:key outputs #:allow-other-keys)
368 (emacs-generate-autoloads
369 ,name (string-append (assoc-ref outputs "out")
c466bfd1 370 "/share/emacs/site-lisp/")))))))
9a4c9715
MW
371 (home-page "http://magit.github.io/")
372 (synopsis "Emacs interface for the Git version control system")
373 (description
374 "With Magit, you can inspect and modify your Git repositories with Emacs.
375You can review and commit the changes you have made to the tracked files, for
376example, and you can browse the history of past changes. There is support for
377cherry picking, reverting, merging, rebasing, and other common Git
378operations.")
f61e0e79 379 (license license:gpl3+)))
18d26210 380
97cc51f8
LC
381(define-public magit-svn
382 (package
383 (name "magit-svn")
384 (version "b69b79")
385 (source (origin
386 (method git-fetch)
387 (uri (git-reference
388 (commit version)
389 (url "https://github.com/magit/magit-svn.git")))
390 (sha256
391 (base32
392 "07xxszd12r38s46sz8fn2qz26b7s88i022cqp3gmkmmj3j57kqv6"))))
393 (build-system trivial-build-system)
394 (inputs `(("emacs" ,emacs-no-x)
395 ("magit" ,magit)))
396 (arguments
397 `(#:modules ((guix build utils)
398 (guix build emacs-utils))
399
400 #:builder
401 (begin
402 (use-modules (guix build utils)
403 (guix build emacs-utils))
404
405 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
406 "/bin/emacs"))
407 (magit (string-append (assoc-ref %build-inputs "magit")
408 "/share/emacs/site-lisp"))
409 (commit (string-append (assoc-ref %build-inputs
410 "magit/git-modes")
411 "/share/emacs/site-lisp"))
412 (source (assoc-ref %build-inputs "source"))
413 (lisp-dir (string-append %output "/share/emacs/site-lisp")))
414 (mkdir-p lisp-dir)
415 (copy-file (string-append source "/magit-svn.el")
416 (string-append lisp-dir "/magit-svn.el"))
417
418 (with-directory-excursion lisp-dir
419 (parameterize ((%emacs emacs))
420 (emacs-generate-autoloads ,name lisp-dir)
421 (setenv "EMACSLOADPATH"
422 (string-append ":" magit ":" commit))
423 (emacs-batch-eval '(byte-compile-file "magit-svn.el"))))))))
424 (home-page "https://github.com/magit/magit-svn")
425 (synopsis "Git-SVN extension to Magit")
426 (description
427 "This package is an extension to Magit, the Git Emacs mode, providing
428support for Git-SVN.")
429 (license license:gpl3+)))
430
00f4bd50
FB
431(define-public haskell-mode
432 (package
433 (name "haskell-mode")
434 (version "13.14.2")
435 (source (origin
436 (method url-fetch)
437 (file-name (string-append name "-" version ".tar.gz"))
438 (uri (string-append
439 "https://github.com/haskell/haskell-mode/archive/v"
440 version ".tar.gz"))
441 (sha256
442 (base32 "1kxc2yj8vb122dv91r68h7c5ladcryx963fr16plfhg71fv7f9av"))))
443 (inputs `(("emacs" ,emacs-no-x)))
444 (native-inputs
445 `(("texinfo" ,texinfo)))
446 (build-system gnu-build-system)
447 (arguments
448 `(#:make-flags (list (string-append "EMACS="
449 (assoc-ref %build-inputs "emacs")
450 "/bin/emacs"))
451 #:phases
452 (modify-phases %standard-phases
453 (delete 'configure)
454 (add-before
455 'build 'pre-build
456 (lambda* (#:key inputs #:allow-other-keys)
457 (let ((sh (string-append (assoc-ref inputs "bash") "/bin/sh")))
458 (setenv "SHELL" "sh")
459 (substitute* (find-files "." "\\.el") (("/bin/sh") sh))
460 #t)))
461 (replace
462 'install
463 (lambda* (#:key outputs #:allow-other-keys)
464 (let* ((out (assoc-ref outputs "out"))
465 (el-dir (string-append out "/share/emacs/site-lisp"))
466 (doc (string-append
467 out "/share/doc/haskell-mode-" ,version))
468 (info (string-append out "/share/info")))
469 (define (copy-to-dir dir files)
470 (mkdir-p dir)
471 (for-each
472 (lambda (f)
473 (copy-file f (string-append dir "/" (basename f))))
474 files))
475
476 (with-directory-excursion "doc"
477 (unless (zero? (system* "makeinfo" "haskell-mode.texi"))
478 (error "makeinfo failed"))
479 (mkdir-p info)
480 (copy-file "haskell-mode.info"
481 (string-append info "/haskell-mode.info")))
482 (copy-to-dir doc '("CONTRIBUTING.md" "NEWS" "README.md"))
483 (copy-to-dir el-dir (find-files "." "\\.elc?"))
484 ;; these are now distributed with emacs
485 (with-directory-excursion el-dir
486 (for-each delete-file '("cl-lib.el" "ert.el")))
487 #t))))))
488 (home-page "https://github.com/haskell/haskell-mode")
489 (synopsis "Haskell mode for Emacs")
490 (description
491 "This is an Emacs mode for editing, debugging and developing Haskell
492programs.")
493 (license license:gpl3+)))
494
18d26210
MW
495\f
496;;;
497;;; Web browsing.
498;;;
499
500(define-public emacs-w3m
501 (package
502 (name "emacs-w3m")
503 (version "1.4.483+0.20120614")
504 (source (origin
505 (method url-fetch)
506 (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
507 version ".orig.tar.gz"))
508 (sha256
509 (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
510 (build-system gnu-build-system)
511 (native-inputs `(("autoconf" ,autoconf)))
512 (inputs `(("w3m" ,w3m)
513 ("imagemagick" ,imagemagick)
2d32d153 514 ("emacs" ,emacs-no-x)))
18d26210 515 (arguments
caaf1933 516 `(#:modules ((guix build gnu-build-system)
18d26210
MW
517 (guix build utils)
518 (guix build emacs-utils))
8ff3df5b 519 #:imported-modules (,@%gnu-build-system-modules
18d26210
MW
520 (guix build emacs-utils))
521 #:configure-flags
522 (let ((out (assoc-ref %outputs "out")))
523 (list (string-append "--with-lispdir="
524 out "/share/emacs/site-lisp")
525 (string-append "--with-icondir="
526 out "/share/images/emacs-w3m")))
527 #:tests? #f ; no check target
528 #:phases
722ec722
MW
529 (alist-cons-after
530 'unpack 'autoconf
18d26210
MW
531 (lambda _
532 (zero? (system* "autoconf")))
533 (alist-cons-before
534 'build 'patch-exec-paths
535 (lambda* (#:key inputs outputs #:allow-other-keys)
536 (let ((out (assoc-ref outputs "out"))
537 (w3m (assoc-ref inputs "w3m"))
538 (imagemagick (assoc-ref inputs "imagemagick"))
539 (coreutils (assoc-ref inputs "coreutils")))
540 (emacs-substitute-variables "w3m.el"
541 ("w3m-command" (string-append w3m "/bin/w3m"))
542 ("w3m-touch-command" (string-append coreutils "/bin/touch"))
543 ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
544 ("w3m-icon-directory" (string-append out
545 "/share/images/emacs-w3m")))
546 (emacs-substitute-variables "w3m-image.el"
547 ("w3m-imagick-convert-program" (string-append imagemagick
548 "/bin/convert"))
549 ("w3m-imagick-identify-program" (string-append imagemagick
550 "/bin/identify")))
551 #t))
552 (alist-replace
553 'install
554 (lambda* (#:key outputs #:allow-other-keys)
555 (and (zero? (system* "make" "install" "install-icons"))
556 (with-directory-excursion
557 (string-append (assoc-ref outputs "out")
558 "/share/emacs/site-lisp")
559 (for-each delete-file '("ChangeLog" "ChangeLog.1"))
d51cafb0 560 (symlink "w3m-load.el" "w3m-autoloads.el")
18d26210
MW
561 #t)))
562 %standard-phases)))))
563 (home-page "http://emacs-w3m.namazu.org/")
564 (synopsis "Simple Web browser for Emacs based on w3m")
565 (description
35b9e423 566 "Emacs-w3m is an emacs interface for the w3m web browser.")
f61e0e79 567 (license license:gpl2+)))
89925972
MW
568
569(define-public emacs-wget
570 (package
571 (name "emacs-wget")
572 (version "0.5.0")
573 (source (origin
574 (method url-fetch)
575 (uri (string-append "mirror://debian/pool/main/w/wget-el/wget-el_"
576 version ".orig.tar.gz"))
577 (sha256
578 (base32 "10byvyv9dk0ib55gfqm7bcpxmx2qbih1jd03gmihrppr2mn52nff"))))
579 (build-system gnu-build-system)
580 (inputs `(("wget" ,wget)
2d32d153 581 ("emacs" ,emacs-no-x)))
89925972 582 (arguments
caaf1933 583 `(#:modules ((guix build gnu-build-system)
89925972
MW
584 (guix build utils)
585 (guix build emacs-utils))
caaf1933 586 #:imported-modules (,@%gnu-build-system-modules
89925972
MW
587 (guix build emacs-utils))
588 #:tests? #f ; no check target
589 #:phases
590 (alist-replace
591 'configure
592 (lambda* (#:key outputs #:allow-other-keys)
593 (substitute* "Makefile"
594 (("/usr/local") (assoc-ref outputs "out"))
595 (("/site-lisp/emacs-wget") "/site-lisp")))
596 (alist-cons-before
597 'build 'patch-exec-paths
598 (lambda* (#:key inputs outputs #:allow-other-keys)
599 (let ((wget (assoc-ref inputs "wget")))
600 (emacs-substitute-variables "wget.el"
601 ("wget-command" (string-append wget "/bin/wget")))))
d51cafb0
AK
602 (alist-cons-after
603 'install 'post-install
604 (lambda* (#:key outputs #:allow-other-keys)
605 (emacs-generate-autoloads
606 "wget" (string-append (assoc-ref outputs "out")
607 "/share/emacs/site-lisp/")))
608 %standard-phases)))))
89925972 609 (home-page "http://www.emacswiki.org/emacs/EmacsWget")
ae2189a9 610 (synopsis "Simple file downloader for Emacs based on wget")
89925972 611 (description
35b9e423 612 "Emacs-wget is an emacs interface for the wget file downloader.")
f61e0e79 613 (license license:gpl2+)))
77c9286d
LC
614
615\f
616;;;
617;;; Multimedia.
618;;;
619
620(define-public emms
621 (package
622 (name "emms")
623 (version "4.0")
624 (source (origin
625 (method url-fetch)
626 (uri (string-append "mirror://gnu/emms/emms-"
627 version ".tar.gz"))
628 (sha256
629 (base32
630 "1q0n3iwva8bvai2rl9sm49sdjmk0wi7vajz4knz01l7g67nrp87l"))
631 (modules '((guix build utils)))
632 (snippet
633 '(substitute* "Makefile"
634 (("/usr/bin/install-info")
635 ;; No need to use 'install-info' since it would create a
636 ;; useless 'dir' file.
637 "true")
638 (("^INFODIR=.*")
639 ;; Install Info files to $out/share/info, not $out/info.
640 "INFODIR := $(PREFIX)/share/info\n")
641 (("/site-lisp/emms")
642 ;; Install directly in share/emacs/site-lisp, not in a
643 ;; sub-directory.
644 "/site-lisp")
645 (("^all: (.*)\n" _ rest)
646 ;; Build 'emms-print-metadata'.
647 (string-append "all: " rest " emms-print-metadata\n"))))))
648 (build-system gnu-build-system)
649 (arguments
caaf1933 650 `(#:modules ((guix build gnu-build-system)
77c9286d
LC
651 (guix build utils)
652 (guix build emacs-utils))
caaf1933 653 #:imported-modules (,@%gnu-build-system-modules
77c9286d
LC
654 (guix build emacs-utils))
655
656 #:phases (alist-replace
657 'configure
658 (lambda* (#:key inputs outputs #:allow-other-keys)
659 (let ((out (assoc-ref outputs "out"))
660 (vorbis (assoc-ref inputs "vorbis-tools"))
661 (alsa (assoc-ref inputs "alsa-utils"))
662 (mpg321 (assoc-ref inputs "mpg321"))
663 (mp3info (assoc-ref inputs "mp3info")))
664 ;; Specify the installation directory.
665 (substitute* "Makefile"
666 (("PREFIX=.*$")
667 (string-append "PREFIX := " out "\n")))
668
669 (setenv "SHELL" (which "sh"))
670 (setenv "CC" "gcc")
671
672 ;; Specify the absolute file names of the various
673 ;; programs so that everything works out-of-the-box.
674 (with-directory-excursion "lisp"
675 (emacs-substitute-variables
676 "emms-player-mpg321-remote.el"
677 ("emms-player-mpg321-remote-command"
678 (string-append mpg321 "/bin/mpg321")))
679 (substitute* "emms-player-simple.el"
680 (("\"ogg123\"")
681 (string-append "\"" vorbis "/bin/ogg123\"")))
682 (emacs-substitute-variables "emms-info-ogginfo.el"
683 ("emms-info-ogginfo-program-name"
684 (string-append vorbis "/bin/ogginfo")))
685 (emacs-substitute-variables "emms-info-libtag.el"
686 ("emms-info-libtag-program-name"
687 (string-append out "/bin/emms-print-metadata")))
2d2a2bac
LC
688 (emacs-substitute-variables "emms-info-mp3info.el"
689 ("emms-info-mp3info-program-name"
690 (string-append mp3info "/bin/mp3info")))
77c9286d
LC
691 (substitute* "emms-volume-amixer.el"
692 (("\"amixer\"")
693 (string-append "\"" alsa "/bin/amixer\"")))
694 (substitute* "emms-tag-editor.el"
695 (("\"mp3info\"")
a5f60659 696 (string-append "\"" mp3info "/bin/mp3info\""))))))
77c9286d
LC
697 (alist-cons-before
698 'install 'pre-install
699 (lambda* (#:key outputs #:allow-other-keys)
c72aed6d
LC
700 ;; The 'install' rule expects the target directory to
701 ;; exist.
77c9286d
LC
702 (let* ((out (assoc-ref outputs "out"))
703 (man1 (string-append out "/share/man/man1")))
704 (mkdir-p man1)
c72aed6d 705 #t))
77c9286d
LC
706 (alist-cons-after
707 'install 'post-install
708 (lambda* (#:key outputs #:allow-other-keys)
709 (let* ((out (assoc-ref outputs "out"))
710 (target (string-append
711 out "/bin/emms-print-metadata")))
d51cafb0
AK
712 (symlink "emms-auto.el"
713 (string-append out "/share/emacs/site-lisp/"
714 "emms-autoloads.el"))
77c9286d
LC
715 (mkdir-p (dirname target))
716 (copy-file "src/emms-print-metadata" target)
717 (chmod target #o555)))
718 %standard-phases)))
719 #:tests? #f))
2d32d153 720 (native-inputs `(("emacs" ,emacs-no-x) ;for (guix build emacs-utils)
77c9286d 721 ("texinfo" ,texinfo)))
c72aed6d 722 (inputs `(("alsa-utils" ,alsa-utils)
77c9286d
LC
723 ("vorbis-tools" ,vorbis-tools)
724 ("mpg321" ,mpg321)
725 ("taglib" ,taglib)
726 ("mp3info" ,mp3info)))
727 (synopsis "Emacs Multimedia System")
728 (description
729 "EMMS is the Emacs Multimedia System. It is a small front-end which
730can control one of the supported external players. Thus, it supports
731whatever formats are supported by your music player. It also
732supports tagging and playlist management, all behind a clean and
733light user interface.")
734 (home-page "http://www.gnu.org/software/emms/")
f61e0e79 735 (license license:gpl3+)))
c7e553a3
LC
736
737\f
738;;;
739;;; Miscellaneous.
740;;;
741
742(define-public bbdb
743 (package
744 (name "bbdb")
745 (version "3.1.2")
746 (source (origin
747 (method url-fetch)
748 (uri (string-append "mirror://savannah/bbdb/bbdb-"
749 version ".tar.gz"))
750 (sha256
751 (base32
752 "1gs16bbpiiy01w9pyg12868r57kx1v3hnw04gmqsmpc40l1hyy05"))
753 (modules '((guix build utils)))
754 (snippet
755 ;; We don't want to build and install the PDF.
756 '(substitute* "doc/Makefile.in"
757 (("^doc_DATA = .*$")
758 "doc_DATA =\n")))))
759 (build-system gnu-build-system)
760 (arguments
761 '(#:phases (alist-cons-after
762 'install 'post-install
763 (lambda* (#:key outputs #:allow-other-keys)
764 ;; Add an autoloads file with the right name for guix.el.
765 (let* ((out (assoc-ref outputs "out"))
766 (site (string-append out "/share/emacs/site-lisp")))
767 (with-directory-excursion site
768 (symlink "bbdb-loaddefs.el" "bbdb-autoloads.el"))))
769 %standard-phases)))
2d32d153 770 (native-inputs `(("emacs" ,emacs-no-x)))
c7e553a3
LC
771 (home-page "http://savannah.nongnu.org/projects/bbdb/")
772 (synopsis "Contact management utility for Emacs")
773 (description
774 "BBDB is the Insidious Big Brother Database for GNU Emacs. It provides
775an address book for email and snail mail addresses, phone numbers and the
776like. It can be linked with various Emacs mail clients (Message and Mail
777mode, Rmail, Gnus, MH-E, and VM). BBDB is fully customizable.")
f61e0e79 778 (license license:gpl3+)))