gnu: Add cl-ana.statistical-learning.
[jackhill/guix/guix.git] / gnu / packages / zile.scm
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 Tobias Geerinckx-Rice <me@tobias.gr>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages zile)
23 #:use-module (guix licenses)
24 #:use-module (guix download)
25 #:use-module (guix git-download)
26 #:use-module (guix packages)
27 #:use-module (guix utils)
28 #:use-module (guix build-system gnu)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages bash)
31 #:use-module (gnu packages bdw-gc)
32 #:use-module (gnu packages guile)
33 #:use-module (gnu packages gnupg)
34 #:use-module (gnu packages m4)
35 #:use-module (gnu packages man)
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages perl)
38 #:use-module (gnu packages pkg-config)
39 #:use-module (gnu packages version-control))
40
41 (define-public zile
42 (package
43 (name "zile")
44 (version "2.4.14")
45 (source (origin
46 (method url-fetch)
47 (uri (string-append "mirror://gnu/zile/zile-"
48 version ".tar.gz"))
49 (sha256
50 (base32
51 "0x3byaddms8l3g7igx6njycqsq98wgapysdb5c7lhcnajlkp8y3s"))))
52 (build-system gnu-build-system)
53 (arguments
54 '(#:phases
55 (modify-phases %standard-phases
56 (add-before 'configure 'patch-/bin/sh
57 (lambda* (#:key inputs #:allow-other-keys)
58 (let ((bash (assoc-ref inputs "bash")))
59 ;; Refer to the actual shell.
60 (substitute* '("lib/spawni.c" "src/funcs.c")
61 (("/bin/sh")
62 (string-append bash "/bin/sh")))
63 #t))))))
64 (inputs
65 `(("boehm-gc" ,libgc)
66 ("ncurses" ,ncurses)
67 ("bash" ,bash)))
68 (native-inputs
69 `(("perl" ,perl)
70 ("help2man" ,help2man)
71 ("pkg-config" ,pkg-config)))
72 (home-page "https://www.gnu.org/software/zile/")
73 (synopsis "Lightweight Emacs clone")
74 (description
75 "GNU Zile is a lightweight Emacs clone. It usage is similar to the
76 default Emacs configuration, but it carries a much lighter feature set.")
77 (license gpl3+)))
78
79 (define-public zile-on-guile
80 ;; This is a fork of Zile that uses Guile, announced here:
81 ;; <http://lists.gnu.org/archive/html/guile-user/2012-02/msg00033.html>.
82 (let ((commit "fd097811a60e58696d734c35b0eb7da3afc1adb7")
83 (revision "0"))
84 (package
85 (inherit zile)
86 (name "zile-on-guile")
87 (version (string-append (package-version zile)
88 "-" revision "."
89 (string-take commit 7)))
90 (home-page "https://github.com/spk121/zile")
91 (source (origin
92 (method git-fetch)
93 (uri (git-reference
94 (url home-page)
95 (commit commit)
96 (recursive? #t))) ;for the Gnulib sub-module
97 (sha256
98 (base32
99 "0wlli8hqal9ikmbl3a49kyhzyf164jk6mdbir3bclq2gxszs532d"))
100 (file-name (string-append name "-" version "-checkout"))))
101 (inputs
102 `(("guile" ,guile-2.0)
103 ,@(package-inputs zile)))
104 (native-inputs
105 `(("m4" ,m4) ;for 'bootstrap'
106 ("autoconf" ,autoconf-wrapper)
107 ("automake" ,automake)
108
109 ;; For some reason, 'bootstrap' insists on having these.
110 ("git" ,git)
111 ("gpg" ,gnupg)
112
113 ,@(package-native-inputs zile)))
114 (arguments
115 (substitute-keyword-arguments (package-arguments zile)
116 ((#:phases phases)
117 `(modify-phases ,phases
118 (replace 'bootstrap
119 (lambda _
120 ;; Make sure all the files are writable so that ./bootstrap
121 ;; can proceed.
122 (for-each (lambda (file)
123 (chmod file #o755))
124 (find-files "."))
125 (patch-shebang "gnulib/gnulib-tool")
126 (invoke "sh" "./bootstrap"
127 "--gnulib-srcdir=gnulib"
128 "--skip-git" "--skip-po"
129 "--verbose")))
130 (add-after 'install 'wrap-command
131 (lambda* (#:key outputs #:allow-other-keys)
132 ;; Add zile.scm to the search path.
133 (let* ((out (assoc-ref outputs "out"))
134 (scheme (dirname
135 (car (find-files out "^zile\\.scm$")))))
136 (wrap-program (string-append out "/bin/zile-on-guile")
137 `("GUILE_LOAD_PATH" ":" prefix (,scheme)))
138 #t)))))))
139 (synopsis "Lightweight clone of the Emacs editor using Guile")
140 (description
141 "GNU Zile is a lightweight clone of the Emacs editor, and Zile-on-Guile
142 is a variant of Zile that can be extended in Guile Scheme. Hitting
143 @kbd{M-C} (or: @kbd{Alt} and @kbd{C}) brings up a Guile REPL from which
144 interactive functions akin to those of Emacs can be invoked."))))