projects/guix·blob java-team · refs

348 lines · 13.8 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.5")
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 "1rcm13iib4ypmsclrh315r47pch4807ml6qbq5n6wwjcllg55iax"))))
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 #$@(if (system-hurd?)
131 '((add-after 'unpack 'skip-tests
132 (lambda _
133 (delete-file "bootstraptest/test_ractor.rb"))))
134 '())
135 (add-after 'install 'delete-mkmf.log
136 (lambda _
137 ;; Rubygems installs build log files that embed volatile
138 ;; file names, especially for bigdecimal gem (see:
139 ;; https://github.com/rubygems/rubygems/issues/6259).
140 (for-each delete-file
141 (find-files #$output "^mkmf\\.log$")))))))
142 (native-inputs (append (if (%current-target-system)
143 (list this-package)
144 '())
145 (list autoconf libyaml)))
146 (inputs (append (list readline openssl libffi ;to build fiddle
147 gmp) ;to accelerate Bignum operations
148 (if (supported-package? rust)
149 (list rust) ;to build YJIT, ZJIT, and MMTk
150 '())))
151 (propagated-inputs (list zlib))
152 (native-search-paths
153 (list (search-path-specification
154 (variable "GEM_PATH")
155 (files (list (string-append "lib/ruby/vendor_ruby"))))))
156 (synopsis "Programming language interpreter")
157 (description "Ruby is a dynamic object-oriented programming language with
158a focus on simplicity and productivity.")
159 (home-page "https://www.ruby-lang.org")
160 (license license:ruby)))
161
162(define-public ruby-3.4
163 (package
164 (name "ruby")
165 (version "3.4.7")
166 (source
167 (origin
168 (method url-fetch)
169 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
170 (version-major+minor version)
171 "/ruby-" version ".tar.xz"))
172 (sha256
173 (base32
174 "1irh0l7g75p0arnah58ismzixa80qxn99x3qfnalcxg0ys35lhnv"))))
175 (build-system gnu-build-system)
176 (arguments
177 `(#:test-target "test"
178 #:configure-flags
179 ,(if (%current-target-system)
180 '(list (string-append
181 "LDFLAGS=-Wl,-rpath="
182 (assoc-ref %outputs "out") "/lib")
183 "--enable-shared")
184 ''("--enable-shared")) ; dynamic linking
185 #:phases
186 (modify-phases %standard-phases
187 (add-before 'configure 'replace-bin-sh-and-remove-libffi
188 (lambda _
189 (substitute* '("configure.ac"
190 "template/Makefile.in"
191 "lib/rubygems/installer.rb"
192 "ext/pty/pty.c"
193 "io.c"
194 "lib/mkmf.rb"
195 "process.c"
196 "test/rubygems/test_gem_ext_configure_builder.rb"
197 "test/rdoc/rdoc_parser_test.rb"
198 "test/ruby/test_rubyoptions.rb"
199 "test/ruby/test_process.rb"
200 "test/ruby/test_system.rb"
201 "tool/rbinstall.rb")
202 (("/bin/sh") (which "sh")))))
203 ,@(if (system-hurd?)
204 '((add-after 'unpack 'skip-tests
205 (lambda _
206 (delete-file "bootstraptest/test_ractor.rb"))))
207 '()))))
208 (native-inputs
209 (append (if (%current-target-system)
210 (list this-package)
211 '())
212 (list autoconf libyaml)))
213 (inputs
214 (list readline openssl libffi gdbm))
215 (propagated-inputs
216 (list zlib))
217 (native-search-paths
218 (list (search-path-specification
219 (variable "GEM_PATH")
220 (files (list (string-append "lib/ruby/vendor_ruby"))))))
221 (synopsis "Programming language interpreter")
222 (description "Ruby is a dynamic object-oriented programming language with
223a focus on simplicity and productivity.")
224 (home-page "https://www.ruby-lang.org")
225 (license license:ruby)))
226
227(define-public ruby-3.3
228 (package
229 (name "ruby")
230 (version "3.3.12")
231 (source
232 (origin
233 (method url-fetch)
234 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
235 (version-major+minor version)
236 "/ruby-" version ".tar.xz"))
237 (sha256
238 (base32
239 "1cs3lzh5yq1f2vj99izjwms8r8d7lc8fbxinaixgz30bk6bk4gl7"))))
240 (build-system gnu-build-system)
241 (arguments
242 `(#:test-target "test"
243 #:configure-flags
244 ,(if (%current-target-system)
245 '(list (string-append
246 "LDFLAGS=-Wl,-rpath="
247 (assoc-ref %outputs "out") "/lib")
248 "--enable-shared")
249 ''("--enable-shared")) ; dynamic linking
250 #:phases
251 (modify-phases %standard-phases
252 (add-before 'configure 'replace-bin-sh-and-remove-libffi
253 (lambda _
254 (substitute* '("configure.ac"
255 "template/Makefile.in"
256 "lib/rubygems/installer.rb"
257 "ext/pty/pty.c"
258 "io.c"
259 "lib/mkmf.rb"
260 "process.c"
261 "test/rubygems/test_gem_ext_configure_builder.rb"
262 "test/rdoc/test_rdoc_parser.rb"
263 "test/ruby/test_rubyoptions.rb"
264 "test/ruby/test_process.rb"
265 "test/ruby/test_system.rb"
266 "tool/rbinstall.rb")
267 (("/bin/sh") (which "sh"))))))))
268 (native-inputs
269 (append (if (%current-target-system)
270 (list this-package)
271 '())
272 (list autoconf libyaml)))
273 (inputs
274 (list readline openssl libffi gdbm))
275 (propagated-inputs
276 (list zlib))
277 (native-search-paths
278 (list (search-path-specification
279 (variable "GEM_PATH")
280 (files (list (string-append "lib/ruby/vendor_ruby"))))))
281 (synopsis "Programming language interpreter")
282 (description "Ruby is a dynamic object-oriented programming language with
283a focus on simplicity and productivity.")
284 (home-page "https://www.ruby-lang.org")
285 (license license:ruby)))
286
287(define-public ruby ruby-3.4)
288
289(define-public mruby
290 (package
291 (name "mruby")
292 (version "3.3.0")
293 (source
294 (origin
295 (method git-fetch)
296 (uri (git-reference
297 (url "https://github.com/mruby/mruby")
298 (commit version)))
299 (file-name (git-file-name name version))
300 (sha256
301 (base32
302 "0zynr6dk0zxdip53il0qr0rhyzmjicpkxs63l77acpx8b05h8amc"))))
303 (build-system gnu-build-system)
304 (arguments
305 `(#:test-target "test"
306 #:phases
307 (modify-phases %standard-phases
308 (delete 'configure)
309 (add-after 'unpack 'enable-verbose-tests
310 (lambda _
311 (substitute* "Makefile"
312 (("ruby ./minirake" m)
313 (string-append m " --verbose")))))
314 (add-after 'unpack 'disable-broken-tests
315 (lambda _
316 (substitute* "mrbgems/mruby-io/test/io.rb"
317 (("assert\\('IO.popen.+$" m)
318 (string-append m "skip \"Hangs in the Guix build environment\"\n"))
319 ;; This one is really weird. The *expected* output is all wrong.
320 (("assert\\('`cmd`.*" m)
321 (string-append m "skip \"Disable for Guix\"\n")))))
322 ;; There is no install target
323 (replace 'install
324 (lambda* (#:key outputs #:allow-other-keys)
325 (let* ((out (assoc-ref outputs "out"))
326 (bin (string-append out "/bin"))
327 (lib (string-append out "/lib"))
328 (inc (string-append out "/include")))
329 (mkdir-p bin)
330 (copy-recursively "build/host/bin" bin)
331 (mkdir-p lib)
332 (copy-recursively "build/host/lib" lib)
333 (mkdir-p inc)
334 (copy-recursively "include" inc)))))))
335 (native-inputs
336 (list ruby bison))
337 (home-page "https://github.com/mruby/mruby")
338 (synopsis "Lightweight Ruby")
339 (description "mruby is the lightweight implementation of the Ruby
340language. Its syntax is Ruby 3.x compatible except for pattern
341matching. mruby can be linked and embedded within your application.")
342 (license license:expat)))
343
344;;;
345;;; Avoid adding new packages to the end of this file. To reduce the chances
346;;; of a merge conflict, place them above by existing packages with similar
347;;; functionality or similar names.
348;;;