aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2018-02-05 11:41:14 +0100
committerChristopher Baines <mail@cbaines.net>2019-04-28 21:12:16 +0100
commitacff893bb9fdad69971b09d65555c10ecfc4f1fa (patch)
tree36b880488742c72ceb6b83dcf19f350756f70ade
parent1f44856671eea539b6f6ff362609e6fae7b1da78 (diff)
downloadguix-wip-rails-extra-packages-updated.tar
guix-wip-rails-extra-packages-updated.tar.gz
gnu: Add ruby-bzip2-ruby.wip-rails-extra-packages-updated
-rw-r--r--gnu/packages/ruby.scm62
1 files changed, 62 insertions, 0 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 71a01daaa0..8c059fa9f0 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -919,6 +919,68 @@ next patch version for example.")
(home-page "https://github.com/gregorym/bump")
(license license:expat)))
+(define-public ruby-bzip2-ruby
+ ;; Use git reference because gem is out of date.
+ (let ((revision "1")
+ (commit "e58f154624ff2d770e92a70e0d8fb1a9e6564720"))
+ (package
+ (name "ruby-bzip2-ruby")
+ (version (string-append "0.2.7." revision "." commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/brianmario/bzip2-ruby.git")
+ (commit commit)))
+ (file-name (string-append name "-" version "-checkout"))
+ (sha256
+ (base32
+ "072jzd1fm6z0fnc166q7n4h8h4vrb9jhpcl7swh7d0qm4fx4cxvz"))))
+ (build-system ruby-build-system)
+ (arguments
+ '(#:test-target "spec"
+ #:gem-flags
+ (list "--"
+ (string-append "--with-bz2-dir="
+ (assoc-ref %build-inputs "bzip2")
+ "/include/" ))
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'patch-gemspec-and-source
+ (lambda _
+ (substitute* "bzip2-ruby.gemspec"
+ (("s.files = `git ls-files`") "s.files = `find *`")
+ (("s.test_files = `git ls-files spec`")
+ "s.files = `find spec`"))
+ ;; Use part of the patch proposed at
+ ;; https://github.com/brianmario/bzip2-ruby/pull/26
+ (substitute* "ext/bzip2/writer.c"
+ (("RBASIC\\(res\\)->klass = rb_cString;")
+ "RBASIC_SET_CLASS(res, rb_cString);"))
+ #t))
+ (delete 'check)
+ (add-after 'install 'check
+ (lambda* (#:key tests? outputs #:allow-other-keys)
+ (setenv "GEM_PATH"
+ (string-append
+ (getenv "GEM_PATH")
+ ":"
+ (assoc-ref outputs "out") "/lib/ruby/vendor_ruby"))
+ (when tests?
+ (invoke "rspec"))
+ #t)))))
+ (inputs
+ `(("bzip2" ,bzip2)))
+ (native-inputs
+ `(("bundler" ,bundler)
+ ("ruby-rspec" ,ruby-rspec-2)
+ ("ruby-rake-compiler" ,ruby-rake-compiler)))
+ (synopsis "Ruby C bindings to libbzip2.")
+ (description "Ruby C bindings to libbzip2.")
+ (home-page
+ "http://github.com/brianmario/bzip2-ruby")
+ (license #f))))
+
(define-public ruby-rjb
(package
(name "ruby-rjb")