From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Woodcroft Subject: [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure'. Date: Sun, 22 May 2016 09:17:00 +1000 Message-ID: <1463872621-17738-2-git-send-email-donttrustben@gmail.com> References: <1463872621-17738-1-git-send-email-donttrustben@gmail.com> Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60776) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4G9A-0004mV-Nn for guix-devel@gnu.org; Sat, 21 May 2016 19:17:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b4G91-0003l0-MB for guix-devel@gnu.org; Sat, 21 May 2016 19:17:28 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:32895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b4G91-0003ku-DH for guix-devel@gnu.org; Sat, 21 May 2016 19:17:19 -0400 Received: by mail-pf0-x242.google.com with SMTP id y7so14933886pfb.0 for ; Sat, 21 May 2016 16:17:19 -0700 (PDT) Received: from localhost.localdomain ([103.25.181.216]) by smtp.googlemail.com with ESMTPSA id e7sm36354692pfa.28.2016.05.21.16.17.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 21 May 2016 16:17:17 -0700 (PDT) In-Reply-To: <1463872621-17738-1-git-send-email-donttrustben@gmail.com> 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" To: guix-devel@gnu.org * guix/build/ruby-build-system.scm [build]: Move extraction from here ... [configure]: ... to here. New variable. [first-gemspec]: New variable. [standard-phases]: Add 'configure'. --- guix/build/ruby-build-system.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm index a4ac3b3..1861010 100644 --- a/guix/build/ruby-build-system.scm +++ b/guix/build/ruby-build-system.scm @@ -66,14 +66,13 @@ directory." ;; Use GNU unpack strategy for things that aren't gem archives. (gnu:unpack #:source source))) -(define* (build #:key source #:allow-other-keys) - "Build a new gem using the gemspec from the SOURCE gem." - (define (first-gemspec) - (first-matching-file "\\.gemspec$")) +(define (first-gemspec) + (first-matching-file "\\.gemspec$")) - ;; Remove the original gemspec, if present, and replace it with a new one. - ;; This avoids issues with upstream gemspecs requiring tools such as git to - ;; generate the files list. +(define* (configure #:key source #:allow-other-keys) + "Remove the original gemspec, if present, and replace it with a new one. +This avoids issues with upstream gemspecs requiring tools such as git to +generate the files list." (when (gem-archive? source) (let ((gemspec (or (false-if-exception (first-gemspec)) ;; Make new gemspec if one wasn't shipped. @@ -94,7 +93,10 @@ directory." (write-char (read-char pipe) out)))) #t) (lambda () - (close-pipe pipe)))))) + (close-pipe pipe))))))) + +(define* (build #:key source #:allow-other-keys) + "Build a new gem using the gemspec from the SOURCE gem." ;; Build a new gem from the current working directory. This also allows any ;; dynamic patching done in previous phases to be present in the installed @@ -133,7 +135,7 @@ GEM-FLAGS are passed to the 'gem' invokation, if present." (define %standard-phases (modify-phases gnu:%standard-phases - (delete 'configure) + (replace 'configure configure) (replace 'build build) (replace 'unpack unpack) (replace 'install install) -- 2.7.4