From 6e9f2913ba800e3488b95c661438f3981095a259 Mon Sep 17 00:00:00 2001 From: pjotrp Date: Mon, 13 Jul 2015 15:32:36 +0200 Subject: [PATCH] build-system/ruby: Add #:gem-flags parameter. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build-system/ruby.scm (build): add 'gem-flags' key * guix/build/ruby-build-system.scm (build): use 'gem-flags' key * doc/guix.texi (Build Systems): Mention #:gem-flags. Co-authored-by: Ludovic Courtès --- doc/guix.texi | 3 ++- guix/build-system/ruby.scm | 2 ++ guix/build/ruby-build-system.scm | 12 +++++++----- 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