aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi3
-rw-r--r--guix/build-system/ruby.scm2
-rw-r--r--guix/build/ruby-build-system.scm12
3 files changed, 11 insertions, 6 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 0d24b12f8c..71b3b2d529 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2458,7 +2458,8 @@ implements the RubyGems build procedure used by Ruby packages, which
involves running @code{gem build} followed by @code{gem install}.
Which Ruby package is used can be specified with the @code{#:ruby}
-parameter.
+parameter. A list of additional flags to be passed to the @command{gem}
+command can be specified with the @code{#:gem-flags} parameter.
@end defvr
@defvr {Scheme Variable} waf-build-system
diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm
index e4fda30cf3..135eda665b 100644
--- a/guix/build-system/ruby.scm
+++ b/guix/build-system/ruby.scm
@@ -71,6 +71,7 @@
(define* (ruby-build store name inputs
#:key
+ (gem-flags ''())
(test-target "test")
(tests? #t)
(phases '(@ (guix build ruby-build-system)
@@ -95,6 +96,7 @@
(source
source))
#:system ,system
+ #:gem-flags ,gem-flags
#:test-target ,test-target
#:tests? ,tests?
#:phases ,phases
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index fce39b8dfd..307ac919dd 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -63,7 +63,8 @@ directory."
(zero? (system* "rake" test-target))
#t))
-(define* (install #:key source inputs outputs #:allow-other-keys)
+(define* (install #:key source inputs outputs (gem-flags '())
+ #:allow-other-keys)
(let* ((ruby-version
(match:substring (string-match "ruby-(.*)\\.[0-9]$"
(assoc-ref inputs "ruby"))
@@ -72,10 +73,11 @@ directory."
(gem-home (string-append out "/lib/ruby/gems/" ruby-version ".0")))
(setenv "GEM_HOME" gem-home)
(mkdir-p gem-home)
- (zero? (system* "gem" "install" "--local"
- (first-matching-file "\\.gem$")
- ;; Executables should go into /bin, not /lib/ruby/gems.
- "--bindir" (string-append out "/bin")))))
+ (zero? (apply system* "gem" "install" "--local"
+ (first-matching-file "\\.gem$")
+ ;; Executables should go into /bin, not /lib/ruby/gems.
+ "--bindir" (string-append out "/bin")
+ gem-flags))))
(define %standard-phases
(modify-phases gnu:%standard-phases