gnu: emacs-scratch-el: Update source and homepage.
[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>
da40d070 7;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
fb9821f0 8;;;
233e7676 9;;; This file is part of GNU Guix.
fb9821f0 10;;;
233e7676 11;;; GNU Guix is free software; you can redistribute it and/or modify it
fb9821f0
LC
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;;;
233e7676 16;;; GNU Guix is distributed in the hope that it will be useful, but
fb9821f0
LC
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
233e7676 22;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fb9821f0 23
1ffa7090 24(define-module (gnu packages zile)
4a44e743 25 #:use-module (guix licenses)
fb9821f0 26 #:use-module (guix download)
70c63411 27 #:use-module (guix git-download)
fb9821f0 28 #:use-module (guix packages)
70c63411 29 #:use-module (guix utils)
fb9821f0 30 #:use-module (guix build-system gnu)
70c63411
LC
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages bash)
1ffa7090 33 #:use-module (gnu packages bdw-gc)
da40d070 34 #:use-module (gnu packages glib)
70c63411 35 #:use-module (gnu packages guile)
da40d070 36 #:use-module (gnu packages gnome)
70c63411
LC
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages m4)
cb3da233 39 #:use-module (gnu packages man)
834b5c80 40 #:use-module (gnu packages ncurses)
70c63411
LC
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages version-control))
fb9821f0
LC
44
45(define-public zile
46 (package
47 (name "zile")
da40d070 48 (version "2.6.2")
834b5c80
LC
49 (source (origin
50 (method url-fetch)
51 (uri (string-append "mirror://gnu/zile/zile-"
52 version ".tar.gz"))
53 (sha256
54 (base32
da40d070 55 "0hf788zadmwx0xp1dhrgqcfvhwnarh6h9b51va4dr2y9yfppvsvp"))))
fb9821f0 56 (build-system gnu-build-system)
834b5c80 57 (arguments
805ac43c 58 `(#:phases
c11933c9
EF
59 (modify-phases %standard-phases
60 (add-before 'configure 'patch-/bin/sh
61 (lambda* (#:key inputs #:allow-other-keys)
62 (let ((bash (assoc-ref inputs "bash")))
63 ;; Refer to the actual shell.
da40d070 64 (substitute* '("src/shell.c")
c11933c9
EF
65 (("/bin/sh")
66 (string-append bash "/bin/sh")))
805ac43c
MB
67 #t)))
68 ;; Zile generates its manual pages by calling the built Zile
69 ;; with the --help argument. That does not work when cross-
70 ;; compiling; use the native Zile added below in that case.
71 ,@(if (%current-target-system)
72 '((add-before 'build 'use-native-zile-for-documentation
73 (lambda _
74 (substitute* "build-aux/zile-help2man-wrapper"
75 (("src/zile")
76 (which "zile")))
77 #t)))
78 '()))))
fb9821f0
LC
79 (inputs
80 `(("boehm-gc" ,libgc)
81 ("ncurses" ,ncurses)
da40d070
MJK
82 ("bash" ,bash)
83 ("gee" ,libgee)
84 ("glib" ,glib)))
834b5c80
LC
85 (native-inputs
86 `(("perl" ,perl)
d79ffe0e 87 ("help2man" ,help2man)
805ac43c
MB
88 ;; When cross-compiling, Zile needs a native version of itself to
89 ;; generate the manual pages (see the related phase above).
90 ,@(if (%current-target-system)
91 `(("self" ,this-package))
92 '())
d79ffe0e 93 ("pkg-config" ,pkg-config)))
fa216a4d 94 (home-page "https://www.gnu.org/software/zile/")
35b9e423 95 (synopsis "Lightweight Emacs clone")
fb9821f0 96 (description
79c311b8
LC
97 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
98default Emacs configuration, but it carries a much lighter feature set.")
4a44e743 99 (license gpl3+)))
70c63411
LC
100
101(define-public zile-on-guile
102 ;; This is a fork of Zile that uses Guile, announced here:
103 ;; <http://lists.gnu.org/archive/html/guile-user/2012-02/msg00033.html>.
104 (let ((commit "fd097811a60e58696d734c35b0eb7da3afc1adb7")
105 (revision "0"))
106 (package
107 (inherit zile)
108 (name "zile-on-guile")
109 (version (string-append (package-version zile)
110 "-" revision "."
111 (string-take commit 7)))
112 (home-page "https://github.com/spk121/zile")
113 (source (origin
114 (method git-fetch)
115 (uri (git-reference
116 (url home-page)
117 (commit commit)
118 (recursive? #t))) ;for the Gnulib sub-module
119 (sha256
120 (base32
121 "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
122 (file-name (string-append name "-" version "-checkout"))))
123 (inputs
8394619b
LC
124 (modify-inputs (package-inputs zile)
125 (prepend guile-2.0)))
70c63411
LC
126 (native-inputs
127 `(("m4" ,m4) ;for 'bootstrap'
ce10e2b3 128 ("autoconf" ,autoconf)
70c63411
LC
129 ("automake" ,automake)
130
131 ;; For some reason, 'bootstrap' insists on having these.
132 ("git" ,git)
133 ("gpg" ,gnupg)
134
135 ,@(package-native-inputs zile)))
136 (arguments
137 (substitute-keyword-arguments (package-arguments zile)
138 ((#:phases phases)
139 `(modify-phases ,phases
189be331 140 (replace 'bootstrap
70c63411
LC
141 (lambda _
142 ;; Make sure all the files are writable so that ./bootstrap
143 ;; can proceed.
144 (for-each (lambda (file)
145 (chmod file #o755))
146 (find-files "."))
147 (patch-shebang "gnulib/gnulib-tool")
a0c5dafc
TGR
148 (invoke "sh" "./bootstrap"
149 "--gnulib-srcdir=gnulib"
150 "--skip-git" "--skip-po"
151 "--verbose")))
beaa5dff
MO
152 (replace 'patch-/bin/sh
153 (lambda* (#:key inputs #:allow-other-keys)
154 (let ((bash (assoc-ref inputs "bash")))
155 ;; Refer to the actual shell.
156 (substitute* '("lib/spawni.c" "src/funcs.c")
157 (("/bin/sh")
158 (string-append bash "/bin/sh")))
159 #t)))
70c63411
LC
160 (add-after 'install 'wrap-command
161 (lambda* (#:key outputs #:allow-other-keys)
162 ;; Add zile.scm to the search path.
163 (let* ((out (assoc-ref outputs "out"))
164 (scheme (dirname
165 (car (find-files out "^zile\\.scm$")))))
166 (wrap-program (string-append out "/bin/zile-on-guile")
167 `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
168 #t)))))))
169 (synopsis "Lightweight clone of the Emacs editor using Guile")
170 (description
171 "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
172is a variant of Zile that can be extended in Guile Scheme. Hitting
173@kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
174interactive functions akin to those of Emacs can be invoked."))))