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>
4 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
5 ;;; Copyright © 2014 David Thompson <davet@gnu.org>
7 ;;; This file is part of GNU Guix.
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.
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.
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/>.
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 (gnu packages version-control)
32 #:use-module (guix packages)
33 #:use-module (guix download)
34 #:use-module (guix git-download)
35 #:use-module (guix utils)
36 #:use-module (guix build-system gnu)
37 #:use-module (guix build-system ruby))
46 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
47 (version-major+minor version)
48 "/ruby-" version ".tar.xz"))
51 "0qj48a8ji8qj1sllsrhb6y65frwr77bvr08xikj86w5mib8baczh"))))
52 (build-system gnu-build-system)
54 `(#:test-target "test"
58 'configure 'replace-bin-sh
60 (substitute* '("Makefile.in"
65 "test/rubygems/test_gem_ext_configure_builder.rb"
66 "test/rdoc/test_rdoc_parser.rb"
67 "test/ruby/test_rubyoptions.rb"
68 "test/ruby/test_process.rb"
69 "test/ruby/test_system.rb"
71 (("/bin/sh") (which "sh"))))
74 `(("readline" ,readline)
80 (list (search-path-specification
82 (files (list (string-append "lib/ruby/gems/"
83 (version-major+minor version)
85 (synopsis "Programming language interpreter")
86 (description "Ruby is a dynamic object-oriented programming language with
87 a focus on simplicity and productivity.")
88 (home-page "https://ruby-lang.org")
89 (license license:ruby)))
91 (define-public ruby-1.8
92 (package (inherit ruby)
93 (version "1.8.7-p374")
97 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
98 (version-major+minor version)
99 "/ruby-" version ".tar.bz2"))
102 "1qq7khilwkayrhwmzlxk83scrmiqfi7lgsn4c63znyvz2c1lgqxl"))))
103 (native-search-paths '())
105 `(#:test-target "test"
109 'configure 'replace-bin-sh
111 (substitute* '("Makefile.in"
116 (("/bin/sh") (which "sh"))))
117 %standard-phases)))))
119 (define-public ruby-hoe
126 (url "https://github.com/seattlerb/hoe.git")
127 (commit "0c11836"))) ; no release tags :(
130 "0i8dimf8kxcjgqj9x65bbi3l6hc9p9gbfbb1vmrz42764a4jjbz9"))) )
131 (build-system ruby-build-system)
133 '(#:phases (alist-replace
135 (lambda _ (zero? (system* "rake" "gem")))
137 (synopsis "Ruby project management helper")
139 "Hoe is a rake/rubygems helper for project Rakefiles. It helps manage,
140 maintain, and release projects and includes a dynamic plug-in system allowing
141 for easy extensibility. Hoe ships with plug-ins for all the usual project
142 tasks including rdoc generation, testing, packaging, deployment, and
144 (home-page "http://www.zenspider.com/projects/hoe.html")
145 (license license:expat)))
147 (define-public ruby-i18n
153 (uri (string-append "https://github.com/svenfuchs/i18n/archive/v"
155 (file-name (string-append name "-" version ".tar.gz"))
158 "1fdhnhh1p5g8vibv44d770z8nq208zrms3m2nswdvr54072y1m6k"))))
159 (build-system ruby-build-system)
161 '(#:tests? #f)) ; requires bundler
162 (synopsis "Internationalization library for Ruby")
163 (description "Ruby i18n is an internationalization and localization
164 solution for Ruby programs. It features translation and localization,
165 interpolation of values to translations, pluralization, customizable
166 transliteration to ASCII, flexible defaults, bulk lookup, lambdas as
167 translation data, custom key/scope separator, custom exception handlers, and
168 an extensible architecture with a swappable backend.")
169 (home-page "http://github.com/svenfuchs/i18n")
170 (license license:expat)))
172 ;; RSpec is the dominant testing library for Ruby projects. Even RSpec's
173 ;; dependencies use RSpec for their test suites! To avoid these circular
174 ;; dependencies, we disable tests for all of the RSpec-related packages.
175 (define ruby-rspec-support
177 (name "ruby-rspec-support")
182 "https://github.com/rspec/rspec-support/archive/v"
184 (file-name (string-append name "-" version ".tar.gz"))
187 "1pvzfrqgy0z0gwmdgjp9f2vz1d9c0cajyzfqj9z8i2ssxnzmj4bv"))))
188 (build-system ruby-build-system)
190 '(#:tests? #f)) ; avoid dependency cycles
191 (synopsis "RSpec support library")
192 (description "Support utilities for RSpec gems.")
193 (home-page "https://github.com/rspec/rspec-support")
194 (license license:expat)))
196 (define-public ruby-rspec-core
198 (name "ruby-rspec-core")
203 "https://github.com/rspec/rspec-core/archive/v"
205 (file-name (string-append name "-" version ".tar.gz"))
208 "1clsa4lkh5c9c7xc3xa336ym00ycr67pchpg1bv4y3fz5hvzw8ki"))))
209 (build-system ruby-build-system)
211 '(#:tests? #f)) ; avoid dependency cycles
213 `(("ruby-rspec-support" ,ruby-rspec-support)))
214 (synopsis "RSpec core library")
215 (description "Rspec-core provides the RSpec test runner and example
217 (home-page "https://github.com/rspec/rspec-core")
218 (license license:expat)))
220 (define ruby-diff-lcs-for-rspec
222 (name "ruby-diff-lcs")
227 "https://github.com/halostatue/diff-lcs/archive/v"
229 (file-name (string-append name "-" version ".tar.gz"))
232 "0kmfz2qdwbfjf97rx27hh9fm39mv3z9avjmvsajqnb5wxj2l5l4s"))))
233 (build-system ruby-build-system)
235 '(#:tests? #f)) ; avoid dependency cycles
236 (synopsis "Compute the difference between two Enumerable sequences")
237 (description "Diff::LCS computes the difference between two Enumerable
238 sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm.
239 It includes utilities to create a simple HTML diff output format and a
240 standard diff-like tool.")
241 (home-page "https://github.com/halostatue/diff-lcs")
242 (license license:expat)))
244 (define-public ruby-rspec-expectations
246 (name "ruby-rspec-expectations")
251 "https://github.com/rspec/rspec-expectations/archive/v"
253 (file-name (string-append name "-" version ".tar.gz"))
256 "0h0rpprbh6h59gmksiyi1b8w6cvcai4wdbkikajwx3w1asxi6f7x"))))
257 (build-system ruby-build-system)
259 '(#:tests? #f)) ; avoid dependency cycles
261 `(("ruby-rspec-support" ,ruby-rspec-support)
262 ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec)))
263 (synopsis "RSpec expecations library")
264 (description "Rspec-expectations provides a simple API to express expected
265 outcomes of a code example.")
266 (home-page "https://github.com/rspec/rspec-expectations")
267 (license license:expat)))
269 (define-public ruby-rspec-mocks
271 (name "ruby-rspec-mocks")
276 "https://github.com/rspec/rspec-mocks/archive/v"
278 (file-name (string-append name "-" version ".tar.gz"))
281 "1xzxsg0idxkg7czmjgqq10lcd821ibw1hjzn404sk9j6rw0fbx2g"))))
282 (build-system ruby-build-system)
284 '(#:tests? #f)) ; avoid dependency cycles
286 `(("ruby-rspec-support" ,ruby-rspec-support)
287 ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec)))
288 (synopsis "RSpec stubbing and mocking library")
289 (description "Rspec-mocks provides RSpec's \"test double\" framework, with
290 support for stubbing and mocking.")
291 (home-page "https://github.com/rspec/rspec-mocks")
292 (license license:expat)))
294 (define-public ruby-rspec
301 "https://github.com/rspec/rspec/archive/v"
303 (file-name (string-append name "-" version ".tar.gz"))
306 "1jg38dbaknsdhiav5vnrwfccg524fwcg6sq1715441vx1xl6p54q"))))
307 (build-system ruby-build-system)
309 '(#:tests? #f)) ; avoid dependency cycles
311 `(("ruby-rspec-core" ,ruby-rspec-core)
312 ("ruby-rspec-mocks" ,ruby-rspec-mocks)
313 ("ruby-rspec-expectations" ,ruby-rspec-expectations)))
314 (synopsis "Behavior-driven development framework for Ruby")
315 (description "RSpec is a behavior-driven development (BDD) framework for
316 Ruby. This meta-package includes the RSpec test runner, along with the
317 expectations and mocks frameworks.")
318 (home-page "http://rspec.info/")
319 (license license:expat)))
321 ;; Bundler is yet another source of circular dependencies, so we must disable
322 ;; its test suite as well.
323 (define-public bundler
329 (uri (string-append "https://github.com/bundler/bundler/archive/v"
331 (file-name (string-append name "-" version ".tar.gz"))
334 "08flx3n9hb3yz8mm5k16cdz0sb7g774f6vxn6gc3wfh5la83vfyx"))))
335 (build-system ruby-build-system)
337 '(#:tests? #f)) ; avoid dependency cycles
338 (synopsis "Ruby gem bundler")
339 (description "Bundler automatically downloads and installs a list of gems
340 specified in a \"Gemfile\", as well as their dependencies.")
341 (home-page "http://bundler.io/")
342 (license license:expat)))
344 (define-public ruby-useragent
346 (name "ruby-useragent")
351 "https://github.com/gshutler/useragent/archive/v"
353 (file-name (string-append name "-" version ".tar.gz"))
356 "1hj00fw06i0y3rwxxhxmnrqxhpnffv4zfqx2sqqpc5qc4fdvd2x9"))))
357 (build-system ruby-build-system)
359 '(#:test-target "spec"))
361 `(("ruby-rspec" ,ruby-rspec)
362 ("bundler" ,bundler)))
363 (synopsis "HTTP user agent parser for Ruby")
364 (description "UserAgent is a Ruby library that parses and compares HTTP
366 (home-page "https://github.com/gshutler/useragent")
367 (license license:expat)))
369 (define-public ruby-bacon
376 "https://github.com/chneukirchen/bacon/archive/"
378 (file-name (string-append name "-" version ".tar.gz"))
381 "0g03fxilrrx17dijww68n1lq5d8s69hrxgpga8c1i2k35bzcw5jc"))))
382 (build-system ruby-build-system)
384 `(#:phases (modify-phases %standard-phases
385 (add-before 'build 'generate-docs
387 ;; This rake task also tries to generate a ChangeLog
388 ;; file from the Git log, which we don't have. It fails
389 ;; but creates an empty file, allowing the rest of the
391 (zero? (system* "rake" "predist")))))))
392 (synopsis "Small RSpec clone")
393 (description "Bacon is a small RSpec clone providing all essential
395 (home-page "https://github.com/chneukirchen/bacon")
396 (license license:expat)))
398 (define-public ruby-arel
405 "https://github.com/rails/arel/archive/v"
407 (file-name (string-append name "-" version ".tar.gz"))
410 "0fldwp2hmrmddx22xf7hdmybngzv97qnv5rvz3qw61m94ddd6w4n"))))
411 (build-system ruby-build-system)
413 `(("bundler" ,bundler)))
414 (synopsis "SQL AST manager for Ruby")
415 (description "Arel is a SQL AST manager for Ruby. It simplifies the
416 generation of complex SQL queries and adapts to various relational database
418 (home-page "https://github.com/rails/arel")
419 (license license:expat)))
421 (define-public ruby-connection-pool
423 (name "ruby-connection-pool")
428 "https://github.com/mperham/connection_pool/archive/v"
430 (file-name (string-append name "-" version ".tar.gz"))
433 "02s5rwhmgy8qqns7a5y1daa0yaw38x6lzpwyvmy46h1yrj9mc6zf"))))
434 (build-system ruby-build-system)
436 `(("bundler" ,bundler)))
437 (synopsis "Generic connection pool for Ruby")
438 (description "Connection_pool provides a generic connection pooling
439 interface for Ruby programs.")
440 (home-page "https://github.com/mperham/connection_pool")
441 (license license:expat)))
443 (define-public ruby-net-http-persistent
445 (name "ruby-net-http-persistent")
450 "https://github.com/drbrain/net-http-persistent/archive/v"
452 (file-name (string-append name "-" version ".tar.gz"))
455 "1q18vji31w8gfr6ajziqkqs8n5lzkw0bl00dm2a8s05zhavzw9j9"))))
456 (build-system ruby-build-system)
458 '(#:phases (modify-phases %standard-phases
459 (replace 'build ; no gemspec
460 (lambda _ (zero? (system* "rake" "gem")))))))
462 `(("ruby-connection-pool" ,ruby-connection-pool)
463 ("ruby-hoe" ,ruby-hoe)))
464 (synopsis "Persistent HTTP connection manager")
465 (description "Net::HTTP::Persistent manages persistent HTTP connections
466 using Net::HTTP, supporting reconnection and retry according to RFC 2616.")
467 (home-page "https://github.com/drbrain/net-http-persistent")
468 (license license:expat)))
470 (define-public ruby-minitest
472 (name "ruby-minitest")
476 ;; No release tarballs nor git tags. This is the commit
477 ;; corresponding to the addition of the release notes to
480 (url "https://github.com/seattlerb/minitest.git")
484 "09xjiahk7q8hid1i39ahrmghaslpj9n36zna72i3ah7kf1bh2l01"))))
485 (build-system ruby-build-system)
487 '(#:phases (modify-phases %standard-phases
488 (replace 'build ; no gemspec
489 (lambda _ (zero? (system* "rake" "gem")))))))
491 `(("ruby-hoe" ,ruby-hoe)))
492 (synopsis "Small test suite library for Ruby")
493 (description "Minitest provides a complete suite of Ruby testing
494 facilities supporting TDD, BDD, mocking, and benchmarking.")
495 (home-page "https://github.com/seattlerb/minitest")
496 (license license:expat)))
498 (define-public ruby-minitest-sprint
500 (name "ruby-minitest-sprint")
504 ;; Same story as ruby-minitest.
506 (url "https://github.com/seattlerb/minitest-sprint.git")
510 "0rbmxz94lqg5vjz60p8v2bzq8adwvmx501amvk0l124sfwmw94ms"))))
511 (build-system ruby-build-system)
513 '(#:phases (modify-phases %standard-phases
514 (replace 'build ; no gemspec
515 (lambda _ (zero? (system* "rake" "gem")))))))
517 `(("ruby-hoe" ,ruby-hoe)
518 ("ruby-minitest" ,ruby-minitest)))
519 (synopsis "Fast test suite runner for minitest")
520 (description "Minitest-sprint is a test runner for minitest that makes it
521 easier to re-run individual failing tests.")
522 (home-page "https://github.com/seattlerb/minitest-sprint")
523 (license license:expat)))
525 (define-public ruby-minitest-bacon
527 (name "ruby-minitest-bacon")
531 ;; Same story as ruby-minitest.
533 (url "https://github.com/seattlerb/minitest-bacon.git")
537 "19r9fm41i0mm1xncqls8frbj1i9nr3sq1cx2mh878r6kdl02d70h"))))
538 (build-system ruby-build-system)
540 '(#:phases (modify-phases %standard-phases
541 (replace 'build ; no gemspec
542 (lambda _ (zero? (system* "rake" "gem")))))))
544 `(("ruby-hoe" ,ruby-hoe)))
546 `(("ruby-minitest" ,ruby-minitest)))
547 (synopsis "Bacon compatibility library for minitest")
548 (description "Minitest-bacon extends minitest with bacon-like
549 functionality, making it easier to migrate test suites from bacon to minitest.")
550 (home-page "https://github.com/seattlerb/minitest-bacon")
551 (license license:expat)))
553 (define-public ruby-daemons
555 (name "ruby-daemons")
560 "https://github.com/thuehlinger/daemons/archive/v"
562 (file-name (string-append name "-" version ".tar.gz"))
565 "1v5bpdvpvhk240pc7fkn44vfclppl44pp6wd42ipi5sd5lkk7zfd"))))
566 (build-system ruby-build-system)
568 `(#:tests? #f)) ; no test suite
569 (synopsis "Daemonize Ruby programs")
570 (description "Daemons provides a way to wrap existing Ruby scripts to be
571 run as a daemon and to be controlled by simple start/stop/restart commands.")
572 (home-page "https://github.com/thuehlinger/daemons")
573 (license license:expat)))
575 (define-public ruby-git
582 "https://github.com/schacon/ruby-git/archive/v"
584 (file-name (string-append name "-" version ".tar.gz"))
587 "08zg20zc7f7yy34ix2qdd8jbiz7xhjc8alk370869sq3h75hs9jc"))))
588 (build-system ruby-build-system)
590 '(#:phases (modify-phases %standard-phases
591 (add-before 'build 'patch-git-binary
592 (lambda* (#:key inputs #:allow-other-keys)
593 ;; Make the default git binary an absolute path to the
595 (let ((git (string-append (assoc-ref inputs "git")
597 (substitute* '("lib/git/config.rb")
599 (string-append "'" git "'")))
600 ;; Fix a test that expects the binary to be simply
602 (substitute* '("tests/units/test_logger.rb")
606 "Git::Base.config.binary_path = 'git'")))
608 (add-before 'check 'create-fake-home
610 ;; The test suite runs 'git config --global' commands,
611 ;; so a fake home directory is needed for them to
613 (let ((fake-home (string-append (getcwd) "/fake-home")))
615 (setenv "HOME" fake-home)))))))
618 (synopsis "Ruby wrappers for Git")
619 (description "Ruby/Git is a Ruby library that can be used to create, read
620 and manipulate Git repositories by wrapping system calls to the git binary.")
621 (home-page "https://github.com/schacon/ruby-git")
622 (license license:expat)))
624 (define-public ruby-slop
631 "https://github.com/leejarvis/slop/archive/v"
633 (file-name (string-append name "-" version ".tar.gz"))
636 "0cqs50a0b99kjd19xpln8jpnki07cjyp3l7wxbfr44ycasr6nznh"))))
637 (build-system ruby-build-system)
639 `(("ruby-minitest" ,ruby-minitest)))
640 (synopsis "Ruby command line option parser")
641 (description "Slop provides a Ruby domain specific language for gathering
642 options and parsing command line flags.")
643 (home-page "https://github.com/leejarvis/slop")
644 (license license:expat)))