projects/guix·blob javascript-team · refs

347 lines · 14.4 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2021 宋文武 <[email protected]>
3;;; Copyright © 2023 Antero Mejr <[email protected]>
4;;; Copyright © 2025, 2026 Ashish SHUKLA <[email protected]>
5;;;
6;;; This file is part of GNU Guix.
7;;;
8;;; GNU Guix is free software; you can redistribute it and/or modify it
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;;;
13;;; GNU Guix is distributed in the hope that it will be useful, but
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
19;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
20
21(define-module (gnu packages plan9)
22 #:use-module (guix build-system gnu)
23 #:use-module (guix git-download)
24 #:use-module (guix packages)
25 #:use-module (guix gexp)
26 #:use-module (guix utils)
27 #:use-module ((guix licenses) #:prefix license:)
28 #:use-module (gnu packages admin)
29 #:use-module (gnu packages autotools)
30 #:use-module (gnu packages base)
31 #:use-module (gnu packages bash)
32 #:use-module (gnu packages fontutils)
33 #:use-module (gnu packages freedesktop)
34 #:use-module (gnu packages linux)
35 #:use-module (gnu packages lua)
36 #:use-module (gnu packages ncurses)
37 #:use-module (gnu packages tls)
38 #:use-module (gnu packages perl)
39 #:use-module (gnu packages pkg-config)
40 #:use-module (gnu packages xdisorg)
41 #:use-module (gnu packages xorg))
42
43(define-public 9pfs
44 (package
45 (name "9pfs")
46 (version "0.6")
47 (source
48 (origin
49 (method git-fetch)
50 (uri (git-reference
51 (url "https://github.com/ftrvxmtrx/9pfs")
52 (commit version)))
53 (file-name (git-file-name name version))
54 (sha256
55 (base32 "0qsy4dmiyh0xkdagb20lik9wmg8npvwf0xpv12ba2kp78zjlg7fc"))))
56 (build-system gnu-build-system)
57 (arguments
58 (list #:tests? #f ;no tests
59 #:phases
60 #~(modify-phases %standard-phases
61 (delete 'configure)) ;no configure script
62 #:make-flags
63 #~(list
64 "DESTDIR="
65 (string-append "CC=" #$(cc-for-target))
66 (string-append "PREFIX=" (assoc-ref %outputs "out")))))
67 (native-inputs
68 (list pkg-config))
69 (inputs
70 (list fuse-2))
71 (synopsis "Mounts a 9P server's files into the file system")
72 (home-page "https://github.com/ftrvxmtrx/9pfs")
73 (description
74 "@command{9pfs} mounts a file system using the @acronym{9P protocol, Plan 9
75Filesystem Protocol}. It is a replacement for @command{9pfuse} from
76@code{plan9port}.")
77 (license (list license:isc license:expat))))
78
79(define-public diod
80 (package
81 (name "diod")
82 (version "1.1.0")
83 (source
84 (origin
85 (method git-fetch)
86 (uri (git-reference
87 (url "https://github.com/chaos/diod")
88 (commit (string-append "v" version))))
89 (file-name (git-file-name name version))
90 (sha256
91 (base32 "19b0di3pcxxkmjl972vrkynqcys84rlh8mlrf609r2ir1jzalgqp"))))
92 (build-system gnu-build-system)
93 (arguments
94 (list #:phases #~(modify-phases %standard-phases
95 (add-before 'bootstrap 'fix-version
96 (lambda _
97 (substitute* "configure.ac"
98 (("m4_esyscmd\\(.*?\\)") "[master])\n"))))
99 (add-after 'unpack 'patch-tests
100 (lambda _
101 (substitute* "src/libnpclient/test/simple.c"
102 (("^.*npc_attach aname=ctl uid=0 works.*$")
103 "done_testing(); return 0;\n"))
104 (substitute* "src/cmd/test/diodrun.c"
105 (("/bin/sh")
106 (which "sh")))
107 (substitute* "t/t0000-sharness.t"
108 (("!/bin/sh")
109 (string-append "!" (which "sh")))
110 (("/bin/true")
111 (which "true")))
112 ;; replace which with POSIX "command -v"
113 (substitute* (find-files "t" "\\.(t|sh)$")
114 (("[$][(]which")
115 "$(command -v")))))))
116 (native-inputs
117 (list autoconf automake pkg-config))
118 (inputs
119 (list libcap lua munge ncurses))
120 (home-page "https://github.com/chaos/diod")
121 (synopsis "Distributed I/O daemon, a 9P file server")
122 (description
123 "Diod is a multi-threaded, user space file server that speaks 9P2000.L
124protocol.")
125 (license license:gpl2+)))
126
127(define-public drawterm
128 (let ((revision "4")
129 (commit "64dcc2432d85a0bdf64bb706be8787042beb8db6"))
130 (package
131 (name "drawterm")
132 (version (git-version "20260912" revision commit))
133 (source
134 (origin
135 (method git-fetch)
136 (uri (git-reference
137 (url "git://git.9front.org/plan9front/drawterm")
138 (commit commit)))
139 (file-name (git-file-name name version))
140 (sha256
141 (base32 "0wds8m0w2gcka91vhqkk481yq3as0racyccvw6fix109gkzjvlak"))))
142 (build-system gnu-build-system)
143 (arguments
144 `(#:make-flags (list "CONF=unix"
145 (string-append "CC=" ,(cc-for-target)))
146 #:tests? #f ; no tests
147 #:phases
148 (modify-phases %standard-phases
149 (delete 'configure) ; no configure script
150 (replace 'install ; no install target
151 (lambda* (#:key outputs #:allow-other-keys)
152 (let* ((out (assoc-ref outputs "out"))
153 (bin (string-append out "/bin/"))
154 (man (string-append out "/share/man/man1/")))
155 (install-file "drawterm" bin)
156 (install-file "drawterm.1" man)))))))
157 (inputs
158 (list libx11 libxt))
159 (synopsis "Connect to Plan 9 systems")
160 (home-page "https://drawterm.9front.org")
161 (description
162 "@command{drawterm} is a client for connecting venerable systems to
163Plan 9 systems. It behaves like a Plan 9 kernel and will attempt to
164reconstruct a Plan 9 terminal-like experience from a non-Plan 9 system.")
165 (license license:expat))))
166
167(define-public drawterm-wayland
168 (package
169 (inherit drawterm)
170 (name "drawterm-wayland")
171 (arguments
172 (substitute-keyword-arguments arguments
173 ((#:make-flags _)
174 `(list "CONF=linux"
175 ,(string-append "CC=" (cc-for-target))))))
176 (native-inputs
177 (list pkg-config))
178 (inputs
179 (list libdecor libxkbcommon pipewire wayland wayland-protocols wlr-protocols))))
180
181(define-public plan9port
182 ;; no releases
183 (let ((commit "b379c7cc9dd9a810a9873d444e9742fcad3f5997")
184 (revision "2"))
185 (package
186 (name "plan9port")
187 (version (git-version "0.1.0" revision commit))
188 (source (origin
189 (method git-fetch)
190 (uri (git-reference
191 (url "https://github.com/9fans/plan9port")
192 (commit commit)))
193 (file-name (git-file-name name version))
194 (sha256
195 (base32
196 "0mvchnbk9kywm9fsw0cb621g435kav4sd1facb71v0jy7xwzw1fz"))
197 (modules '((guix build utils)))
198 (snippet #~(for-each delete-file-recursively
199 '("font/luc" ;nonfree
200 "font/lucm" "font/lucsans" "font/pelm")))))
201 (build-system gnu-build-system)
202 (arguments
203 (list #:tests? #f ;no tests
204 #:strip-directories #~'("plan9/bin")
205 #:phases
206 #~(modify-phases %standard-phases
207 (add-after 'unpack 'setup
208 (lambda _
209 (let ((dest (string-append #$output "/plan9")))
210 (substitute* "INSTALL"
211 ;; Pass the check for freetype to install fontsrv.
212 (("\\[ -f a\\.out ]") "true"))
213 (delete-file "src/cmd/mk/mk.pdf")
214 ;; TODO: substitute font in src/cmd/venti/srv/graph.c
215 (substitute* "src/cmd/acme/acme.c"
216 (("lucsans/euro.8.font")
217 "fixed/unicode.8x13.font")
218 (("lucm/unicode.9.font")
219 "fixed/unicode.9x15B.font"))
220 (substitute* "src/cmd/mnihongo/mnihongo.c"
221 (("pelm/unicode.9x24.font")
222 "fixed/unicode.10x20.font"))
223 (substitute* "src/cmd/rio/winwatch.c"
224 (("lucsans/unicode.8.font")
225 "fixed/unicode.8x13.font"))
226 (substitute* "src/cmd/draw/stats.c"
227 (("pelm/latin1.8.font")
228 "fixed/unicode.8x13.font"))
229 (substitute* "src/cmd/faces/main.c"
230 (("pelm/latin1.8.font")
231 "fixed/unicode.8x13.font"))
232 (substitute* "src/cmd/fossil/view.c"
233 (("lucsans/unicode.8.font")
234 "fixed/unicode.8x13.font")
235 (("lucidasans/unicode.8.font")
236 "fixed/unicode.8x13.font"))
237 (substitute* "src/cmd/scat/plot.c"
238 (("luc/unicode.6.font")
239 "fixed/unicode.6x9.font"))
240 (substitute* "bin/9c"
241 (("[$][(]which uniq[)]")
242 "uniq"))
243 (substitute* "src/cmd/fontsrv/freetyperules.sh"
244 (("'\\$i'/freetype2")
245 (string-append "-I"
246 #$freetype
247 "/include/freetype2")))
248 (with-output-to-file "LOCAL.config"
249 (lambda _
250 (format #t "CC9=~a~%" #$(cc-for-target))))
251 (setenv "X11" #$libx11)
252 (setenv "PLAN9" (getcwd))
253 (setenv "PLAN9_TARGET" dest))))
254 (delete 'configure) ;no configure
255 (replace 'build
256 (lambda _
257 (invoke "./INSTALL" "-b")))
258 (replace 'install
259 (lambda _
260 (invoke "./INSTALL" "-c")
261 (let ((dest (getenv "PLAN9_TARGET")))
262 (for-each (lambda (x)
263 (let ((out (string-append dest "/" x)))
264 (mkdir-p out)
265 (copy-recursively x out)))
266 ;; TODO: use external sky and dict packages
267 '("bin" "face"
268 "font"
269 "include"
270 "lib"
271 "lp"
272 "mail"
273 "man"
274 "ndb"
275 "plumb"
276 "tmac"
277 "troff"
278 "postscript"))
279 (install-file "rcmain" dest)
280 (install-file "config" dest)
281 (mkdir-p (string-append #$output "/bin"))
282 (symlink (string-append dest "/bin/9")
283 (string-append #$output "/bin/9")))))
284 ;; Plan9 doesn't compress man pages
285 (delete 'compress-documentation))))
286 (native-inputs (list perl which))
287 (inputs (list bash-minimal ;for 'wrap-program'
288 fontconfig libx11 libxext libxt))
289 ;; Propagate gcc-toolchain because some programs, like the 9c compiler,
290 ;; are just aliased scripts to gcc equivalents.
291 (propagated-inputs (list (module-ref (resolve-interface
292 '(gnu packages commencement))
293 'gcc-toolchain)))
294 (home-page "https://9fans.github.io/plan9port/")
295 (synopsis "Port of many Plan 9 libraries and programs")
296 (description
297 "Plan 9 from User Space (aka plan9port) is a port of many Plan 9
298programs from their native Plan 9 environment to Unix-like operating
299systems.")
300 (license (list license:expat
301 license:zlib))))) ;src/cmd/bzip2
302
303(define-public tlsclient
304 (package
305 (name "tlsclient")
306 (version "1.7")
307 (source (origin
308 (method git-fetch)
309 (uri (git-reference
310 (url "https://git.sr.ht/~moody/tlsclient")
311 (commit (string-append "v" version))))
312 (file-name (git-file-name name version))
313 (sha256
314 (base32
315 "179mdx25zxqbdikigzvna46z8qjbbj2s88adk5mp18h2rip4had0"))))
316 (build-system gnu-build-system)
317 (arguments
318 (list
319 #:make-flags
320 #~(list (string-append "CC=" #$(cc-for-target))
321 (string-append "PREFIX=" #$output)
322 (string-append "SBIN=" #$output "/sbin"))
323 #:tests? #f
324 #:phases
325 #~(modify-phases %standard-phases
326 (delete 'configure)
327 (add-after 'build 'build-other
328 (lambda* (#:key make-flags #:allow-other-keys)
329 (apply invoke "make" "mount.9ptls" "pam" make-flags)))
330 (replace 'install
331 (lambda* (#:key make-flags #:allow-other-keys)
332 (apply invoke "make" "tlsclient.install"
333 "mount.9ptls.install" "pam.install"
334 make-flags))))))
335 (native-inputs
336 (list pkg-config))
337 (inputs
338 (list openssl linux-pam))
339 (home-page "https://sr.ht/~moody/tlsclient/")
340 (synopsis "Port of tlsclient(1) of Plan 9 for Unix")
341 (description
342 "@command{tlsclient} establishes a SSL/TLS session with a remote tlssrv(1)
343server redirecting connection to stdin/stdout of a child command. It's similar
344to @command{openssl s_client}.
345
346This also contains @command{mount.9ptls}, @command{pam_p9.so}.")
347 (license license:expat)))