gnu: Fix synopses for emacs-wget and fetchmail.
[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 Ludovic Courtès <ludo@gnu.org>
4 ;;; Copyright © 2014 Mark H Weaver <mhw@netris.org>
5 ;;;
6 ;;; This file is part of GNU Guix.
7 ;;;
8 ;;; GNU Guix is free software; you can redistribute it and/or modify it
9 ;;; under the terms of the GNU General Public License as published by
10 ;;; the Free Software Foundation; either version 3 of the License, or (at
11 ;;; your option) any later version.
12 ;;;
13 ;;; GNU Guix is distributed in the hope that it will be useful, but
14 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
15 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 ;;; GNU General Public License for more details.
17 ;;;
18 ;;; You should have received a copy of the GNU General Public License
19 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21 (define-module (gnu packages emacs)
22 #:use-module (guix licenses)
23 #:use-module (guix packages)
24 #:use-module (guix download)
25 #:use-module (guix build-system gnu)
26 #:use-module (guix build-system trivial)
27 #:use-module (gnu packages)
28 #:use-module (gnu packages gtk)
29 #:use-module (gnu packages ncurses)
30 #:use-module (gnu packages texinfo)
31 #:use-module (gnu packages gnutls)
32 #:use-module (gnu packages pkg-config)
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages xorg)
35 #:use-module (gnu packages lesstif)
36 #:use-module (gnu packages image)
37 #:use-module (gnu packages giflib)
38 #:use-module (gnu packages linux)
39 #:use-module (gnu packages version-control)
40 #:use-module (gnu packages imagemagick)
41 #:use-module (gnu packages w3m)
42 #:use-module (gnu packages wget)
43 #:use-module (gnu packages autotools)
44 #:use-module ((gnu packages compression)
45 #:renamer (symbol-prefix-proc 'compression:))
46 #:use-module (gnu packages xml)
47 #:use-module (gnu packages glib)
48 #:use-module (guix utils)
49 #:use-module (srfi srfi-1))
50
51 (define-public emacs
52 (package
53 (name "emacs")
54 (version "24.3")
55 (source (origin
56 (method url-fetch)
57 (uri (string-append "mirror://gnu/emacs/emacs-"
58 version ".tar.xz"))
59 (sha256
60 (base32
61 "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh"))
62 (patches (list (search-patch "emacs-configure-sh.patch")))))
63 (build-system gnu-build-system)
64 (arguments
65 '(#:configure-flags
66 (list (string-append "--with-crt-dir=" (assoc-ref %build-inputs "libc")
67 "/lib"))
68 #:phases (alist-cons-before
69 'configure 'fix-/bin/pwd
70 (lambda _
71 ;; Use `pwd', not `/bin/pwd'.
72 (substitute* (find-files "." "^Makefile\\.in$")
73 (("/bin/pwd")
74 "pwd")))
75 %standard-phases)))
76 (inputs
77 `(("gnutls" ,gnutls)
78 ("ncurses" ,ncurses)
79
80 ;; TODO: Add the optional dependencies.
81 ("xlibs" ,libx11)
82 ("gtk+" ,gtk+-2)
83 ("libXft" ,libxft)
84 ("libtiff" ,libtiff)
85 ("giflib" ,giflib)
86 ("libjpeg" ,libjpeg-8)
87
88 ;; When looking for libpng `configure' links with `-lpng -lz', so we
89 ;; must also provide zlib as an input.
90 ("libpng" ,libpng)
91 ("zlib" ,compression:zlib)
92
93 ("libXpm" ,libxpm)
94 ("libxml2" ,libxml2)
95 ("libice" ,libice)
96 ("libsm" ,libsm)
97 ("alsa-lib" ,alsa-lib)
98 ("dbus" ,dbus)))
99 (native-inputs
100 `(("pkg-config" ,pkg-config)
101 ("texinfo" ,texinfo)))
102 (home-page "http://www.gnu.org/software/emacs/")
103 (synopsis "The extensible, customizable, self-documenting text editor")
104 (description
105 "GNU Emacs is an extensible and highly customizable text editor. It is
106 based on an Emacs Lisp interpreter with extensions for text editing. Emacs
107 has been extended in essentially all areas of computing, giving rise to a
108 vast array of packages supporting, e.g., email, IRC and XMPP messaging,
109 spreadsheets, remote server editing, and much more. Emacs includes extensive
110 documentation on all aspects of the system, from basic editing to writing
111 large Lisp programs. It has full Unicode support for nearly all human
112 languages.")
113 (license gpl3+)))
114
115 (define-public emacs-no-x-toolkit
116 (package (inherit emacs)
117 (name "emacs-no-x-toolkit")
118 (synopsis "The extensible, customizable, self-documenting text
119 editor (without an X toolkit)" )
120 (inputs (alist-delete "gtk+" (package-inputs emacs)))
121 (arguments
122 (substitute-keyword-arguments (package-arguments emacs)
123 ((#:configure-flags flags)
124 `(cons "--with-x-toolkit=no" ,flags))))))
125
126 \f
127 ;;;
128 ;;; Emacs hacking.
129 ;;;
130
131 (define-public geiser
132 (package
133 (name "geiser")
134 (version "0.6")
135 (source (origin
136 (method url-fetch)
137 (uri (string-append "mirror://savannah/geiser/" version
138 "/geiser-" version ".tar.gz"))
139 (sha256
140 (base32 "1mrk0bzqcpfhsw6635qznn47nzfy9ps7wrhkpymswdfpw5mdsry5"))))
141 (build-system gnu-build-system)
142 (inputs `(("guile" ,guile-2.0)
143 ("emacs" ,emacs)))
144 (home-page "http://nongnu.org/geiser/")
145 (synopsis "Collection of Emacs modes for Guile and Racket hacking")
146 (description
147 "Geiser is a collection of Emacs major and minor modes that
148 conspire with one or more Scheme interpreters to keep the Lisp Machine
149 Spirit alive. It draws inspiration (and a bit more) from environments
150 such as Common Lisp’s Slime, Factor’s FUEL, Squeak or Emacs itself, and
151 does its best to make Scheme hacking inside Emacs (even more) fun.
152
153 Or, to be precise, what i consider fun. Geiser is thus my humble
154 contribution to the dynamic school of expression, and a reaction against
155 what i perceive as a derailment, in modern times, of standard Scheme
156 towards the static camp. Because i prefer growing and healing to poking
157 at corpses, the continuously running Scheme interpreter takes the center
158 of the stage in Geiser. A bundle of Elisp shims orchestrates the dialog
159 between the Scheme interpreter, Emacs and, ultimately, the schemer,
160 giving her access to live metadata.")
161 (license bsd-3)))
162
163 (define-public paredit
164 (package
165 (name "paredit")
166 (version "23")
167 (source (origin
168 (method url-fetch)
169 (uri (string-append "http://mumble.net/~campbell/emacs/paredit-"
170 version ".el"))
171 (sha256
172 (base32 "1np882jzvxckljx3cjz4absyzmc5hw65cs21sjmbic82163m9lf8"))))
173 (build-system trivial-build-system)
174 (inputs `(("emacs" ,emacs)))
175 (arguments
176 `(#:modules ((guix build utils)
177 (guix build emacs-utils))
178 #:builder
179 (begin
180 (use-modules (guix build utils))
181 (use-modules (guix build emacs-utils))
182
183 (let* ((emacs (string-append (assoc-ref %build-inputs "emacs")
184 "/bin/emacs"))
185 (source (assoc-ref %build-inputs "source"))
186 (lisp-dir (string-append %output
187 "/share/emacs/site-lisp"))
188 (target (string-append lisp-dir "/paredit.el")))
189 (mkdir-p lisp-dir)
190 (copy-file source target)
191 (with-directory-excursion lisp-dir
192 (parameterize ((%emacs emacs))
193 (emacs-batch-eval '(byte-compile-file "paredit.el"))))))))
194 (home-page "http://mumble.net/~campbell/emacs/paredit/")
195 (synopsis "Emacs minor mode for editing parentheses")
196 (description
197 "ParEdit (paredit.el) is a minor mode for performing structured editing
198 of S-expression data. The typical example of this would be Lisp or Scheme
199 source code.
200
201 ParEdit helps **keep parentheses balanced** and adds many keys for moving
202 S-expressions and moving around in S-expressions. Its behavior can be jarring
203 for those who may want transient periods of unbalanced parentheses, such as
204 when typing parentheses directly or commenting out code line by line.")
205 (license gpl3+)))
206
207 (define-public magit
208 (package
209 (name "magit")
210 (version "1.2.0")
211 (source (origin
212 (method url-fetch)
213 (uri (string-append "https://github.com/downloads/magit/magit/magit-"
214 version ".tar.gz"))
215 (sha256
216 (base32 "1a8vvilhd5y5vmlpsh194qpl4qlg0a1brylfscxcacpfp0cmhlzg"))))
217 (build-system gnu-build-system)
218 (native-inputs `(("texinfo" ,texinfo)))
219 (inputs `(("emacs" ,emacs)
220 ("git" ,git)
221 ("git:gui" ,git "gui")))
222 (arguments
223 `(#:modules ((guix build gnu-build-system)
224 (guix build utils)
225 (guix build emacs-utils))
226 #:imported-modules ((guix build gnu-build-system)
227 (guix build utils)
228 (guix build emacs-utils))
229 #:tests? #f ; no check target
230 #:phases
231 (alist-replace
232 'configure
233 (lambda* (#:key outputs #:allow-other-keys)
234 (let ((out (assoc-ref outputs "out")))
235 (substitute* "Makefile"
236 (("/usr/local") out)
237 (("/etc") (string-append out "/etc")))))
238 (alist-cons-before
239 'build 'patch-exec-paths
240 (lambda* (#:key inputs #:allow-other-keys)
241 (let ((git (assoc-ref inputs "git"))
242 (git:gui (assoc-ref inputs "git:gui")))
243 (emacs-substitute-variables "magit.el"
244 ("magit-git-executable" (string-append git "/bin/git"))
245 ("magit-gitk-executable" (string-append git:gui "/bin/gitk")))))
246 %standard-phases))))
247 (home-page "http://magit.github.io/")
248 (synopsis "Emacs interface for the Git version control system")
249 (description
250 "With Magit, you can inspect and modify your Git repositories with Emacs.
251 You can review and commit the changes you have made to the tracked files, for
252 example, and you can browse the history of past changes. There is support for
253 cherry picking, reverting, merging, rebasing, and other common Git
254 operations.")
255 (license gpl3+)))
256
257 \f
258 ;;;
259 ;;; Web browsing.
260 ;;;
261
262 (define-public emacs-w3m
263 (package
264 (name "emacs-w3m")
265 (version "1.4.483+0.20120614")
266 (source (origin
267 (method url-fetch)
268 (uri (string-append "mirror://debian/pool/main/w/w3m-el/w3m-el_"
269 version ".orig.tar.gz"))
270 (sha256
271 (base32 "0ms181gjavnfk79hhv5xl9llik4c6kj0w3c04kgyif8lcy2sxljx"))))
272 (build-system gnu-build-system)
273 (native-inputs `(("autoconf" ,autoconf)))
274 (inputs `(("w3m" ,w3m)
275 ("imagemagick" ,imagemagick)
276 ("emacs" ,emacs)))
277 (arguments
278 '(#:modules ((guix build gnu-build-system)
279 (guix build utils)
280 (guix build emacs-utils))
281 #:imported-modules ((guix build gnu-build-system)
282 (guix build utils)
283 (guix build emacs-utils))
284 #:configure-flags
285 (let ((out (assoc-ref %outputs "out")))
286 (list (string-append "--with-lispdir="
287 out "/share/emacs/site-lisp")
288 (string-append "--with-icondir="
289 out "/share/images/emacs-w3m")))
290 #:tests? #f ; no check target
291 #:phases
292 (alist-cons-before
293 'configure 'pre-configure
294 (lambda _
295 (zero? (system* "autoconf")))
296 (alist-cons-before
297 'build 'patch-exec-paths
298 (lambda* (#:key inputs outputs #:allow-other-keys)
299 (let ((out (assoc-ref outputs "out"))
300 (w3m (assoc-ref inputs "w3m"))
301 (imagemagick (assoc-ref inputs "imagemagick"))
302 (coreutils (assoc-ref inputs "coreutils")))
303 (emacs-substitute-variables "w3m.el"
304 ("w3m-command" (string-append w3m "/bin/w3m"))
305 ("w3m-touch-command" (string-append coreutils "/bin/touch"))
306 ("w3m-image-viewer" (string-append imagemagick "/bin/display"))
307 ("w3m-icon-directory" (string-append out
308 "/share/images/emacs-w3m")))
309 (emacs-substitute-variables "w3m-image.el"
310 ("w3m-imagick-convert-program" (string-append imagemagick
311 "/bin/convert"))
312 ("w3m-imagick-identify-program" (string-append imagemagick
313 "/bin/identify")))
314 #t))
315 (alist-replace
316 'install
317 (lambda* (#:key outputs #:allow-other-keys)
318 (and (zero? (system* "make" "install" "install-icons"))
319 (with-directory-excursion
320 (string-append (assoc-ref outputs "out")
321 "/share/emacs/site-lisp")
322 (for-each delete-file '("ChangeLog" "ChangeLog.1"))
323 #t)))
324 %standard-phases)))))
325 (home-page "http://emacs-w3m.namazu.org/")
326 (synopsis "Simple Web browser for Emacs based on w3m")
327 (description
328 "emacs-w3m is an emacs interface for the w3m web browser.")
329 (license gpl2+)))
330
331 (define-public emacs-wget
332 (package
333 (name "emacs-wget")
334 (version "0.5.0")
335 (source (origin
336 (method url-fetch)
337 (uri (string-append "mirror://debian/pool/main/w/wget-el/wget-el_"
338 version ".orig.tar.gz"))
339 (sha256
340 (base32 "10byvyv9dk0ib55gfqm7bcpxmx2qbih1jd03gmihrppr2mn52nff"))))
341 (build-system gnu-build-system)
342 (inputs `(("wget" ,wget)
343 ("emacs" ,emacs)))
344 (arguments
345 '(#:modules ((guix build gnu-build-system)
346 (guix build utils)
347 (guix build emacs-utils))
348 #:imported-modules ((guix build gnu-build-system)
349 (guix build utils)
350 (guix build emacs-utils))
351 #:tests? #f ; no check target
352 #:phases
353 (alist-replace
354 'configure
355 (lambda* (#:key outputs #:allow-other-keys)
356 (substitute* "Makefile"
357 (("/usr/local") (assoc-ref outputs "out"))
358 (("/site-lisp/emacs-wget") "/site-lisp")))
359 (alist-cons-before
360 'build 'patch-exec-paths
361 (lambda* (#:key inputs outputs #:allow-other-keys)
362 (let ((wget (assoc-ref inputs "wget")))
363 (emacs-substitute-variables "wget.el"
364 ("wget-command" (string-append wget "/bin/wget")))))
365 %standard-phases))))
366 (home-page "http://www.emacswiki.org/emacs/EmacsWget")
367 (synopsis "Simple file downloader for Emacs based on wget")
368 (description
369 "emacs-wget is an emacs interface for the wget file downloader.")
370 (license gpl2+)))