From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pjotr Prins Subject: Re: [PATCH] build: ruby: Add 'gem-flags' key to ruby build system Date: Fri, 17 Jul 2015 23:05:21 +0200 Message-ID: <20150717210521.GA18343@thebird.nl> References: <20150713134451.GA29236@thebird.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46430) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGCq4-00046h-3h for guix-devel@gnu.org; Fri, 17 Jul 2015 17:06:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGCpy-000821-Vb for guix-devel@gnu.org; Fri, 17 Jul 2015 17:06:36 -0400 Received: from mail.thebird.nl ([95.154.246.10]:56039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGCpy-00080i-Po for guix-devel@gnu.org; Fri, 17 Jul 2015 17:06:30 -0400 Content-Disposition: inline In-Reply-To: <20150713134451.GA29236@thebird.nl> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Pjotr Prins Cc: guix-devel Can this patch go in? I sent it 4 days ago. It allows building extensions for Ruby gems, by passing in flags to gem, as shown in the Nokogiri patch. Even without accepting Nokogiri, this is valuable for building and installing gems. Pj. On Mon, Jul 13, 2015 at 03:44:51PM +0200, Pjotr Prins wrote: > Introducing gem-flags in preparation of ruby-nokogiri package > > * guix/build-system/ruby.scm (build): add 'gem-flags' key > * guix/build/ruby-build-system.scm (build): use 'gem-flags' key > > (this looks clean to me...) > > 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 > --