1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2012, 2013, 2017, 2018 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 ;;; Copyright © 2018, 2020 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;; Copyright © 2020 Marius Bakke <mbakke@fastmail.com>
7 ;;; Copyright © 2021 Matthew James Kraai <kraai@ftbfs.org>
9 ;;; This file is part of GNU Guix.
11 ;;; GNU Guix is free software; you can redistribute it and/or modify it
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.
16 ;;; GNU Guix is distributed in the hope that it will be useful, but
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.
21 ;;; You should have received a copy of the GNU General Public License
22 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
24 (define-module (gnu packages zile)
25 #:use-module (guix licenses)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix packages)
29 #:use-module (guix utils)
30 #:use-module (guix build-system gnu)
31 #:use-module (gnu packages autotools)
32 #:use-module (gnu packages bash)
33 #:use-module (gnu packages bdw-gc)
34 #:use-module (gnu packages glib)
35 #:use-module (gnu packages guile)
36 #:use-module (gnu packages gnome)
37 #:use-module (gnu packages gnupg)
38 #:use-module (gnu packages m4)
39 #:use-module (gnu packages man)
40 #:use-module (gnu packages ncurses)
41 #:use-module (gnu packages perl)
42 #:use-module (gnu packages pkg-config)
43 #:use-module (gnu packages version-control))
51 (uri (string-append "mirror://gnu/zile/zile-"
55 "0hf788zadmwx0xp1dhrgqcfvhwnarh6h9b51va4dr2y9yfppvsvp"))))
56 (build-system gnu-build-system)
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.
64 (substitute* '("src/shell.c")
66 (string-append bash "/bin/sh")))
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
74 (substitute* "build-aux/zile-help2man-wrapper"
87 ("help2man" ,help2man)
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))
93 ("pkg-config" ,pkg-config)))
94 (home-page "https://www.gnu.org/software/zile/")
95 (synopsis "Lightweight Emacs clone")
97 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
98 default Emacs configuration, but it carries a much lighter feature set.")
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")
108 (name "zile-on-guile")
109 (version (string-append (package-version zile)
111 (string-take commit 7)))
112 (home-page "https://github.com/spk121/zile")
118 (recursive? #t))) ;for the Gnulib sub-module
121 "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
122 (file-name (string-append name "-" version "-checkout"))))
124 `(("guile" ,guile-2.0)
125 ,@(package-inputs zile)))
127 `(("m4" ,m4) ;for 'bootstrap'
128 ("autoconf" ,autoconf)
129 ("automake" ,automake)
131 ;; For some reason, 'bootstrap' insists on having these.
135 ,@(package-native-inputs zile)))
137 (substitute-keyword-arguments (package-arguments zile)
139 `(modify-phases ,phases
142 ;; Make sure all the files are writable so that ./bootstrap
144 (for-each (lambda (file)
147 (patch-shebang "gnulib/gnulib-tool")
148 (invoke "sh" "./bootstrap"
149 "--gnulib-srcdir=gnulib"
150 "--skip-git" "--skip-po"
152 (add-after 'install 'wrap-command
153 (lambda* (#:key outputs #:allow-other-keys)
154 ;; Add zile.scm to the search path.
155 (let* ((out (assoc-ref outputs "out"))
157 (car (find-files out "^zile\\.scm$")))))
158 (wrap-program (string-append out "/bin/zile-on-guile")
159 `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
161 (synopsis "Lightweight clone of the Emacs editor using Guile")
163 "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
164 is a variant of Zile that can be extended in Guile Scheme. Hitting
165 @kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
166 interactive functions akin to those of Emacs can be invoked."))))