projects/guix·blob ruby-team · refs

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