From ce8cfeadc8a661ff0fe0b96dc241d0063ed49ba3 Mon Sep 17 00:00:00 2001 From: pjotrp Date: Mon, 13 Jul 2015 15:32:36 +0200 Subject: [PATCH] build: ruby: Add 'gem-flags' key to ruby build system * guix/build-system/ruby.scm (build): add 'gem-flags' key * guix/build/ruby-build-system.scm (build): use 'gem-flags' key --- guix/build-system/ruby.scm | 2 ++ guix/build/ruby-build-system.scm | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/guix/build-system/ruby.scm b/guix/build-system/ruby.scm index e4fda30..d601700 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 fce39b8..9cbc8a5 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")) @@ -73,9 +74,11 @@ directory." (setenv "GEM_HOME" gem-home) (mkdir-p gem-home) (zero? (system* "gem" "install" "--local" - "--bindir" (string-append out "/bin"))))) + "--bindir" (string-append out "/bin") "--" + (string-join (cond (null? gem-flags)('())(gem-flags))))))) (define %standard-phases (modify-phases gnu:%standard-phases -- 1.7.10.4