Merge branch 'master' into core-updates
[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>
fb9821f0 5;;;
233e7676 6;;; This file is part of GNU Guix.
fb9821f0 7;;;
233e7676 8;;; GNU Guix is free software; you can redistribute it and/or modify it
fb9821f0
LC
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;;;
233e7676 13;;; GNU Guix is distributed in the hope that it will be useful, but
fb9821f0
LC
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
233e7676 19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
fb9821f0 20
1ffa7090 21(define-module (gnu packages zile)
4a44e743 22 #:use-module (guix licenses)
fb9821f0 23 #:use-module (guix download)
70c63411 24 #:use-module (guix git-download)
fb9821f0 25 #:use-module (guix packages)
70c63411 26 #:use-module (guix utils)
fb9821f0 27 #:use-module (guix build-system gnu)
70c63411
LC
28 #:use-module (gnu packages autotools)
29 #:use-module (gnu packages bash)
1ffa7090 30 #:use-module (gnu packages bdw-gc)
70c63411
LC
31 #:use-module (gnu packages guile)
32 #:use-module (gnu packages gnupg)
33 #:use-module (gnu packages m4)
cb3da233 34 #:use-module (gnu packages man)
834b5c80 35 #:use-module (gnu packages ncurses)
70c63411
LC
36 #:use-module (gnu packages perl)
37 #:use-module (gnu packages pkg-config)
38 #:use-module (gnu packages version-control))
fb9821f0
LC
39
40(define-public zile
41 (package
42 (name "zile")
9070ca44 43 (version "2.4.14")
834b5c80
LC
44 (source (origin
45 (method url-fetch)
46 (uri (string-append "mirror://gnu/zile/zile-"
47 version ".tar.gz"))
48 (sha256
49 (base32
9070ca44 50 "0x3byaddms8l3g7igx6njycqsq98wgapysdb5c7lhcnajlkp8y3s"))))
fb9821f0 51 (build-system gnu-build-system)
834b5c80 52 (arguments
c11933c9
EF
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))))))
fb9821f0
LC
63 (inputs
64 `(("boehm-gc" ,libgc)
65 ("ncurses" ,ncurses)
834b5c80
LC
66 ("bash" ,bash)))
67 (native-inputs
68 `(("perl" ,perl)
d79ffe0e
EB
69 ("help2man" ,help2man)
70 ("pkg-config" ,pkg-config)))
fa216a4d 71 (home-page "https://www.gnu.org/software/zile/")
35b9e423 72 (synopsis "Lightweight Emacs clone")
fb9821f0 73 (description
79c311b8
LC
74 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
75default Emacs configuration, but it carries a much lighter feature set.")
4a44e743 76 (license gpl3+)))
70c63411
LC
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'
464f5447 105 ("autoconf" ,autoconf-wrapper)
70c63411
LC
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
189be331 117 (replace 'bootstrap
70c63411
LC
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
141is 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
143interactive functions akin to those of Emacs can be invoked."))))