Commit | Line | Data |
---|---|---|
6ef8c59a PP |
1 | ;;; GNU Guix --- Functional package management for GNU |
2 | ;;; Copyright © 2014 Pjotr Prins <pjotr.guix@thebird.nl> | |
3 | ;;; Copyright © 2014 Ludovic Courtès <ludo@gnu.org> | |
f586c877 | 4 | ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org> |
ecde6191 | 5 | ;;; Copyright © 2014 David Thompson <davet@gnu.org> |
6ef8c59a PP |
6 | ;;; |
7 | ;;; This file is part of GNU Guix. | |
8 | ;;; | |
9 | ;;; GNU Guix is free software; you can redistribute it and/or modify it | |
10 | ;;; under the terms of the GNU General Public License as published by | |
11 | ;;; the Free Software Foundation; either version 3 of the License, or (at | |
12 | ;;; your option) any later version. | |
13 | ;;; | |
14 | ;;; GNU Guix is distributed in the hope that it will be useful, but | |
15 | ;;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | ;;; GNU General Public License for more details. | |
18 | ;;; | |
19 | ;;; You should have received a copy of the GNU General Public License | |
20 | ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. | |
21 | ||
22 | (define-module (gnu packages ruby) | |
23 | #:use-module ((guix licenses) #:prefix license:) | |
24 | #:use-module (gnu packages) | |
25 | #:use-module (gnu packages compression) | |
26 | #:use-module (gnu packages readline) | |
27 | #:use-module (gnu packages openssl) | |
28 | #:use-module (gnu packages autotools) | |
29 | #:use-module (gnu packages libffi) | |
30 | #:use-module (gnu packages gdbm) | |
31 | #:use-module (guix packages) | |
32 | #:use-module (guix download) | |
bda0c139 | 33 | #:use-module (guix git-download) |
6ef8c59a | 34 | #:use-module (guix utils) |
acf735f2 DT |
35 | #:use-module (guix build-system gnu) |
36 | #:use-module (guix build-system ruby)) | |
6ef8c59a PP |
37 | |
38 | (define-public ruby | |
39 | (package | |
40 | (name "ruby") | |
463acb4a | 41 | (version "2.2.2") |
6ef8c59a PP |
42 | (source |
43 | (origin | |
44 | (method url-fetch) | |
6becfdff MW |
45 | (uri (string-append "http://cache.ruby-lang.org/pub/ruby/" |
46 | (version-major+minor version) | |
12d39eb5 | 47 | "/ruby-" version ".tar.xz")) |
6ef8c59a PP |
48 | (sha256 |
49 | (base32 | |
463acb4a | 50 | "0qj48a8ji8qj1sllsrhb6y65frwr77bvr08xikj86w5mib8baczh")))) |
6ef8c59a PP |
51 | (build-system gnu-build-system) |
52 | (arguments | |
53 | `(#:test-target "test" | |
54 | #:parallel-tests? #f | |
55 | #:phases | |
12d39eb5 DT |
56 | (alist-cons-before |
57 | 'configure 'replace-bin-sh | |
6ef8c59a | 58 | (lambda _ |
12d39eb5 DT |
59 | (substitute* '("Makefile.in" |
60 | "ext/pty/pty.c" | |
61 | "io.c" | |
62 | "lib/mkmf.rb" | |
63 | "process.c" | |
64 | "test/rubygems/test_gem_ext_configure_builder.rb" | |
65 | "test/rdoc/test_rdoc_parser.rb" | |
66 | "test/ruby/test_rubyoptions.rb" | |
67 | "test/ruby/test_process.rb" | |
68 | "test/ruby/test_system.rb" | |
69 | "tool/rbinstall.rb") | |
70 | (("/bin/sh") (which "sh")))) | |
71 | %standard-phases))) | |
6ef8c59a PP |
72 | (inputs |
73 | `(("readline" ,readline) | |
6ef8c59a PP |
74 | ("openssl" ,openssl) |
75 | ("libffi" ,libffi) | |
76 | ("gdbm" ,gdbm) | |
77 | ("zlib" ,zlib))) | |
78 | (native-search-paths | |
79 | (list (search-path-specification | |
80 | (variable "GEM_PATH") | |
af070955 LC |
81 | (files (list (string-append "lib/ruby/gems/" |
82 | (version-major+minor version) | |
83 | ".0")))))) | |
6becfdff | 84 | (synopsis "Programming language interpreter") |
6ef8c59a PP |
85 | (description "Ruby is a dynamic object-oriented programming language with |
86 | a focus on simplicity and productivity.") | |
87 | (home-page "https://ruby-lang.org") | |
88 | (license license:ruby))) | |
89 | ||
218ee89b PP |
90 | (define-public ruby-1.8 |
91 | (package (inherit ruby) | |
218ee89b PP |
92 | (version "1.8.7-p374") |
93 | (source | |
94 | (origin | |
95 | (method url-fetch) | |
6becfdff MW |
96 | (uri (string-append "http://cache.ruby-lang.org/pub/ruby/" |
97 | (version-major+minor version) | |
98 | "/ruby-" version ".tar.bz2")) | |
218ee89b PP |
99 | (sha256 |
100 | (base32 | |
101 | "1qq7khilwkayrhwmzlxk83scrmiqfi7lgsn4c63znyvz2c1lgqxl")))) | |
102 | (native-search-paths '()) | |
103 | (arguments | |
104 | `(#:test-target "test" | |
105 | #:parallel-tests? #f | |
106 | #:phases | |
107 | (alist-cons-before | |
108 | 'configure 'replace-bin-sh | |
109 | (lambda _ | |
110 | (substitute* '("Makefile.in" | |
111 | "ext/pty/pty.c" | |
112 | "io.c" | |
113 | "lib/mkmf.rb" | |
114 | "process.c") | |
115 | (("/bin/sh") (which "sh")))) | |
116 | %standard-phases))))) | |
117 | ||
bda0c139 DT |
118 | (define-public ruby-hoe |
119 | (package | |
120 | (name "ruby-hoe") | |
121 | (version "3.13.1") | |
122 | (source (origin | |
123 | (method git-fetch) | |
124 | (uri (git-reference | |
125 | (url "https://github.com/seattlerb/hoe.git") | |
126 | (commit "0c11836"))) ; no release tags :( | |
127 | (sha256 | |
128 | (base32 | |
129 | "0i8dimf8kxcjgqj9x65bbi3l6hc9p9gbfbb1vmrz42764a4jjbz9"))) ) | |
130 | (build-system ruby-build-system) | |
131 | (arguments | |
132 | '(#:phases (alist-replace | |
133 | 'build | |
134 | (lambda _ (zero? (system* "rake" "gem"))) | |
135 | %standard-phases))) | |
136 | (synopsis "Ruby project management helper") | |
137 | (description | |
138 | "Hoe is a rake/rubygems helper for project Rakefiles. It helps manage, | |
139 | maintain, and release projects and includes a dynamic plug-in system allowing | |
140 | for easy extensibility. Hoe ships with plug-ins for all the usual project | |
141 | tasks including rdoc generation, testing, packaging, deployment, and | |
142 | announcement.") | |
143 | (home-page "http://www.zenspider.com/projects/hoe.html") | |
144 | (license license:expat))) | |
145 | ||
acf735f2 DT |
146 | (define-public ruby-i18n |
147 | (package | |
148 | (name "ruby-i18n") | |
149 | (version "0.6.11") | |
150 | (source (origin | |
151 | (method url-fetch) | |
152 | (uri (string-append "https://github.com/svenfuchs/i18n/archive/v" | |
153 | version ".tar.gz")) | |
f586c877 | 154 | (file-name (string-append name "-" version ".tar.gz")) |
acf735f2 DT |
155 | (sha256 |
156 | (base32 | |
157 | "1fdhnhh1p5g8vibv44d770z8nq208zrms3m2nswdvr54072y1m6k")))) | |
158 | (build-system ruby-build-system) | |
159 | (arguments | |
160 | '(#:tests? #f)) ; requires bundler | |
161 | (synopsis "Internationalization library for Ruby") | |
162 | (description "Ruby i18n is an internationalization and localization | |
163 | solution for Ruby programs. It features translation and localization, | |
164 | interpolation of values to translations, pluralization, customizable | |
165 | transliteration to ASCII, flexible defaults, bulk lookup, lambdas as | |
166 | translation data, custom key/scope separator, custom exception handlers, and | |
167 | an extensible architecture with a swappable backend.") | |
168 | (home-page "http://github.com/svenfuchs/i18n") | |
169 | (license license:expat))) | |
eb0c2dd6 DT |
170 | |
171 | ;; RSpec is the dominant testing library for Ruby projects. Even RSpec's | |
172 | ;; dependencies use RSpec for their test suites! To avoid these circular | |
173 | ;; dependencies, we disable tests for all of the RSpec-related packages. | |
174 | (define ruby-rspec-support | |
175 | (package | |
176 | (name "ruby-rspec-support") | |
177 | (version "3.2.2") | |
178 | (source (origin | |
179 | (method url-fetch) | |
180 | (uri (string-append | |
181 | "https://github.com/rspec/rspec-support/archive/v" | |
182 | version ".tar.gz")) | |
183 | (file-name (string-append name "-" version ".tar.gz")) | |
184 | (sha256 | |
185 | (base32 | |
186 | "1pvzfrqgy0z0gwmdgjp9f2vz1d9c0cajyzfqj9z8i2ssxnzmj4bv")))) | |
187 | (build-system ruby-build-system) | |
188 | (arguments | |
189 | '(#:tests? #f)) ; avoid dependency cycles | |
190 | (synopsis "RSpec support library") | |
191 | (description "Support utilities for RSpec gems.") | |
192 | (home-page "https://github.com/rspec/rspec-support") | |
193 | (license license:expat))) | |
194 | ||
195 | (define-public ruby-rspec-core | |
196 | (package | |
197 | (name "ruby-rspec-core") | |
198 | (version "3.2.3") | |
199 | (source (origin | |
200 | (method url-fetch) | |
201 | (uri (string-append | |
202 | "https://github.com/rspec/rspec-core/archive/v" | |
203 | version ".tar.gz")) | |
204 | (file-name (string-append name "-" version ".tar.gz")) | |
205 | (sha256 | |
206 | (base32 | |
207 | "1clsa4lkh5c9c7xc3xa336ym00ycr67pchpg1bv4y3fz5hvzw8ki")))) | |
208 | (build-system ruby-build-system) | |
209 | (arguments | |
210 | '(#:tests? #f)) ; avoid dependency cycles | |
211 | (propagated-inputs | |
212 | `(("ruby-rspec-support" ,ruby-rspec-support))) | |
213 | (synopsis "RSpec core library") | |
214 | (description "Rspec-core provides the RSpec test runner and example | |
215 | groups.") | |
216 | (home-page "https://github.com/rspec/rspec-core") | |
217 | (license license:expat))) | |
e6962009 DT |
218 | |
219 | (define ruby-diff-lcs-for-rspec | |
220 | (package | |
221 | (name "ruby-diff-lcs") | |
222 | (version "1.2.5") | |
223 | (source (origin | |
224 | (method url-fetch) | |
225 | (uri (string-append | |
226 | "https://github.com/halostatue/diff-lcs/archive/v" | |
227 | version ".tar.gz")) | |
228 | (file-name (string-append name "-" version ".tar.gz")) | |
229 | (sha256 | |
230 | (base32 | |
231 | "0kmfz2qdwbfjf97rx27hh9fm39mv3z9avjmvsajqnb5wxj2l5l4s")))) | |
232 | (build-system ruby-build-system) | |
233 | (arguments | |
234 | '(#:tests? #f)) ; avoid dependency cycles | |
235 | (synopsis "Compute the difference between two Enumerable sequences") | |
236 | (description "Diff::LCS computes the difference between two Enumerable | |
237 | sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm. | |
238 | It includes utilities to create a simple HTML diff output format and a | |
239 | standard diff-like tool.") | |
240 | (home-page "https://github.com/halostatue/diff-lcs") | |
241 | (license license:expat))) | |
242 | ||
243 | (define-public ruby-rspec-expectations | |
244 | (package | |
245 | (name "ruby-rspec-expectations") | |
246 | (version "3.2.1") | |
247 | (source (origin | |
248 | (method url-fetch) | |
249 | (uri (string-append | |
250 | "https://github.com/rspec/rspec-expectations/archive/v" | |
251 | version ".tar.gz")) | |
252 | (file-name (string-append name "-" version ".tar.gz")) | |
253 | (sha256 | |
254 | (base32 | |
255 | "0h0rpprbh6h59gmksiyi1b8w6cvcai4wdbkikajwx3w1asxi6f7x")))) | |
256 | (build-system ruby-build-system) | |
257 | (arguments | |
258 | '(#:tests? #f)) ; avoid dependency cycles | |
259 | (propagated-inputs | |
260 | `(("ruby-rspec-support" ,ruby-rspec-support) | |
261 | ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec))) | |
262 | (synopsis "RSpec expecations library") | |
263 | (description "Rspec-expectations provides a simple API to express expected | |
264 | outcomes of a code example.") | |
265 | (home-page "https://github.com/rspec/rspec-expectations") | |
266 | (license license:expat))) | |
4f2a0cac DT |
267 | |
268 | (define-public ruby-rspec-mocks | |
269 | (package | |
270 | (name "ruby-rspec-mocks") | |
271 | (version "3.2.1") | |
272 | (source (origin | |
273 | (method url-fetch) | |
274 | (uri (string-append | |
275 | "https://github.com/rspec/rspec-mocks/archive/v" | |
276 | version ".tar.gz")) | |
277 | (file-name (string-append name "-" version ".tar.gz")) | |
278 | (sha256 | |
279 | (base32 | |
280 | "1xzxsg0idxkg7czmjgqq10lcd821ibw1hjzn404sk9j6rw0fbx2g")))) | |
281 | (build-system ruby-build-system) | |
282 | (arguments | |
283 | '(#:tests? #f)) ; avoid dependency cycles | |
284 | (propagated-inputs | |
285 | `(("ruby-rspec-support" ,ruby-rspec-support) | |
286 | ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec))) | |
287 | (synopsis "RSpec stubbing and mocking library") | |
288 | (description "Rspec-mocks provides RSpec's \"test double\" framework, with | |
289 | support for stubbing and mocking.") | |
290 | (home-page "https://github.com/rspec/rspec-mocks") | |
291 | (license license:expat))) | |
d4fde1f2 DT |
292 | |
293 | (define-public ruby-rspec | |
294 | (package | |
295 | (name "ruby-rspec") | |
296 | (version "3.2.0") | |
297 | (source (origin | |
298 | (method url-fetch) | |
299 | (uri (string-append | |
300 | "https://github.com/rspec/rspec/archive/v" | |
301 | version ".tar.gz")) | |
302 | (file-name (string-append name "-" version ".tar.gz")) | |
303 | (sha256 | |
304 | (base32 | |
305 | "1jg38dbaknsdhiav5vnrwfccg524fwcg6sq1715441vx1xl6p54q")))) | |
306 | (build-system ruby-build-system) | |
307 | (arguments | |
308 | '(#:tests? #f)) ; avoid dependency cycles | |
309 | (propagated-inputs | |
310 | `(("ruby-rspec-core" ,ruby-rspec-core) | |
311 | ("ruby-rspec-mocks" ,ruby-rspec-mocks) | |
312 | ("ruby-rspec-expectations" ,ruby-rspec-expectations))) | |
313 | (synopsis "Behavior-driven development framework for Ruby") | |
314 | (description "RSpec is a behavior-driven development (BDD) framework for | |
315 | Ruby. This meta-package includes the RSpec test runner, along with the | |
316 | expectations and mocks frameworks.") | |
317 | (home-page "http://rspec.info/") | |
318 | (license license:expat))) | |
2cbc105b DT |
319 | |
320 | ;; Bundler is yet another source of circular dependencies, so we must disable | |
321 | ;; its test suite as well. | |
322 | (define-public bundler | |
323 | (package | |
324 | (name "bundler") | |
325 | (version "1.9.9") | |
326 | (source (origin | |
327 | (method url-fetch) | |
328 | (uri (string-append "https://github.com/bundler/bundler/archive/v" | |
329 | version ".tar.gz")) | |
330 | (file-name (string-append name "-" version ".tar.gz")) | |
331 | (sha256 | |
332 | (base32 | |
333 | "08flx3n9hb3yz8mm5k16cdz0sb7g774f6vxn6gc3wfh5la83vfyx")))) | |
334 | (build-system ruby-build-system) | |
335 | (arguments | |
336 | '(#:tests? #f)) ; avoid dependency cycles | |
337 | (synopsis "Ruby gem bundler") | |
338 | (description "Bundler automatically downloads and installs a list of gems | |
339 | specified in a \"Gemfile\", as well as their dependencies.") | |
340 | (home-page "http://bundler.io/") | |
341 | (license license:expat))) | |
98b87b82 DT |
342 | |
343 | (define-public ruby-useragent | |
344 | (package | |
345 | (name "ruby-useragent") | |
346 | (version "0.13.3") | |
347 | (source (origin | |
348 | (method url-fetch) | |
349 | (uri (string-append | |
350 | "https://github.com/gshutler/useragent/archive/v" | |
351 | version ".tar.gz")) | |
352 | (file-name (string-append name "-" version ".tar.gz")) | |
353 | (sha256 | |
354 | (base32 | |
355 | "1hj00fw06i0y3rwxxhxmnrqxhpnffv4zfqx2sqqpc5qc4fdvd2x9")))) | |
356 | (build-system ruby-build-system) | |
357 | (arguments | |
358 | '(#:test-target "spec")) | |
359 | (native-inputs | |
360 | `(("ruby-rspec" ,ruby-rspec) | |
361 | ("bundler" ,bundler))) | |
362 | (synopsis "HTTP user agent parser for Ruby") | |
363 | (description "UserAgent is a Ruby library that parses and compares HTTP | |
364 | User Agents.") | |
365 | (home-page "https://github.com/gshutler/useragent") | |
366 | (license license:expat))) | |
96086cc5 DT |
367 | |
368 | (define-public ruby-bacon | |
369 | (package | |
370 | (name "ruby-bacon") | |
371 | (version "1.2") | |
372 | (source (origin | |
373 | (method url-fetch) | |
374 | (uri (string-append | |
375 | "https://github.com/chneukirchen/bacon/archive/" | |
376 | version ".tar.gz")) | |
377 | (file-name (string-append name "-" version ".tar.gz")) | |
378 | (sha256 | |
379 | (base32 | |
380 | "0g03fxilrrx17dijww68n1lq5d8s69hrxgpga8c1i2k35bzcw5jc")))) | |
381 | (build-system ruby-build-system) | |
382 | (arguments | |
383 | `(#:phases (modify-phases %standard-phases | |
384 | (add-before 'build 'generate-docs | |
385 | (lambda _ | |
386 | ;; This rake task also tries to generate a ChangeLog | |
387 | ;; file from the Git log, which we don't have. It fails | |
388 | ;; but creates an empty file, allowing the rest of the | |
389 | ;; build to succeed. | |
390 | (zero? (system* "rake" "predist"))))))) | |
391 | (synopsis "Small RSpec clone") | |
392 | (description "Bacon is a small RSpec clone providing all essential | |
393 | features.") | |
394 | (home-page "https://github.com/chneukirchen/bacon") | |
395 | (license license:expat))) | |
de59d316 DT |
396 | |
397 | (define-public ruby-arel | |
398 | (package | |
399 | (name "ruby-arel") | |
400 | (version "6.0.0") | |
401 | (source (origin | |
402 | (method url-fetch) | |
403 | (uri (string-append | |
404 | "https://github.com/rails/arel/archive/v" | |
405 | version ".tar.gz")) | |
406 | (file-name (string-append name "-" version ".tar.gz")) | |
407 | (sha256 | |
408 | (base32 | |
409 | "0fldwp2hmrmddx22xf7hdmybngzv97qnv5rvz3qw61m94ddd6w4n")))) | |
410 | (build-system ruby-build-system) | |
411 | (native-inputs | |
412 | `(("bundler" ,bundler))) | |
413 | (synopsis "SQL AST manager for Ruby") | |
414 | (description "Arel is a SQL AST manager for Ruby. It simplifies the | |
415 | generation of complex SQL queries and adapts to various relational database | |
416 | implementations.") | |
417 | (home-page "https://github.com/rails/arel") | |
418 | (license license:expat))) | |
e259bdf0 DT |
419 | |
420 | (define-public ruby-connection-pool | |
421 | (package | |
422 | (name "ruby-connection-pool") | |
423 | (version "2.2.0") | |
424 | (source (origin | |
425 | (method url-fetch) | |
426 | (uri (string-append | |
427 | "https://github.com/mperham/connection_pool/archive/v" | |
428 | version ".tar.gz")) | |
429 | (file-name (string-append name "-" version ".tar.gz")) | |
430 | (sha256 | |
431 | (base32 | |
432 | "02s5rwhmgy8qqns7a5y1daa0yaw38x6lzpwyvmy46h1yrj9mc6zf")))) | |
433 | (build-system ruby-build-system) | |
434 | (native-inputs | |
435 | `(("bundler" ,bundler))) | |
436 | (synopsis "Generic connection pool for Ruby") | |
437 | (description "Connection_pool provides a generic connection pooling | |
438 | interface for Ruby programs.") | |
439 | (home-page "https://github.com/mperham/connection_pool") | |
440 | (license license:expat))) | |
4c0aeb44 DT |
441 | |
442 | (define-public ruby-net-http-persistent | |
443 | (package | |
444 | (name "ruby-net-http-persistent") | |
445 | (version "2.9.4") | |
446 | (source (origin | |
447 | (method url-fetch) | |
448 | (uri (string-append | |
449 | "https://github.com/drbrain/net-http-persistent/archive/v" | |
450 | version ".tar.gz")) | |
451 | (file-name (string-append name "-" version ".tar.gz")) | |
452 | (sha256 | |
453 | (base32 | |
454 | "1q18vji31w8gfr6ajziqkqs8n5lzkw0bl00dm2a8s05zhavzw9j9")))) | |
455 | (build-system ruby-build-system) | |
456 | (arguments | |
457 | '(#:phases (modify-phases %standard-phases | |
458 | (replace 'build ; no gemspec | |
459 | (lambda _ (zero? (system* "rake" "gem"))))))) | |
460 | (native-inputs | |
461 | `(("ruby-connection-pool" ,ruby-connection-pool) | |
462 | ("ruby-hoe" ,ruby-hoe))) | |
463 | (synopsis "Persistent HTTP connection manager") | |
464 | (description "Net::HTTP::Persistent manages persistent HTTP connections | |
465 | using Net::HTTP, supporting reconnection and retry according to RFC 2616.") | |
466 | (home-page "https://github.com/drbrain/net-http-persistent") | |
467 | (license license:expat))) |