unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH 0/2]: ruby-build-system: Extract gemspec during configure.
@ 2016-05-21 23:16 Ben Woodcroft
  2016-05-21 23:17 ` [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure' Ben Woodcroft
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Ben Woodcroft @ 2016-05-21 23:16 UTC (permalink / raw)
  To: guix-devel

Previously the gemspec was extracted during the build phase.  The problem was
that this was then immediately used to build the gem, leaving no ability to
modify it before building (without replacing the entire phase).  I figure building a gemspec is kind of like a
configure, so made the extraction step the configure step.

I built quite a few ruby packages and didn't come across an error, but this
does require a rebuild of all ruby packages.

The first patch makes the change, and the second is an example of how it can
be useful.

Thanks in advance for the review.
ben

[PATCH 1/2] guix: ruby-build-system: Extract gemspec during configure.
[PATCH 2/2] gnu: ruby-nokogiri: Update to 1.6.7.2.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure'.
  2016-05-21 23:16 [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Ben Woodcroft
@ 2016-05-21 23:17 ` Ben Woodcroft
  2016-05-24 12:14   ` Ricardo Wurmus
  2016-05-21 23:17 ` [PATCH 2/2] gnu: ruby-nokogiri: Update to 1.6.7.2 Ben Woodcroft
  2016-05-22  2:14 ` [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Thompson, David
  2 siblings, 1 reply; 7+ messages in thread
From: Ben Woodcroft @ 2016-05-21 23:17 UTC (permalink / raw)
  To: guix-devel

* 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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] gnu: ruby-nokogiri: Update to 1.6.7.2.
  2016-05-21 23:16 [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Ben Woodcroft
  2016-05-21 23:17 ` [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure' Ben Woodcroft
@ 2016-05-21 23:17 ` Ben Woodcroft
  2016-05-22  2:14 ` [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Thompson, David
  2 siblings, 0 replies; 7+ messages in thread
From: Ben Woodcroft @ 2016-05-21 23:17 UTC (permalink / raw)
  To: guix-devel

* gnu/packages/ruby.scm (ruy-nokogiri): Update to 1.6.7.2.
[arguments]: Relax 'mini_portile2' dependency.
---
 gnu/packages/ruby.scm | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 6c2e08f..7958089 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1882,13 +1882,13 @@ to reproduce user environments.")
 (define-public ruby-nokogiri
   (package
     (name "ruby-nokogiri")
-    (version "1.6.7.1")
+    (version "1.6.7.2")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "nokogiri" version))
               (sha256
                (base32
-                "12nwv3lad5k2k73aa1d1xy4x577c143ixks6rs70yp78sinbglk2"))))
+                "11sbmpy60ynak6s3794q32lc99hs448msjy8rkp84ay7mq7zqspv"))))
     (build-system ruby-build-system)
     (arguments
      ;; Tests fail because Nokogiri can only test with an installed extension,
@@ -1897,7 +1897,14 @@ to reproduce user environments.")
        #:gem-flags (list "--" "--use-system-libraries"
                          (string-append "--with-xml2-include="
                                         (assoc-ref %build-inputs "libxml2")
-                                        "/include/libxml2" ))))
+                                        "/include/libxml2" ))
+       #:phases
+       (modify-phases %standard-phases
+         (add-after 'configure 'update-dependency
+           (lambda _
+             (substitute* ".gemspec"
+               (("2.0.0.rc2") "2.0"))
+             #t)))))
     (native-inputs
      `(("ruby-hoe" ,ruby-hoe)
        ("ruby-rake-compiler" ,ruby-rake-compiler)))
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2]: ruby-build-system: Extract gemspec during configure.
  2016-05-21 23:16 [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Ben Woodcroft
  2016-05-21 23:17 ` [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure' Ben Woodcroft
  2016-05-21 23:17 ` [PATCH 2/2] gnu: ruby-nokogiri: Update to 1.6.7.2 Ben Woodcroft
@ 2016-05-22  2:14 ` Thompson, David
  2016-05-22  5:18   ` Ben Woodcroft
  2 siblings, 1 reply; 7+ messages in thread
From: Thompson, David @ 2016-05-22  2:14 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

On Sat, May 21, 2016 at 7:16 PM, Ben Woodcroft <donttrustben@gmail.com> wrote:
> Previously the gemspec was extracted during the build phase.  The problem was
> that this was then immediately used to build the gem, leaving no ability to
> modify it before building (without replacing the entire phase).  I figure building a gemspec is kind of like a
> configure, so made the extraction step the configure step.

The name "configure" doesn't make sense in this context.  How about
"extract-gemspec" instead?

- Dave

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 0/2]: ruby-build-system: Extract gemspec during configure.
  2016-05-22  2:14 ` [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Thompson, David
@ 2016-05-22  5:18   ` Ben Woodcroft
  0 siblings, 0 replies; 7+ messages in thread
From: Ben Woodcroft @ 2016-05-22  5:18 UTC (permalink / raw)
  To: Thompson, David, Ben Woodcroft; +Cc: guix-devel

On 22/05/16 12:14, Thompson, David wrote:
> On Sat, May 21, 2016 at 7:16 PM, Ben Woodcroft <donttrustben@gmail.com> wrote:
>> Previously the gemspec was extracted during the build phase.  The problem was
>> that this was then immediately used to build the gem, leaving no ability to
>> modify it before building (without replacing the entire phase).  I figure building a gemspec is kind of like a
>> configure, so made the extraction step the configure step.
> The name "configure" doesn't make sense in this context.  How about
> "extract-gemspec" instead?

OK, sure.
ben

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure'.
  2016-05-21 23:17 ` [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure' Ben Woodcroft
@ 2016-05-24 12:14   ` Ricardo Wurmus
  2016-05-25 12:42     ` Ben Woodcroft
  0 siblings, 1 reply; 7+ messages in thread
From: Ricardo Wurmus @ 2016-05-24 12:14 UTC (permalink / raw)
  To: Ben Woodcroft; +Cc: guix-devel

Hi Ben,

I’m in favour of this change.  I agree with Dave that the name of this
phase should not be “configure”.

> * guix/build/ruby-build-system.scm [build]: Move extraction from here ...
> [configure]: ... to here.  New variable.
> [first-gemspec]: New variable.
> [standard-phases]: Add 'configure'.

I think these should be round parentheses.  Also “standard-phases”
should really be “%standard-phases”.

~~ Ricardo

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure'.
  2016-05-24 12:14   ` Ricardo Wurmus
@ 2016-05-25 12:42     ` Ben Woodcroft
  0 siblings, 0 replies; 7+ messages in thread
From: Ben Woodcroft @ 2016-05-25 12:42 UTC (permalink / raw)
  To: Ricardo Wurmus, Ben Woodcroft; +Cc: guix-devel

On 24/05/16 22:14, Ricardo Wurmus wrote:
> Hi Ben,
>
> I’m in favour of this change.  I agree with Dave that the name of this
> phase should not be “configure”.
>
>> * guix/build/ruby-build-system.scm [build]: Move extraction from here ...
>> [configure]: ... to here.  New variable.
>> [first-gemspec]: New variable.
>> [standard-phases]: Add 'configure'.
> I think these should be round parentheses.  Also “standard-phases”
> should really be “%standard-phases”.

Thanks, all pushed.
ben

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-05-25 12:42 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-21 23:16 [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Ben Woodcroft
2016-05-21 23:17 ` [PATCH 1/2] guix: ruby-build-system: Extract gemspec during 'configure' Ben Woodcroft
2016-05-24 12:14   ` Ricardo Wurmus
2016-05-25 12:42     ` Ben Woodcroft
2016-05-21 23:17 ` [PATCH 2/2] gnu: ruby-nokogiri: Update to 1.6.7.2 Ben Woodcroft
2016-05-22  2:14 ` [PATCH 0/2]: ruby-build-system: Extract gemspec during configure Thompson, David
2016-05-22  5:18   ` Ben Woodcroft

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).