ruby: Abstract out path to GEM_HOME.

Previously paths to the GEM_HOME of certain Ruby packages were
hard-coded, so packages failed to build when Ruby was updated to 2.3.0.

* guix/build/ruby-build-system.scm (gem-home): New procedure.
* gnu/packages/ruby.scm (ruby-metaclass, ruby-instantiator,
ruby-introspection, ruby-mocha, ruby-minitest-tu-shim): Use it.
This commit is contained in:
Ben Woodcroft 2016-01-08 17:29:39 +10:00
parent 048036aee5
commit 761e7042f6
2 changed files with 67 additions and 40 deletions

View file

@ -26,7 +26,8 @@
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-26)
#:export (%standard-phases
ruby-build))
ruby-build
gem-home))
;; Commentary:
;;
@ -136,3 +137,13 @@ GEM-FLAGS are passed to the 'gem' invokation, if present."
(define* (ruby-build #:key inputs (phases %standard-phases)
#:allow-other-keys #:rest args)
(apply gnu:gnu-build #:inputs inputs #:phases phases args))
(define (gem-home store-path ruby-version)
"Return a string to the gem home directory in the store given a STORE-PATH
and the RUBY-VERSION used to build that ruby package"
(string-append
store-path
"/lib/ruby/gems/"
(regexp-substitute #f
(string-match "^[0-9]+\\.[0-9]+" ruby-version)
0 ".0")))