projects/guix·blob dexed · refs

342 lines · 13.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;;;
21;;; This file is part of GNU Guix.
22;;;
23;;; GNU Guix is free software; you can redistribute it and/or modify it
24;;; under the terms of the GNU General Public License as published by
25;;; the Free Software Foundation; either version 3 of the License, or (at
26;;; your option) any later version.
27;;;
28;;; GNU Guix is distributed in the hope that it will be useful, but
29;;; WITHOUT ANY WARRANTY; without even the implied warranty of
30;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
31;;; GNU General Public License for more details.
32;;;
33;;; You should have received a copy of the GNU General Public License
34;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
35
36(define-module (gnu packages ruby)
37 #:use-module ((guix licenses) #:prefix license:)
38 #:use-module (gnu packages)
39 #:use-module (gnu packages base)
40 #:use-module (gnu packages bison)
41 #:use-module (gnu packages c)
42 #:use-module (gnu packages check)
43 #:use-module (gnu packages compression)
44 #:use-module (gnu packages crypto)
45 #:use-module (gnu packages curl)
46 #:use-module (gnu packages databases)
47 #:use-module (gnu packages dbm)
48 #:use-module (gnu packages freedesktop)
49 #:use-module (gnu packages rails)
50 #:use-module (gnu packages readline)
51 #:use-module (gnu packages autotools)
52 #:use-module (gnu packages graphviz)
53 #:use-module (gnu packages haskell-xyz)
54 #:use-module (gnu packages java)
55 #:use-module (gnu packages libffi)
56 #:use-module (gnu packages libidn)
57 #:use-module (gnu packages linux)
58 #:use-module (gnu packages lsof)
59 #:use-module (gnu packages man)
60 #:use-module (gnu packages maths)
61 #:use-module (gnu packages ncurses)
62 #:use-module (gnu packages networking)
63 #:use-module (gnu packages node)
64 #:use-module (gnu packages perl)
65 #:use-module (gnu packages pkg-config)
66 #:use-module (gnu packages protobuf)
67 #:use-module (gnu packages python)
68 #:use-module (gnu packages python-xyz)
69 #:use-module (gnu packages ragel)
70 #:use-module (gnu packages rsync)
71 #:use-module (gnu packages sqlite)
72 #:use-module (gnu packages tls)
73 #:use-module (gnu packages valgrind)
74 #:use-module (gnu packages version-control)
75 #:use-module (gnu packages virtualization)
76 #:use-module (gnu packages web-browsers)
77 #:use-module (gnu packages serialization)
78 #:use-module (guix packages)
79 #:use-module (guix download)
80 #:use-module (guix git-download)
81 #:use-module (guix gexp)
82 #:use-module (guix modules)
83 #:use-module (guix utils)
84 #:use-module (guix build-system gnu)
85 #:use-module (gnu packages xml)
86 #:use-module (gnu packages web)
87 #:use-module (guix build-system ruby))
88
89(define-public ruby-3.4
90 (package
91 (name "ruby")
92 (version "3.4.7")
93 (source
94 (origin
95 (method url-fetch)
96 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
97 (version-major+minor version)
98 "/ruby-" version ".tar.xz"))
99 (sha256
100 (base32
101 "1irh0l7g75p0arnah58ismzixa80qxn99x3qfnalcxg0ys35lhnv"))))
102 (build-system gnu-build-system)
103 (arguments
104 `(#:test-target "test"
105 #:configure-flags
106 ,(if (%current-target-system)
107 '(list (string-append
108 "LDFLAGS=-Wl,-rpath="
109 (assoc-ref %outputs "out") "/lib")
110 "--enable-shared")
111 ''("--enable-shared")) ; dynamic linking
112 #:phases
113 (modify-phases %standard-phases
114 (add-before 'configure 'replace-bin-sh-and-remove-libffi
115 (lambda _
116 (substitute* '("configure.ac"
117 "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/rdoc/rdoc_parser_test.rb"
125 "test/ruby/test_rubyoptions.rb"
126 "test/ruby/test_process.rb"
127 "test/ruby/test_system.rb"
128 "tool/rbinstall.rb")
129 (("/bin/sh") (which "sh"))))))))
130 (native-inputs
131 (append (if (%current-target-system)
132 (list this-package)
133 '())
134 (list autoconf libyaml)))
135 (inputs
136 (list readline openssl-1.1 libffi gdbm))
137 (propagated-inputs
138 (list zlib))
139 (native-search-paths
140 (list (search-path-specification
141 (variable "GEM_PATH")
142 (files (list (string-append "lib/ruby/vendor_ruby"))))))
143 (synopsis "Programming language interpreter")
144 (description "Ruby is a dynamic object-oriented programming language with
145a focus on simplicity and productivity.")
146 (home-page "https://www.ruby-lang.org")
147 (license license:ruby)))
148
149(define-public ruby-3.3
150 (package
151 (name "ruby")
152 (version "3.3.9")
153 (source
154 (origin
155 (method url-fetch)
156 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
157 (version-major+minor version)
158 "/ruby-" version ".tar.xz"))
159 (sha256
160 (base32
161 "1fvng8x44x90pn8nl4sxa5nzb34jwq0is6l5k7066zrg18ca491b"))))
162 (build-system gnu-build-system)
163 (arguments
164 `(#:test-target "test"
165 #:configure-flags
166 ,(if (%current-target-system)
167 '(list (string-append
168 "LDFLAGS=-Wl,-rpath="
169 (assoc-ref %outputs "out") "/lib")
170 "--enable-shared")
171 ''("--enable-shared")) ; dynamic linking
172 #:phases
173 (modify-phases %standard-phases
174 (add-before 'configure 'replace-bin-sh-and-remove-libffi
175 (lambda _
176 (substitute* '("configure.ac"
177 "template/Makefile.in"
178 "lib/rubygems/installer.rb"
179 "ext/pty/pty.c"
180 "io.c"
181 "lib/mkmf.rb"
182 "process.c"
183 "test/rubygems/test_gem_ext_configure_builder.rb"
184 "test/rdoc/test_rdoc_parser.rb"
185 "test/ruby/test_rubyoptions.rb"
186 "test/ruby/test_process.rb"
187 "test/ruby/test_system.rb"
188 "tool/rbinstall.rb")
189 (("/bin/sh") (which "sh"))))))))
190 (native-inputs
191 (append (if (%current-target-system)
192 (list this-package)
193 '())
194 (list autoconf libyaml)))
195 (inputs
196 (list readline openssl-1.1 libffi gdbm))
197 (propagated-inputs
198 (list zlib))
199 (native-search-paths
200 (list (search-path-specification
201 (variable "GEM_PATH")
202 (files (list (string-append "lib/ruby/vendor_ruby"))))))
203 (synopsis "Programming language interpreter")
204 (description "Ruby is a dynamic object-oriented programming language with
205a focus on simplicity and productivity.")
206 (home-page "https://www.ruby-lang.org")
207 (license license:ruby)))
208
209(define-public ruby-2.7
210 (package
211 (name "ruby")
212 (version "2.7.8")
213 (source
214 (origin
215 (method url-fetch)
216 (uri (string-append "https://cache.ruby-lang.org/pub/ruby/"
217 (version-major+minor version)
218 "/ruby-" version ".tar.gz"))
219 (sha256
220 (base32
221 "182vni66djmiqagwzfsd0za7x9k3zag43b88c590aalgphybdnn2"))
222 (modules '((guix build utils)))
223 (snippet `(begin
224 ;; Remove bundled libffi
225 (delete-file-recursively "ext/fiddle/libffi-3.2.1")
226 #t))))
227 (build-system gnu-build-system)
228 (arguments
229 `(#:test-target "test"
230 #:configure-flags
231 ,(if (%current-target-system)
232 '(list (string-append
233 "LDFLAGS=-Wl,-rpath="
234 (assoc-ref %outputs "out") "/lib")
235 "--enable-shared")
236 ''("--enable-shared")) ; dynamic linking
237 #:phases
238 (modify-phases %standard-phases
239 (add-before 'configure 'replace-bin-sh-and-remove-libffi
240 (lambda _
241 (substitute* '("configure.ac"
242 "template/Makefile.in"
243 "lib/rubygems/installer.rb"
244 "ext/pty/pty.c"
245 "io.c"
246 "lib/mkmf.rb"
247 "process.c"
248 "test/rubygems/test_gem_ext_configure_builder.rb"
249 "test/rdoc/test_rdoc_parser.rb"
250 "test/ruby/test_rubyoptions.rb"
251 "test/ruby/test_process.rb"
252 "test/ruby/test_system.rb"
253 "tool/rbinstall.rb")
254 (("/bin/sh") (which "sh")))
255 #t))
256 ,@(if (system-hurd?)
257 '((add-after 'unpack 'skip-tests
258 (lambda _
259 (delete-file "bootstraptest/test_io.rb")
260 (delete-file "test/ruby/test_io.rb"))))
261 '()))))
262 (native-inputs
263 (append (if (%current-target-system)
264 (list this-package)
265 '())
266 (list autoconf)))
267 (inputs
268 (list readline openssl-1.1 libffi gdbm))
269 (propagated-inputs
270 (list zlib))
271 (native-search-paths
272 (list (search-path-specification
273 (variable "GEM_PATH")
274 (files (list (string-append "lib/ruby/vendor_ruby"))))))
275 (synopsis "Programming language interpreter")
276 (description "Ruby is a dynamic object-oriented programming language with
277a focus on simplicity and productivity.")
278 (home-page "https://www.ruby-lang.org")
279 (license license:ruby)))
280
281(define-public ruby ruby-3.3)
282
283(define-public mruby
284 (package
285 (name "mruby")
286 (version "3.3.0")
287 (source
288 (origin
289 (method git-fetch)
290 (uri (git-reference
291 (url "https://github.com/mruby/mruby")
292 (commit version)))
293 (file-name (git-file-name name version))
294 (sha256
295 (base32
296 "0zynr6dk0zxdip53il0qr0rhyzmjicpkxs63l77acpx8b05h8amc"))))
297 (build-system gnu-build-system)
298 (arguments
299 `(#:test-target "test"
300 #:phases
301 (modify-phases %standard-phases
302 (delete 'configure)
303 (add-after 'unpack 'enable-verbose-tests
304 (lambda _
305 (substitute* "Makefile"
306 (("ruby ./minirake" m)
307 (string-append m " --verbose")))))
308 (add-after 'unpack 'disable-broken-tests
309 (lambda _
310 (substitute* "mrbgems/mruby-io/test/io.rb"
311 (("assert\\('IO.popen.+$" m)
312 (string-append m "skip \"Hangs in the Guix build environment\"\n"))
313 ;; This one is really weird. The *expected* output is all wrong.
314 (("assert\\('`cmd`.*" m)
315 (string-append m "skip \"Disable for Guix\"\n")))))
316 ;; There is no install target
317 (replace 'install
318 (lambda* (#:key outputs #:allow-other-keys)
319 (let* ((out (assoc-ref outputs "out"))
320 (bin (string-append out "/bin"))
321 (lib (string-append out "/lib"))
322 (inc (string-append out "/include")))
323 (mkdir-p bin)
324 (copy-recursively "build/host/bin" bin)
325 (mkdir-p lib)
326 (copy-recursively "build/host/lib" lib)
327 (mkdir-p inc)
328 (copy-recursively "include" inc)))))))
329 (native-inputs
330 (list ruby bison))
331 (home-page "https://github.com/mruby/mruby")
332 (synopsis "Lightweight Ruby")
333 (description "mruby is the lightweight implementation of the Ruby
334language. Its syntax is Ruby 3.x compatible except for pattern
335matching. mruby can be linked and embedded within your application.")
336 (license license:expat)))
337
338;;;
339;;; Avoid adding new packages to the end of this file. To reduce the chances
340;;; of a merge conflict, place them above by existing packages with similar
341;;; functionality or similar names.
342;;;