gnu: Add bundler.
[jackhill/guix/guix.git] / gnu / packages / ruby.scm
CommitLineData
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
86a 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,
139maintain, and release projects and includes a dynamic plug-in system allowing
140for easy extensibility. Hoe ships with plug-ins for all the usual project
141tasks including rdoc generation, testing, packaging, deployment, and
142announcement.")
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
163solution for Ruby programs. It features translation and localization,
164interpolation of values to translations, pluralization, customizable
165transliteration to ASCII, flexible defaults, bulk lookup, lambdas as
166translation data, custom key/scope separator, custom exception handlers, and
167an 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
215groups.")
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
237sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm.
238It includes utilities to create a simple HTML diff output format and a
239standard 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
264outcomes 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
289support 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
315Ruby. This meta-package includes the RSpec test runner, along with the
316expectations 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
339specified in a \"Gemfile\", as well as their dependencies.")
340 (home-page "http://bundler.io/")
341 (license license:expat)))