gnu: emacs-svg-icon: Fix grammar.
[jackhill/guix/guix.git] / gnu / packages / zile.scm
CommitLineData
233e7676 1;;; GNU Guix --- Functional package management for GNU
189be331 2;;; Copyright © 2012, 2013, 2017, 2018 Ludovic Courtès <ludo@gnu.org>
d79ffe0e 3;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
c11933c9 4;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
afe02a6d 5;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
805ac43c 6;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
fb9821f0 7;;;
233e7676 8;;; This file is part of GNU Guix.
fb9821f0 9;;;
233e7676 10;;; GNU Guix is free software; you can redistribute it and/or modify it
fb9821f0
LC
11;;; under the terms of the GNU General Public License as published by
12;;; the Free Software Foundation; either version 3 of the License, or (at
13;;; your option) any later version.
14;;;
233e7676 15;;; GNU Guix is distributed in the hope that it will be useful, but
fb9821f0
LC
16;;; WITHOUT ANY WARRANTY; without even the implied warranty of
17;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18;;; GNU General Public License for more details.
19;;;
20;;; You should have received a copy of the GNU General Public License
233e7676 21;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fb9821f0 22
1ffa7090 23(define-module (gnu packages zile)
4a44e743 24 #:use-module (guix licenses)
fb9821f0 25 #:use-module (guix download)
70c63411 26 #:use-module (guix git-download)
fb9821f0 27 #:use-module (guix packages)
70c63411 28 #:use-module (guix utils)
fb9821f0 29 #:use-module (guix build-system gnu)
70c63411
LC
30 #:use-module (gnu packages autotools)
31 #:use-module (gnu packages bash)
1ffa7090 32 #:use-module (gnu packages bdw-gc)
70c63411
LC
33 #:use-module (gnu packages guile)
34 #:use-module (gnu packages gnupg)
35 #:use-module (gnu packages m4)
cb3da233 36 #:use-module (gnu packages man)
834b5c80 37 #:use-module (gnu packages ncurses)
70c63411
LC
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages version-control))
fb9821f0
LC
41
42(define-public zile
43 (package
44 (name "zile")
afe02a6d 45 (version "2.4.15")
834b5c80
LC
46 (source (origin
47 (method url-fetch)
48 (uri (string-append "mirror://gnu/zile/zile-"
49 version ".tar.gz"))
50 (sha256
51 (base32
afe02a6d 52 "0ph3wd0cz3ysdyka6ds2w5l5b89mb5l79kwkfyk7phvq9yih1hrr"))))
fb9821f0 53 (build-system gnu-build-system)
834b5c80 54 (arguments
805ac43c 55 `(#:phases
c11933c9
EF
56 (modify-phases %standard-phases
57 (add-before 'configure 'patch-/bin/sh
58 (lambda* (#:key inputs #:allow-other-keys)
59 (let ((bash (assoc-ref inputs "bash")))
60 ;; Refer to the actual shell.
61 (substitute* '("lib/spawni.c" "src/funcs.c")
62 (("/bin/sh")
63 (string-append bash "/bin/sh")))
805ac43c
MB
64 #t)))
65 ;; Zile generates its manual pages by calling the built Zile
66 ;; with the --help argument. That does not work when cross-
67 ;; compiling; use the native Zile added below in that case.
68 ,@(if (%current-target-system)
69 '((add-before 'build 'use-native-zile-for-documentation
70 (lambda _
71 (substitute* "build-aux/zile-help2man-wrapper"
72 (("src/zile")
73 (which "zile")))
74 #t)))
75 '()))))
fb9821f0
LC
76 (inputs
77 `(("boehm-gc" ,libgc)
78 ("ncurses" ,ncurses)
834b5c80
LC
79 ("bash" ,bash)))
80 (native-inputs
81 `(("perl" ,perl)
d79ffe0e 82 ("help2man" ,help2man)
805ac43c
MB
83 ;; When cross-compiling, Zile needs a native version of itself to
84 ;; generate the manual pages (see the related phase above).
85 ,@(if (%current-target-system)
86 `(("self" ,this-package))
87 '())
d79ffe0e 88 ("pkg-config" ,pkg-config)))
fa216a4d 89 (home-page "https://www.gnu.org/software/zile/")
35b9e423 90 (synopsis "Lightweight Emacs clone")
fb9821f0 91 (description
79c311b8
LC
92 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
93default Emacs configuration, but it carries a much lighter feature set.")
4a44e743 94 (license gpl3+)))
70c63411
LC
95
96(define-public zile-on-guile
97 ;; This is a fork of Zile that uses Guile, announced here:
98 ;; <http://lists.gnu.org/archive/html/guile-user/2012-02/msg00033.html>.
99 (let ((commit "fd097811a60e58696d734c35b0eb7da3afc1adb7")
100 (revision "0"))
101 (package
102 (inherit zile)
103 (name "zile-on-guile")
104 (version (string-append (package-version zile)
105 "-" revision "."
106 (string-take commit 7)))
107 (home-page "https://github.com/spk121/zile")
108 (source (origin
109 (method git-fetch)
110 (uri (git-reference
111 (url home-page)
112 (commit commit)
113 (recursive? #t))) ;for the Gnulib sub-module
114 (sha256
115 (base32
116 "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
117 (file-name (string-append name "-" version "-checkout"))))
118 (inputs
119 `(("guile" ,guile-2.0)
120 ,@(package-inputs zile)))
121 (native-inputs
122 `(("m4" ,m4) ;for 'bootstrap'
ce10e2b3 123 ("autoconf" ,autoconf)
70c63411
LC
124 ("automake" ,automake)
125
126 ;; For some reason, 'bootstrap' insists on having these.
127 ("git" ,git)
128 ("gpg" ,gnupg)
129
130 ,@(package-native-inputs zile)))
131 (arguments
132 (substitute-keyword-arguments (package-arguments zile)
133 ((#:phases phases)
134 `(modify-phases ,phases
189be331 135 (replace 'bootstrap
70c63411
LC
136 (lambda _
137 ;; Make sure all the files are writable so that ./bootstrap
138 ;; can proceed.
139 (for-each (lambda (file)
140 (chmod file #o755))
141 (find-files "."))
142 (patch-shebang "gnulib/gnulib-tool")
a0c5dafc
TGR
143 (invoke "sh" "./bootstrap"
144 "--gnulib-srcdir=gnulib"
145 "--skip-git" "--skip-po"
146 "--verbose")))
70c63411
LC
147 (add-after 'install 'wrap-command
148 (lambda* (#:key outputs #:allow-other-keys)
149 ;; Add zile.scm to the search path.
150 (let* ((out (assoc-ref outputs "out"))
151 (scheme (dirname
152 (car (find-files out "^zile\\.scm$")))))
153 (wrap-program (string-append out "/bin/zile-on-guile")
154 `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
155 #t)))))))
156 (synopsis "Lightweight clone of the Emacs editor using Guile")
157 (description
158 "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
159is a variant of Zile that can be extended in Guile Scheme. Hitting
160@kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
161interactive functions akin to those of Emacs can be invoked."))))