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 autotools)
28 #:use-module (gnu packages libffi)
29 #:use-module (gnu packages gdbm)
30 #:use-module (gnu packages tls)
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-2.1
92 (package (inherit ruby)
97 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
98 (version-major+minor version)
99 "/ruby-" version ".tar.bz2"))
102 "1sbcmbhadcxk0509svwxbm2vvgmpf3xjxr1397bgp9x46nz36lkv"))))
104 `(#:test-target "test"
108 'configure 'replace-bin-sh
110 (substitute* '("Makefile.in"
115 (("/bin/sh") (which "sh"))))
118 (list (search-path-specification
119 (variable "GEM_PATH")
120 (files (list (string-append "lib/ruby/gems/"
121 (version-major+minor version)
124 (define-public ruby-1.8
125 (package (inherit ruby)
126 (version "1.8.7-p374")
130 (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
131 (version-major+minor version)
132 "/ruby-" version ".tar.bz2"))
135 "1qq7khilwkayrhwmzlxk83scrmiqfi7lgsn4c63znyvz2c1lgqxl"))))
136 (native-search-paths '())
138 `(#:test-target "test"
142 'configure 'replace-bin-sh
144 (substitute* '("Makefile.in"
149 (("/bin/sh") (which "sh"))))
150 %standard-phases)))))
152 (define-public ruby-hoe
159 (url "https://github.com/seattlerb/hoe.git")
160 (commit "0c11836"))) ; no release tags :(
163 "0i8dimf8kxcjgqj9x65bbi3l6hc9p9gbfbb1vmrz42764a4jjbz9"))) )
164 (build-system ruby-build-system)
166 '(#:phases (alist-replace
168 (lambda _ (zero? (system* "rake" "gem")))
170 (synopsis "Ruby project management helper")
172 "Hoe is a rake/rubygems helper for project Rakefiles. It helps manage,
173 maintain, and release projects and includes a dynamic plug-in system allowing
174 for easy extensibility. Hoe ships with plug-ins for all the usual project
175 tasks including rdoc generation, testing, packaging, deployment, and
177 (home-page "http://www.zenspider.com/projects/hoe.html")
178 (license license:expat)))
180 (define-public ruby-rake-compiler
182 (name "ruby-rake-compiler")
187 "https://github.com/rake-compiler/rake-compiler/archive/v"
189 (file-name (string-append name "-" version ".tar.gz"))
192 "07lk1vl0jqcaqwjjhmg0qshqwcxdyr5kscc9xxm13m03835xgpf3"))))
193 (build-system ruby-build-system)
195 '(#:tests? #f ; needs cucumber
196 #:phases (modify-phases %standard-phases
197 (add-before 'build 'remove-cucumber-rake-task
199 ;; Remove cucumber test file because the
200 ;; dependencies are not available right now.
201 (delete-file "tasks/cucumber.rake")))
203 (lambda _ (zero? (system* "rake" "gem")))))))
204 (synopsis "Building and packaging helper for Ruby native extensions")
205 (description "Rake-compiler proivides a framework for building and
206 packaging native C and Java extensions in Ruby.")
207 (home-page "https://github.com/rake-compiler/rake-compiler")
208 (license license:expat)))
210 (define-public ruby-i18n
216 (uri (string-append "https://github.com/svenfuchs/i18n/archive/v"
218 (file-name (string-append name "-" version ".tar.gz"))
221 "1fdhnhh1p5g8vibv44d770z8nq208zrms3m2nswdvr54072y1m6k"))))
222 (build-system ruby-build-system)
224 '(#:tests? #f)) ; requires bundler
225 (synopsis "Internationalization library for Ruby")
226 (description "Ruby i18n is an internationalization and localization
227 solution for Ruby programs. It features translation and localization,
228 interpolation of values to translations, pluralization, customizable
229 transliteration to ASCII, flexible defaults, bulk lookup, lambdas as
230 translation data, custom key/scope separator, custom exception handlers, and
231 an extensible architecture with a swappable backend.")
232 (home-page "http://github.com/svenfuchs/i18n")
233 (license license:expat)))
235 ;; RSpec is the dominant testing library for Ruby projects. Even RSpec's
236 ;; dependencies use RSpec for their test suites! To avoid these circular
237 ;; dependencies, we disable tests for all of the RSpec-related packages.
238 (define ruby-rspec-support
240 (name "ruby-rspec-support")
245 "https://github.com/rspec/rspec-support/archive/v"
247 (file-name (string-append name "-" version ".tar.gz"))
250 "1pvzfrqgy0z0gwmdgjp9f2vz1d9c0cajyzfqj9z8i2ssxnzmj4bv"))))
251 (build-system ruby-build-system)
253 '(#:tests? #f)) ; avoid dependency cycles
254 (synopsis "RSpec support library")
255 (description "Support utilities for RSpec gems.")
256 (home-page "https://github.com/rspec/rspec-support")
257 (license license:expat)))
259 (define-public ruby-rspec-core
261 (name "ruby-rspec-core")
266 "https://github.com/rspec/rspec-core/archive/v"
268 (file-name (string-append name "-" version ".tar.gz"))
271 "1clsa4lkh5c9c7xc3xa336ym00ycr67pchpg1bv4y3fz5hvzw8ki"))))
272 (build-system ruby-build-system)
274 '(#:tests? #f)) ; avoid dependency cycles
276 `(("ruby-rspec-support" ,ruby-rspec-support)))
277 (synopsis "RSpec core library")
278 (description "Rspec-core provides the RSpec test runner and example
280 (home-page "https://github.com/rspec/rspec-core")
281 (license license:expat)))
283 (define ruby-diff-lcs-for-rspec
285 (name "ruby-diff-lcs")
290 "https://github.com/halostatue/diff-lcs/archive/v"
292 (file-name (string-append name "-" version ".tar.gz"))
295 "0kmfz2qdwbfjf97rx27hh9fm39mv3z9avjmvsajqnb5wxj2l5l4s"))))
296 (build-system ruby-build-system)
298 '(#:tests? #f)) ; avoid dependency cycles
299 (synopsis "Compute the difference between two Enumerable sequences")
300 (description "Diff::LCS computes the difference between two Enumerable
301 sequences using the McIlroy-Hunt longest common subsequence (LCS) algorithm.
302 It includes utilities to create a simple HTML diff output format and a
303 standard diff-like tool.")
304 (home-page "https://github.com/halostatue/diff-lcs")
305 (license license:expat)))
307 (define-public ruby-rspec-expectations
309 (name "ruby-rspec-expectations")
314 "https://github.com/rspec/rspec-expectations/archive/v"
316 (file-name (string-append name "-" version ".tar.gz"))
319 "0h0rpprbh6h59gmksiyi1b8w6cvcai4wdbkikajwx3w1asxi6f7x"))))
320 (build-system ruby-build-system)
322 '(#:tests? #f)) ; avoid dependency cycles
324 `(("ruby-rspec-support" ,ruby-rspec-support)
325 ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec)))
326 (synopsis "RSpec expecations library")
327 (description "Rspec-expectations provides a simple API to express expected
328 outcomes of a code example.")
329 (home-page "https://github.com/rspec/rspec-expectations")
330 (license license:expat)))
332 (define-public ruby-rspec-mocks
334 (name "ruby-rspec-mocks")
339 "https://github.com/rspec/rspec-mocks/archive/v"
341 (file-name (string-append name "-" version ".tar.gz"))
344 "1xzxsg0idxkg7czmjgqq10lcd821ibw1hjzn404sk9j6rw0fbx2g"))))
345 (build-system ruby-build-system)
347 '(#:tests? #f)) ; avoid dependency cycles
349 `(("ruby-rspec-support" ,ruby-rspec-support)
350 ("ruby-diff-lcs" ,ruby-diff-lcs-for-rspec)))
351 (synopsis "RSpec stubbing and mocking library")
352 (description "Rspec-mocks provides RSpec's \"test double\" framework, with
353 support for stubbing and mocking.")
354 (home-page "https://github.com/rspec/rspec-mocks")
355 (license license:expat)))
357 (define-public ruby-rspec
364 "https://github.com/rspec/rspec/archive/v"
366 (file-name (string-append name "-" version ".tar.gz"))
369 "1jg38dbaknsdhiav5vnrwfccg524fwcg6sq1715441vx1xl6p54q"))))
370 (build-system ruby-build-system)
372 '(#:tests? #f)) ; avoid dependency cycles
374 `(("ruby-rspec-core" ,ruby-rspec-core)
375 ("ruby-rspec-mocks" ,ruby-rspec-mocks)
376 ("ruby-rspec-expectations" ,ruby-rspec-expectations)))
377 (synopsis "Behavior-driven development framework for Ruby")
378 (description "RSpec is a behavior-driven development (BDD) framework for
379 Ruby. This meta-package includes the RSpec test runner, along with the
380 expectations and mocks frameworks.")
381 (home-page "http://rspec.info/")
382 (license license:expat)))
384 ;; Bundler is yet another source of circular dependencies, so we must disable
385 ;; its test suite as well.
386 (define-public bundler
392 (uri (string-append "https://github.com/bundler/bundler/archive/v"
394 (file-name (string-append name "-" version ".tar.gz"))
397 "08flx3n9hb3yz8mm5k16cdz0sb7g774f6vxn6gc3wfh5la83vfyx"))))
398 (build-system ruby-build-system)
400 '(#:tests? #f)) ; avoid dependency cycles
401 (synopsis "Ruby gem bundler")
402 (description "Bundler automatically downloads and installs a list of gems
403 specified in a \"Gemfile\", as well as their dependencies.")
404 (home-page "http://bundler.io/")
405 (license license:expat)))
407 (define-public ruby-useragent
409 (name "ruby-useragent")
414 "https://github.com/gshutler/useragent/archive/v"
416 (file-name (string-append name "-" version ".tar.gz"))
419 "1hj00fw06i0y3rwxxhxmnrqxhpnffv4zfqx2sqqpc5qc4fdvd2x9"))))
420 (build-system ruby-build-system)
422 '(#:test-target "spec"))
424 `(("ruby-rspec" ,ruby-rspec)
425 ("bundler" ,bundler)))
426 (synopsis "HTTP user agent parser for Ruby")
427 (description "UserAgent is a Ruby library that parses and compares HTTP
429 (home-page "https://github.com/gshutler/useragent")
430 (license license:expat)))
432 (define-public ruby-bacon
439 "https://github.com/chneukirchen/bacon/archive/"
441 (file-name (string-append name "-" version ".tar.gz"))
444 "0g03fxilrrx17dijww68n1lq5d8s69hrxgpga8c1i2k35bzcw5jc"))))
445 (build-system ruby-build-system)
447 `(#:phases (modify-phases %standard-phases
448 (add-before 'build 'generate-docs
450 ;; This rake task also tries to generate a ChangeLog
451 ;; file from the Git log, which we don't have. It fails
452 ;; but creates an empty file, allowing the rest of the
454 (zero? (system* "rake" "predist")))))))
455 (synopsis "Small RSpec clone")
456 (description "Bacon is a small RSpec clone providing all essential
458 (home-page "https://github.com/chneukirchen/bacon")
459 (license license:expat)))
461 (define-public ruby-arel
468 "https://github.com/rails/arel/archive/v"
470 (file-name (string-append name "-" version ".tar.gz"))
473 "0fldwp2hmrmddx22xf7hdmybngzv97qnv5rvz3qw61m94ddd6w4n"))))
474 (build-system ruby-build-system)
476 `(("bundler" ,bundler)))
477 (synopsis "SQL AST manager for Ruby")
478 (description "Arel is a SQL AST manager for Ruby. It simplifies the
479 generation of complex SQL queries and adapts to various relational database
481 (home-page "https://github.com/rails/arel")
482 (license license:expat)))
484 (define-public ruby-connection-pool
486 (name "ruby-connection-pool")
491 "https://github.com/mperham/connection_pool/archive/v"
493 (file-name (string-append name "-" version ".tar.gz"))
496 "02s5rwhmgy8qqns7a5y1daa0yaw38x6lzpwyvmy46h1yrj9mc6zf"))))
497 (build-system ruby-build-system)
499 `(("bundler" ,bundler)))
500 (synopsis "Generic connection pool for Ruby")
501 (description "Connection_pool provides a generic connection pooling
502 interface for Ruby programs.")
503 (home-page "https://github.com/mperham/connection_pool")
504 (license license:expat)))
506 (define-public ruby-net-http-persistent
508 (name "ruby-net-http-persistent")
513 "https://github.com/drbrain/net-http-persistent/archive/v"
515 (file-name (string-append name "-" version ".tar.gz"))
518 "1q18vji31w8gfr6ajziqkqs8n5lzkw0bl00dm2a8s05zhavzw9j9"))))
519 (build-system ruby-build-system)
521 '(#:phases (modify-phases %standard-phases
522 (replace 'build ; no gemspec
523 (lambda _ (zero? (system* "rake" "gem")))))))
525 `(("ruby-connection-pool" ,ruby-connection-pool)
526 ("ruby-hoe" ,ruby-hoe)))
527 (synopsis "Persistent HTTP connection manager")
528 (description "Net::HTTP::Persistent manages persistent HTTP connections
529 using Net::HTTP, supporting reconnection and retry according to RFC 2616.")
530 (home-page "https://github.com/drbrain/net-http-persistent")
531 (license license:expat)))
533 (define-public ruby-minitest
535 (name "ruby-minitest")
539 ;; No release tarballs nor git tags. This is the commit
540 ;; corresponding to the addition of the release notes to
543 (url "https://github.com/seattlerb/minitest.git")
547 "09xjiahk7q8hid1i39ahrmghaslpj9n36zna72i3ah7kf1bh2l01"))))
548 (build-system ruby-build-system)
550 '(#:phases (modify-phases %standard-phases
551 (replace 'build ; no gemspec
552 (lambda _ (zero? (system* "rake" "gem")))))))
554 `(("ruby-hoe" ,ruby-hoe)))
555 (synopsis "Small test suite library for Ruby")
556 (description "Minitest provides a complete suite of Ruby testing
557 facilities supporting TDD, BDD, mocking, and benchmarking.")
558 (home-page "https://github.com/seattlerb/minitest")
559 (license license:expat)))
561 (define-public ruby-minitest-sprint
563 (name "ruby-minitest-sprint")
567 ;; Same story as ruby-minitest.
569 (url "https://github.com/seattlerb/minitest-sprint.git")
573 "0rbmxz94lqg5vjz60p8v2bzq8adwvmx501amvk0l124sfwmw94ms"))))
574 (build-system ruby-build-system)
576 '(#:phases (modify-phases %standard-phases
577 (replace 'build ; no gemspec
578 (lambda _ (zero? (system* "rake" "gem")))))))
580 `(("ruby-hoe" ,ruby-hoe)
581 ("ruby-minitest" ,ruby-minitest)))
582 (synopsis "Fast test suite runner for minitest")
583 (description "Minitest-sprint is a test runner for minitest that makes it
584 easier to re-run individual failing tests.")
585 (home-page "https://github.com/seattlerb/minitest-sprint")
586 (license license:expat)))
588 (define-public ruby-minitest-bacon
590 (name "ruby-minitest-bacon")
594 ;; Same story as ruby-minitest.
596 (url "https://github.com/seattlerb/minitest-bacon.git")
600 "19r9fm41i0mm1xncqls8frbj1i9nr3sq1cx2mh878r6kdl02d70h"))))
601 (build-system ruby-build-system)
603 '(#:phases (modify-phases %standard-phases
604 (replace 'build ; no gemspec
605 (lambda _ (zero? (system* "rake" "gem")))))))
607 `(("ruby-hoe" ,ruby-hoe)))
609 `(("ruby-minitest" ,ruby-minitest)))
610 (synopsis "Bacon compatibility library for minitest")
611 (description "Minitest-bacon extends minitest with bacon-like
612 functionality, making it easier to migrate test suites from bacon to minitest.")
613 (home-page "https://github.com/seattlerb/minitest-bacon")
614 (license license:expat)))
616 (define-public ruby-daemons
618 (name "ruby-daemons")
623 "https://github.com/thuehlinger/daemons/archive/v"
625 (file-name (string-append name "-" version ".tar.gz"))
628 "1v5bpdvpvhk240pc7fkn44vfclppl44pp6wd42ipi5sd5lkk7zfd"))))
629 (build-system ruby-build-system)
631 `(#:tests? #f)) ; no test suite
632 (synopsis "Daemonize Ruby programs")
633 (description "Daemons provides a way to wrap existing Ruby scripts to be
634 run as a daemon and to be controlled by simple start/stop/restart commands.")
635 (home-page "https://github.com/thuehlinger/daemons")
636 (license license:expat)))
638 (define-public ruby-git
645 "https://github.com/schacon/ruby-git/archive/v"
647 (file-name (string-append name "-" version ".tar.gz"))
650 "08zg20zc7f7yy34ix2qdd8jbiz7xhjc8alk370869sq3h75hs9jc"))))
651 (build-system ruby-build-system)
653 '(#:phases (modify-phases %standard-phases
654 (add-before 'build 'patch-git-binary
655 (lambda* (#:key inputs #:allow-other-keys)
656 ;; Make the default git binary an absolute path to the
658 (let ((git (string-append (assoc-ref inputs "git")
660 (substitute* '("lib/git/config.rb")
662 (string-append "'" git "'")))
663 ;; Fix a test that expects the binary to be simply
665 (substitute* '("tests/units/test_logger.rb")
669 "Git::Base.config.binary_path = 'git'")))
671 (add-before 'check 'create-fake-home
673 ;; The test suite runs 'git config --global' commands,
674 ;; so a fake home directory is needed for them to
676 (let ((fake-home (string-append (getcwd) "/fake-home")))
678 (setenv "HOME" fake-home)))))))
681 (synopsis "Ruby wrappers for Git")
682 (description "Ruby/Git is a Ruby library that can be used to create, read
683 and manipulate Git repositories by wrapping system calls to the git binary.")
684 (home-page "https://github.com/schacon/ruby-git")
685 (license license:expat)))
687 (define-public ruby-slop
694 "https://github.com/leejarvis/slop/archive/v"
696 (file-name (string-append name "-" version ".tar.gz"))
699 "0cqs50a0b99kjd19xpln8jpnki07cjyp3l7wxbfr44ycasr6nznh"))))
700 (build-system ruby-build-system)
702 `(("ruby-minitest" ,ruby-minitest)))
703 (synopsis "Ruby command line option parser")
704 (description "Slop provides a Ruby domain specific language for gathering
705 options and parsing command line flags.")
706 (home-page "https://github.com/leejarvis/slop")
707 (license license:expat)))
709 (define-public ruby-multipart-post
711 (name "ruby-multipart-post")
716 "https://github.com/nicksieger/multipart-post/archive/v"
718 (file-name (string-append name "-" version ".tar.gz"))
721 "03n271i3knfx4j9aingxzz2bajd379dw9nswsllviqc177lq1anm"))))
722 (build-system ruby-build-system)
724 `(("bundler" ,bundler)))
725 (synopsis "Multipart POST library for Ruby")
726 (description "Multipart-Post Adds multipart POST capability to Ruby's
728 (home-page "https://github.com/nicksieger/multipart-post")
729 (license license:expat)))