gnu: Add itpp.
[jackhill/guix/guix.git] / gnu / packages / zile.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2017 Ludovic Courtès <ludo@gnu.org>
3 ;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
4 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
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 zile)
22 #:use-module (guix licenses)
23 #:use-module (guix download)
24 #:use-module (guix git-download)
25 #:use-module (guix packages)
26 #:use-module (guix utils)
27 #:use-module (guix build-system gnu)
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages bash)
30 #:use-module (gnu packages bdw-gc)
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages gnupg)
33 #:use-module (gnu packages m4)
34 #:use-module (gnu packages man)
35 #:use-module (gnu packages ncurses)
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages version-control))
39
40 (define-public zile
41 (package
42 (name "zile")
43 (version "2.4.13")
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnu/zile/zile-"
47 version ".tar.gz"))
48 (sha256
49 (base32
50 "03mcg0bxkzprlsx8y6h22w924pzx4a9zr7zm3g11j8j3x9lz75f7"))))
51 (build-system gnu-build-system)
52 (arguments
53 '(#:phases
54 (modify-phases %standard-phases
55 (add-before 'configure 'patch-/bin/sh
56 (lambda* (#:key inputs #:allow-other-keys)
57 (let ((bash (assoc-ref inputs "bash")))
58 ;; Refer to the actual shell.
59 (substitute* '("lib/spawni.c" "src/funcs.c")
60 (("/bin/sh")
61 (string-append bash "/bin/sh")))
62 #t))))))
63 (inputs
64 `(("boehm-gc" ,libgc)
65 ("ncurses" ,ncurses)
66 ("bash" ,bash)))
67 (native-inputs
68 `(("perl" ,perl)
69 ("help2man" ,help2man)
70 ("pkg-config" ,pkg-config)))
71 (home-page "https://www.gnu.org/software/zile/")
72 (synopsis "Lightweight Emacs clone")
73 (description
74 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
75 default Emacs configuration, but it carries a much lighter feature set.")
76 (license gpl3+)))
77
78 (define-public zile-on-guile
79 ;; This is a fork of Zile that uses Guile, announced here:
80 ;; <http://lists.gnu.org/archive/html/guile-user/2012-02/msg00033.html>.
81 (let ((commit "fd097811a60e58696d734c35b0eb7da3afc1adb7")
82 (revision "0"))
83 (package
84 (inherit zile)
85 (name "zile-on-guile")
86 (version (string-append (package-version zile)
87 "-" revision "."
88 (string-take commit 7)))
89 (home-page "https://github.com/spk121/zile")
90 (source (origin
91 (method git-fetch)
92 (uri (git-reference
93 (url home-page)
94 (commit commit)
95 (recursive? #t))) ;for the Gnulib sub-module
96 (sha256
97 (base32
98 "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
99 (file-name (string-append name "-" version "-checkout"))))
100 (inputs
101 `(("guile" ,guile-2.0)
102 ,@(package-inputs zile)))
103 (native-inputs
104 `(("m4" ,m4) ;for 'bootstrap'
105 ("autoconf" ,(autoconf-wrapper))
106 ("automake" ,automake)
107
108 ;; For some reason, 'bootstrap' insists on having these.
109 ("git" ,git)
110 ("gpg" ,gnupg)
111
112 ,@(package-native-inputs zile)))
113 (arguments
114 (substitute-keyword-arguments (package-arguments zile)
115 ((#:phases phases)
116 `(modify-phases ,phases
117 (add-after 'unpack 'bootstrap
118 (lambda _
119 ;; Make sure all the files are writable so that ./bootstrap
120 ;; can proceed.
121 (for-each (lambda (file)
122 (chmod file #o755))
123 (find-files "."))
124 (patch-shebang "gnulib/gnulib-tool")
125 (zero? (system* "sh" "./bootstrap"
126 "--gnulib-srcdir=gnulib"
127 "--skip-git" "--skip-po"
128 "--verbose"))))
129 (add-after 'install 'wrap-command
130 (lambda* (#:key outputs #:allow-other-keys)
131 ;; Add zile.scm to the search path.
132 (let* ((out (assoc-ref outputs "out"))
133 (scheme (dirname
134 (car (find-files out "^zile\\.scm$")))))
135 (wrap-program (string-append out "/bin/zile-on-guile")
136 `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
137 #t)))))))
138 (synopsis "Lightweight clone of the Emacs editor using Guile")
139 (description
140 "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
141 is a variant of Zile that can be extended in Guile Scheme. Hitting
142 @kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
143 interactive functions akin to those of Emacs can be invoked."))))