projects/guix·blob hurd-team · refs

410 lines · 16.1 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2014, 2015 Pjotr Prins <[email protected]>
3;;; Copyright © 2014, 2015 Ludovic Courtès <[email protected]>
4;;; Copyright © 2014, 2015 Mark H Weaver <[email protected]>
5;;; Copyright © 2015-2018 Ben Woodcroft <[email protected]>
6;;; Copyright © 2015 David Thompson <[email protected]>
7;;; Copyright © 2015, 2019 Ricardo Wurmus <[email protected]>
8;;; Copyright © 2018 Danny Milosavljevic <[email protected]>
9;;; Copyright © 2019, 2020 Christopher Baines <[email protected]>
10;;; Copyright © 2019 Jelle Licht <[email protected]>
11;;; Copyright © 2020, 2023 Maxim Cournoyer <[email protected]>
12;;; Copyright © 2020 Ryan Prior <[email protected]>
13;;; Copyright © 2020 Maxim Cournoyer <[email protected]>
14;;; Copyright © 2021 Marius Bakke <[email protected]>
15;;; Copyright © 2023 Christopher Baines <[email protected]>
16;;; Copyright © 2023 Janneke Nieuwenhuizen <[email protected]>
17;;; Copyright © 2023 Zheng Junjie <[email protected]>
18;;; Copyright © 2025 Nicolas Graves <[email protected]>
19;;; Copyright © 2025 Remco van 't Veer <[email protected]>
20;;; Copyright © 2026 gemmaro <[email protected]>
21;;;
22;;; This file is part of GNU Guix.
23;;;
24;;; GNU Guix is free software; you can redistribute it and/or modify it
25;;; under the terms of the GNU General Public License as published by
26;;; the Free Software Foundation; either version 3 of the License, or (at
27;;; your option) any later version.
28;;;
29;;; GNU Guix is distributed in the hope that it will be useful, but
30;;; WITHOUT ANY WARRANTY; without even the implied warranty of
31;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
32;;; GNU General Public License for more details.
33;;;
34;;; You should have received a copy of the GNU General Public License
35;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
36
37(define-module (gnu packages ruby)
38 #:use-module ((guix licenses) #:prefix license:)
39 #:use-module (gnu packages)
40 #:use-module (gnu packages base)
41 #:use-module (gnu packages bison)
42 #:use-module (gnu packages c)
43 #:use-module (gnu packages check)
44 #:use-module (gnu packages compression)
45 #:use-module (gnu packages crypto)
46 #:use-module (gnu packages curl)
47 #:use-module (gnu packages databases)
48 #:use-module (gnu packages dbm)
49 #:use-module (gnu packages freedesktop)
50 #:use-module (gnu packages rails)
51 #:use-module (gnu packages readline)
52 #:use-module (gnu packages autotools)
53 #:use-module (gnu packages graphviz)
54 #:use-module (gnu packages haskell-xyz)
55 #:use-module (gnu packages java)
56 #:use-module (gnu packages libffi)
57 #:use-module (gnu packages libidn)
58 #:use-module (gnu packages linux)
59 #:use-module (gnu packages lsof)
60 #:use-module (gnu packages man)
61 #:use-module (gnu packages maths)
62 #:use-module (gnu packages multiprecision)
63 #:use-module (gnu packages ncurses)
64 #:use-module (gnu packages networking)
65 #:use-module (gnu packages node)
66 #:use-module (gnu packages perl)
67 #:use-module (gnu packages pkg-config)
68 #:use-module (gnu packages protobuf)
69 #:use-module (gnu packages python)
70 #:use-module (gnu packages python-xyz)
71 #:use-module (gnu packages ragel)
72 #:use-module (gnu packages rsync)
73 #:use-module (gnu packages rust)
74 #:use-module (gnu packages sqlite)
75 #:use-module (gnu packages tls)
76 #:use-module (gnu packages valgrind)
77 #:use-module (gnu packages version-control)
78 #:use-module (gnu packages virtualization)
79 #:use-module (gnu packages web-browsers)
80 #:use-module (gnu packages serialization)
81 #:use-module (guix packages)
82 #:use-module (guix download)
83 #:use-module (guix git-download)
84 #:use-module (guix gexp)
85 #:use-module (guix modules)
86 #:use-module (guix utils)
87 #:use-module (guix build-system gnu)
88 #:use-module (gnu packages xml)
89 #:use-module (gnu packages web)
90 #:use-module (guix build-system ruby))
91
92(define-public ruby-4.0
93 (package
94 (name "ruby")
95 (version "4.0.3")
96 (source
97 (origin
98 (method url-fetch)
99 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
100 (version-major+minor version) "/ruby-" version
101 ".tar.xz"))
102 (sha256
103 (base32 "0abghfkwa5r5c5fvp495w2zvzahs7bb294mybrmlkgjvs82n1kr2"))))
104 (build-system gnu-build-system)
105 (arguments
106 (list
107 #:test-target "test"
108 #:configure-flags (if (%current-target-system)
109 #~(list (string-append "LDFLAGS=-Wl,-rpath="
110 (assoc-ref %outputs "out")
111 "/lib") "--enable-shared")
112 #~'("--enable-shared")) ;dynamic linking
113 #:phases
114 #~(modify-phases %standard-phases
115 (add-before 'configure 'replace-bin-sh-and-remove-libffi
116 (lambda _
117 (substitute* '("configure.ac" "template/Makefile.in"
118 "lib/rubygems/installer.rb"
119 "ext/pty/pty.c"
120 "io.c"
121 "lib/mkmf.rb"
122 "process.c"
123 "test/rubygems/test_gem_ext_configure_builder.rb"
124 "test/ruby/test_rubyoptions.rb"
125 "test/ruby/test_process.rb"
126 "test/ruby/test_system.rb"
127 "tool/rbinstall.rb")
128 (("/bin/sh")
129 (which "sh")))))
130 (add-after 'install 'delete-mkmf.log
131 (lambda _
132 ;; Rubygems installs build log files that embed volatile
133 ;; file names, especially for bigdecimal gem (see:
134 ;; https://github.com/rubygems/rubygems/issues/6259).
135 (for-each delete-file
136 (find-files #$output "^mkmf\\.log$")))))))
137 (native-inputs (append (if (%current-target-system)
138 (list this-package)
139 '())
140 (list autoconf libyaml)))
141 (inputs (list readline
142 openssl-3.0
143 libffi ;to build fiddle
144 gmp ;to accelerate Bignum operations
145 rust)) ;to build YJIT
146 (propagated-inputs (list zlib))
147 (native-search-paths
148 (list (search-path-specification
149 (variable "GEM_PATH")
150 (files (list (string-append "lib/ruby/vendor_ruby"))))))
151 (synopsis "Programming language interpreter")
152 (description "Ruby is a dynamic object-oriented programming language with
153a focus on simplicity and productivity.")
154 (home-page "https://www.ruby-lang.org")
155 (license license:ruby)))
156
157(define-public ruby-3.4
158 (package
159 (name "ruby")
160 (version "3.4.7")
161 (source
162 (origin
163 (method url-fetch)
164 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
165 (version-major+minor version)
166 "/ruby-" version ".tar.xz"))
167 (sha256
168 (base32
169 "1irh0l7g75p0arnah58ismzixa80qxn99x3qfnalcxg0ys35lhnv"))))
170 (build-system gnu-build-system)
171 (arguments
172 `(#:test-target "test"
173 #:configure-flags
174 ,(if (%current-target-system)
175 '(list (string-append
176 "LDFLAGS=-Wl,-rpath="
177 (assoc-ref %outputs "out") "/lib")
178 "--enable-shared")
179 ''("--enable-shared")) ; dynamic linking
180 #:phases
181 (modify-phases %standard-phases
182 (add-before 'configure 'replace-bin-sh-and-remove-libffi
183 (lambda _
184 (substitute* '("configure.ac"
185 "template/Makefile.in"
186 "lib/rubygems/installer.rb"
187 "ext/pty/pty.c"
188 "io.c"
189 "lib/mkmf.rb"
190 "process.c"
191 "test/rubygems/test_gem_ext_configure_builder.rb"
192 "test/rdoc/rdoc_parser_test.rb"
193 "test/ruby/test_rubyoptions.rb"
194 "test/ruby/test_process.rb"
195 "test/ruby/test_system.rb"
196 "tool/rbinstall.rb")
197 (("/bin/sh") (which "sh"))))))))
198 (native-inputs
199 (append (if (%current-target-system)
200 (list this-package)
201 '())
202 (list autoconf libyaml)))
203 (inputs
204 (list readline openssl-1.1 libffi gdbm))
205 (propagated-inputs
206 (list zlib))
207 (native-search-paths
208 (list (search-path-specification
209 (variable "GEM_PATH")
210 (files (list (string-append "lib/ruby/vendor_ruby"))))))
211 (synopsis "Programming language interpreter")
212 (description "Ruby is a dynamic object-oriented programming language with
213a focus on simplicity and productivity.")
214 (home-page "https://www.ruby-lang.org")
215 (license license:ruby)))
216
217(define-public ruby-3.3
218 (package
219 (name "ruby")
220 (version "3.3.9")
221 (source
222 (origin
223 (method url-fetch)
224 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
225 (version-major+minor version)
226 "/ruby-" version ".tar.xz"))
227 (sha256
228 (base32
229 "1fvng8x44x90pn8nl4sxa5nzb34jwq0is6l5k7066zrg18ca491b"))))
230 (build-system gnu-build-system)
231 (arguments
232 `(#:test-target "test"
233 #:configure-flags
234 ,(if (%current-target-system)
235 '(list (string-append
236 "LDFLAGS=-Wl,-rpath="
237 (assoc-ref %outputs "out") "/lib")
238 "--enable-shared")
239 ''("--enable-shared")) ; dynamic linking
240 #:phases
241 (modify-phases %standard-phases
242 (add-before 'configure 'replace-bin-sh-and-remove-libffi
243 (lambda _
244 (substitute* '("configure.ac"
245 "template/Makefile.in"
246 "lib/rubygems/installer.rb"
247 "ext/pty/pty.c"
248 "io.c"
249 "lib/mkmf.rb"
250 "process.c"
251 "test/rubygems/test_gem_ext_configure_builder.rb"
252 "test/rdoc/test_rdoc_parser.rb"
253 "test/ruby/test_rubyoptions.rb"
254 "test/ruby/test_process.rb"
255 "test/ruby/test_system.rb"
256 "tool/rbinstall.rb")
257 (("/bin/sh") (which "sh"))))))))
258 (native-inputs
259 (append (if (%current-target-system)
260 (list this-package)
261 '())
262 (list autoconf libyaml)))
263 (inputs
264 (list readline openssl-1.1 libffi gdbm))
265 (propagated-inputs
266 (list zlib))
267 (native-search-paths
268 (list (search-path-specification
269 (variable "GEM_PATH")
270 (files (list (string-append "lib/ruby/vendor_ruby"))))))
271 (synopsis "Programming language interpreter")
272 (description "Ruby is a dynamic object-oriented programming language with
273a focus on simplicity and productivity.")
274 (home-page "https://www.ruby-lang.org")
275 (license license:ruby)))
276
277(define-public ruby-2.7
278 (package
279 (name "ruby")
280 (version "2.7.8")
281 (source
282 (origin
283 (method url-fetch)
284 (uri (string-append "https://cache.ruby-lang.org/pub/ruby/"
285 (version-major+minor version)
286 "/ruby-" version ".tar.gz"))
287 (sha256
288 (base32
289 "182vni66djmiqagwzfsd0za7x9k3zag43b88c590aalgphybdnn2"))
290 (modules '((guix build utils)))
291 (snippet `(begin
292 ;; Remove bundled libffi
293 (delete-file-recursively "ext/fiddle/libffi-3.2.1")
294 #t))))
295 (build-system gnu-build-system)
296 (arguments
297 `(#:test-target "test"
298 #:configure-flags
299 ,(if (%current-target-system)
300 '(list (string-append
301 "LDFLAGS=-Wl,-rpath="
302 (assoc-ref %outputs "out") "/lib")
303 "--enable-shared")
304 ''("--enable-shared")) ; dynamic linking
305 #:phases
306 (modify-phases %standard-phases
307 (add-before 'configure 'replace-bin-sh-and-remove-libffi
308 (lambda _
309 (substitute* '("configure.ac"
310 "template/Makefile.in"
311 "lib/rubygems/installer.rb"
312 "ext/pty/pty.c"
313 "io.c"
314 "lib/mkmf.rb"
315 "process.c"
316 "test/rubygems/test_gem_ext_configure_builder.rb"
317 "test/rdoc/test_rdoc_parser.rb"
318 "test/ruby/test_rubyoptions.rb"
319 "test/ruby/test_process.rb"
320 "test/ruby/test_system.rb"
321 "tool/rbinstall.rb")
322 (("/bin/sh") (which "sh")))
323 #t))
324 ,@(if (system-hurd?)
325 '((add-after 'unpack 'skip-tests
326 (lambda _
327 (delete-file "bootstraptest/test_io.rb")
328 (delete-file "test/ruby/test_io.rb"))))
329 '()))))
330 (native-inputs
331 (append (if (%current-target-system)
332 (list this-package)
333 '())
334 (list autoconf)))
335 (inputs
336 (list readline openssl-1.1 libffi gdbm))
337 (propagated-inputs
338 (list zlib))
339 (native-search-paths
340 (list (search-path-specification
341 (variable "GEM_PATH")
342 (files (list (string-append "lib/ruby/vendor_ruby"))))))
343 (synopsis "Programming language interpreter")
344 (description "Ruby is a dynamic object-oriented programming language with
345a focus on simplicity and productivity.")
346 (home-page "https://www.ruby-lang.org")
347 (license license:ruby)))
348
349(define-public ruby ruby-3.3)
350
351(define-public mruby
352 (package
353 (name "mruby")
354 (version "3.3.0")
355 (source
356 (origin
357 (method git-fetch)
358 (uri (git-reference
359 (url "https://github.com/mruby/mruby")
360 (commit version)))
361 (file-name (git-file-name name version))
362 (sha256
363 (base32
364 "0zynr6dk0zxdip53il0qr0rhyzmjicpkxs63l77acpx8b05h8amc"))))
365 (build-system gnu-build-system)
366 (arguments
367 `(#:test-target "test"
368 #:phases
369 (modify-phases %standard-phases
370 (delete 'configure)
371 (add-after 'unpack 'enable-verbose-tests
372 (lambda _
373 (substitute* "Makefile"
374 (("ruby ./minirake" m)
375 (string-append m " --verbose")))))
376 (add-after 'unpack 'disable-broken-tests
377 (lambda _
378 (substitute* "mrbgems/mruby-io/test/io.rb"
379 (("assert\\('IO.popen.+$" m)
380 (string-append m "skip \"Hangs in the Guix build environment\"\n"))
381 ;; This one is really weird. The *expected* output is all wrong.
382 (("assert\\('`cmd`.*" m)
383 (string-append m "skip \"Disable for Guix\"\n")))))
384 ;; There is no install target
385 (replace 'install
386 (lambda* (#:key outputs #:allow-other-keys)
387 (let* ((out (assoc-ref outputs "out"))
388 (bin (string-append out "/bin"))
389 (lib (string-append out "/lib"))
390 (inc (string-append out "/include")))
391 (mkdir-p bin)
392 (copy-recursively "build/host/bin" bin)
393 (mkdir-p lib)
394 (copy-recursively "build/host/lib" lib)
395 (mkdir-p inc)
396 (copy-recursively "include" inc)))))))
397 (native-inputs
398 (list ruby bison))
399 (home-page "https://github.com/mruby/mruby")
400 (synopsis "Lightweight Ruby")
401 (description "mruby is the lightweight implementation of the Ruby
402language. Its syntax is Ruby 3.x compatible except for pattern
403matching. mruby can be linked and embedded within your application.")
404 (license license:expat)))
405
406;;;
407;;; Avoid adding new packages to the end of this file. To reduce the chances
408;;; of a merge conflict, place them above by existing packages with similar
409;;; functionality or similar names.
410;;;