projects/guix·blob javascript-team · refs

177 lines · 7.2 KiB

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