all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Ben Woodcroft <b.woodcroft@uq.edu.au>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: Guix-devel <Guix-devel@gnu.org>
Subject: Re: [PATCH] Update Ruby to 2.3.0
Date: Sun, 10 Jan 2016 22:56:19 +1000	[thread overview]
Message-ID: <569254F3.7070400@uq.edu.au> (raw)
In-Reply-To: <56925443.6070608@uq.edu.au>

[-- Attachment #1: Type: text/plain, Size: 557 bytes --]



On 10/01/16 22:53, Ben Woodcroft wrote:
>
>
> On 09/01/16 02:52, Ludovic Courtès wrote:
>> Ben Woodcroft <b.woodcroft@uq.edu.au> skribis:
>>
>>>  From 28dee96b0de99adf8657457660b9e3733434d2b4 Mon Sep 17 00:00:00 2001
>>> From: Ben Woodcroft <donttrustben@gmail.com>
>>> Date: Mon, 4 Jan 2016 09:38:42 +1000
>>> Subject: [PATCH 4/4] gnu: ruby: Update to 2.3.0.
>>>
>>> * gnu/packages/ruby.scm (ruby): Update to 2.3.0.
>> Please mention the switch to ‘modify-phases’ here.
> I even made it a separate commit.
Forgot to attach patches.

[-- Attachment #2: 0005-gnu-ruby-Update-to-2.3.0.patch --]
[-- Type: text/x-patch, Size: 2406 bytes --]

From 2f26295b5a163cfc5d37332a501dcba5c40fb956 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Mon, 4 Jan 2016 09:38:42 +1000
Subject: [PATCH 5/5] gnu: ruby: Update to 2.3.0.

* gnu/packages/ruby.scm (ruby): Update to 2.3.0.
[arguments]: Remove bundled libffi.  Use parallel tests.
(ruby-2.2): New variable.
---
 gnu/packages/ruby.scm | 23 +++++++++++++++++++----
 1 file changed, 19 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 2b7496a..d2cdcf0 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -46,7 +46,7 @@
 (define-public ruby
   (package
     (name "ruby")
-    (version "2.2.4")
+    (version "2.3.0")
     (source
      (origin
        (method url-fetch)
@@ -55,14 +55,13 @@
                            "/ruby-" version ".tar.xz"))
        (sha256
         (base32
-         "0g3ps4q3iz7wj9m45n8xyxzw8nh29ljdqb87b0f6i0p3853gz2yj"))))
+         "15s0dsb5ynf3d2w5gzawnszq5594fqvapv2y7a0qw16przq5l4kh"))))
     (build-system gnu-build-system)
     (arguments
      `(#:test-target "test"
-       #:parallel-tests? #f
        #:phases
        (modify-phases %standard-phases
-         (add-before 'configure 'replace-bin-sh
+         (add-before 'configure 'replace-bin-sh-and-remove-libffi
            (lambda _
              (substitute* '("Makefile.in"
                             "ext/pty/pty.c"
@@ -76,6 +75,9 @@
                             "test/ruby/test_system.rb"
                             "tool/rbinstall.rb")
                (("/bin/sh") (which "sh")))
+             ;; Remove bundled libffi
+             (delete-file-recursively
+              (string-append "ext/fiddle/libffi-3.2.1"))
              #t)))))
     (inputs
      `(("readline" ,readline)
@@ -95,6 +97,19 @@ a focus on simplicity and productivity.")
     (home-page "https://ruby-lang.org")
     (license license:ruby)))
 
+(define-public ruby-2.2
+  (package (inherit ruby)
+    (version "2.2.4")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append "http://cache.ruby-lang.org/pub/ruby/"
+                           (version-major+minor version)
+                           "/ruby-" version ".tar.xz"))
+       (sha256
+        (base32
+         "0g3ps4q3iz7wj9m45n8xyxzw8nh29ljdqb87b0f6i0p3853gz2yj"))))))
+
 (define-public ruby-2.1
   (package (inherit ruby)
     (version "2.1.6")
-- 
2.6.3


[-- Attachment #3: 0004-gnu-ruby-Use-modify-phases.patch --]
[-- Type: text/x-patch, Size: 2150 bytes --]

From 551ecbd280eb35cb8e67cedf50e4a93f618cab1e Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Sun, 10 Jan 2016 22:25:45 +1000
Subject: [PATCH 4/5] gnu: ruby: Use modify-phases.

* gnu/packages/ruby.scm (ruby)[arguments]: Use modify-phases.
---
 gnu/packages/ruby.scm | 32 ++++++++++++++++----------------
 1 file changed, 16 insertions(+), 16 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 1564a54..2b7496a 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -61,22 +61,22 @@
      `(#:test-target "test"
        #:parallel-tests? #f
        #:phases
-       (alist-cons-before
-        'configure 'replace-bin-sh
-        (lambda _
-          (substitute* '("Makefile.in"
-                         "ext/pty/pty.c"
-                         "io.c"
-                         "lib/mkmf.rb"
-                         "process.c"
-                         "test/rubygems/test_gem_ext_configure_builder.rb"
-                         "test/rdoc/test_rdoc_parser.rb"
-                         "test/ruby/test_rubyoptions.rb"
-                         "test/ruby/test_process.rb"
-                         "test/ruby/test_system.rb"
-                         "tool/rbinstall.rb")
-            (("/bin/sh") (which "sh"))))
-        %standard-phases)))
+       (modify-phases %standard-phases
+         (add-before 'configure 'replace-bin-sh
+           (lambda _
+             (substitute* '("Makefile.in"
+                            "ext/pty/pty.c"
+                            "io.c"
+                            "lib/mkmf.rb"
+                            "process.c"
+                            "test/rubygems/test_gem_ext_configure_builder.rb"
+                            "test/rdoc/test_rdoc_parser.rb"
+                            "test/ruby/test_rubyoptions.rb"
+                            "test/ruby/test_process.rb"
+                            "test/ruby/test_system.rb"
+                            "tool/rbinstall.rb")
+               (("/bin/sh") (which "sh")))
+             #t)))))
     (inputs
      `(("readline" ,readline)
        ("openssl" ,openssl)
-- 
2.6.3


[-- Attachment #4: 0003-ruby-Abstract-out-path-to-GEM_HOME.patch --]
[-- Type: text/x-patch, Size: 8375 bytes --]

From 015a0e17be804dd7f68f21cde8a878ff353a4a97 Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Fri, 8 Jan 2016 17:29:39 +1000
Subject: [PATCH 3/5] ruby: Abstract out path to GEM_HOME.

Previously paths to the GEM_HOME of certain Ruby packages were
hard-coded, so packages failed to build when Ruby was updated to 2.3.0.

* guix/build/ruby-build-system.scm (gem-home): New procedure.
* gnu/packages/ruby.scm (ruby-metaclass, ruby-instantiator,
ruby-introspection, ruby-mocha, ruby-minitest-tu-shim): Use it.
---
 gnu/packages/ruby.scm            | 92 +++++++++++++++++++++++-----------------
 guix/build/ruby-build-system.scm | 13 +++++-
 2 files changed, 65 insertions(+), 40 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 61c6c3c..1564a54 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -1212,15 +1212,18 @@ It allows writing tests, checking results and automated testing in Ruby.")
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'add-test-unit-to-search-path
-          (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "Rakefile"
-              (("t\\.libs << \"test\"" line)
-               (string-append line "; t.libs << \""
-                              (assoc-ref inputs "ruby-test-unit")
-                              "/lib/ruby/gems/2.2.0/gems/test-unit-"
-                              ,(package-version ruby-test-unit)
-                              "/lib\"")))
-            #t)))))
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((test-unit (assoc-ref inputs "ruby-test-unit"))
+                    (test-unit-home  (gem-home test-unit
+                                               ,(package-version ruby))))
+               (substitute* "Rakefile"
+                 (("t\\.libs << \"test\"" line)
+                  (string-append line "; t.libs << \""
+                                 test-unit-home
+                                 "/gems/test-unit-"
+                                 ,(package-version ruby-test-unit)
+                                 "/lib\""))))
+             #t)))))
     (native-inputs
      `(("bundler" ,bundler)
        ("ruby-test-unit" ,ruby-test-unit)))
@@ -1274,15 +1277,17 @@ as a base class when writing classes that depend upon
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'add-test-unit-to-search-path
-          (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "Rakefile"
-              (("t\\.libs << \"test\"" line)
-               (string-append line "; t.libs << \""
-                              (assoc-ref inputs "ruby-test-unit")
-                              "/lib/ruby/gems/2.2.0/gems/test-unit-"
-                              ,(package-version ruby-test-unit)
-                              "/lib\"")))
-            #t)))))
+           (lambda* (#:key inputs #:allow-other-keys)
+             (let* ((test-unit (assoc-ref inputs "ruby-test-unit"))
+                    (test-unit-home  (gem-home test-unit ,(package-version ruby))))
+               (substitute* "Rakefile"
+                 (("t\\.libs << \"test\"" line)
+                  (string-append line "; t.libs << \""
+                                 test-unit-home
+                                 "/gems/test-unit-"
+                                 ,(package-version ruby-test-unit)
+                                 "/lib\""))))
+             #t)))))
     (propagated-inputs
      `(("ruby-blankslate" ,ruby-blankslate)))
     (native-inputs
@@ -1311,13 +1316,15 @@ knowing anything about the constructor.")
        (modify-phases %standard-phases
          (add-after 'unpack 'add-test-unit-to-search-path
           (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "Rakefile"
-              (("t\\.libs << \"test\"" line)
-               (string-append line "; t.libs << \""
-                              (assoc-ref inputs "ruby-test-unit")
-                              "/lib/ruby/gems/2.2.0/gems/test-unit-"
-                              ,(package-version ruby-test-unit)
-                              "/lib\"")))
+            (let* ((test-unit (assoc-ref inputs "ruby-test-unit"))
+                   (test-unit-home  (gem-home test-unit ,(package-version ruby))))
+              (substitute* "Rakefile"
+                (("t\\.libs << \"test\"" line)
+                 (string-append line "; t.libs << \""
+                                test-unit-home
+                                "/gems/test-unit-"
+                                ,(package-version ruby-test-unit)
+                                "/lib\""))))
             #t)))))
     (propagated-inputs
      `(("ruby-instantiator" ,ruby-instantiator)
@@ -1381,13 +1388,16 @@ conversion to (X)HTML.")
        (modify-phases %standard-phases
          (add-after 'unpack 'add-test-unit-to-search-path
           (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "Rakefile"
-              (("t\\.libs << 'test'" line)
-               (string-append line "; t.libs << \""
-                              (assoc-ref inputs "ruby-test-unit")
-                              "/lib/ruby/gems/2.2.0/gems/test-unit-"
-                              ,(package-version ruby-test-unit)
-                              "/lib\"")))
+            (let* ((test-unit (assoc-ref inputs "ruby-test-unit"))
+                   (test-unit-home  (gem-home test-unit
+                                             ,(package-version ruby))))
+              (substitute* "Rakefile"
+                (("t\\.libs << 'test'" line)
+                 (string-append line "; t.libs << \""
+                                test-unit-home
+                                "/gems/test-unit-"
+                                ,(package-version ruby-test-unit)
+                                "/lib\""))))
             #t))
          (add-before 'check 'use-latest-redcarpet
           (lambda _
@@ -2047,13 +2057,17 @@ development of Ruby gems.")
        (modify-phases %standard-phases
          (add-after 'unpack 'fix-test-include-path
           (lambda* (#:key inputs #:allow-other-keys)
-            (substitute* "Rakefile"
-              (("Hoe\\.add_include_dirs .*")
-               (string-append "Hoe.add_include_dirs \""
-                              (assoc-ref inputs "ruby-minitest-4")
-                              "/lib/ruby/gems/2.2.0/gems/minitest-"
-                              ,(package-version ruby-minitest-4)
-                              "/lib" "\"")))))
+             (let* ((minitest (assoc-ref inputs "ruby-minitest-4"))
+                    (minitest-home  (gem-home minitest
+                                              ,(package-version ruby))))
+               (substitute* "Rakefile"
+                 (("Hoe\\.add_include_dirs .*")
+                  (string-append "Hoe.add_include_dirs \""
+                                 minitest-home
+                                 "/gems/minitest-"
+                                 ,(package-version ruby-minitest-4)
+                                 "/lib" "\""))))
+             #t))
          (add-before 'check 'fix-test-assumptions
           (lambda _
             ;; The test output includes the file name, so a couple of tests
diff --git a/guix/build/ruby-build-system.scm b/guix/build/ruby-build-system.scm
index 2685da1..18da438 100644
--- a/guix/build/ruby-build-system.scm
+++ b/guix/build/ruby-build-system.scm
@@ -26,7 +26,8 @@
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-26)
   #:export (%standard-phases
-            ruby-build))
+            ruby-build
+            gem-home))
 
 ;; Commentary:
 ;;
@@ -136,3 +137,13 @@ GEM-FLAGS are passed to the 'gem' invokation, if present."
 (define* (ruby-build #:key inputs (phases %standard-phases)
                      #:allow-other-keys #:rest args)
   (apply gnu:gnu-build #:inputs inputs #:phases phases args))
+
+(define (gem-home store-path ruby-version)
+  "Return a string to the gem home directory in the store given a STORE-PATH
+and the RUBY-VERSION used to build that ruby package"
+  (string-append
+   store-path
+   "/lib/ruby/gems/"
+   (regexp-substitute #f
+                      (string-match "^[0-9]+\\.[0-9]+" ruby-version)
+                      0 ".0")))
-- 
2.6.3


[-- Attachment #5: 0002-gnu-ruby-yard-Disable-failing-test.patch --]
[-- Type: text/x-patch, Size: 1577 bytes --]

From 048036aee522d6a03436bf530d139ec26d8a438e Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Wed, 6 Jan 2016 21:57:44 +1000
Subject: [PATCH 2/5] gnu: ruby-yard: Disable failing test.

* gnu/packages/ruby.scm (ruby-yard)[arguments]: Disable test which fails on
Ruby 2.3.0.
---
 gnu/packages/ruby.scm | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index d3e6dbc..61c6c3c 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2776,9 +2776,17 @@ features such as filtering and fine grained logging.")
      `(#:test-target "specs"
        #:phases
        (modify-phases %standard-phases
-         (add-before 'check 'set-HOME
-          ;; $HOME needs to be set to somewhere writeable for tests to run
-          (lambda _ (setenv "HOME" "/tmp") #t)))))
+         (add-before 'check 'set-HOME-and-disable-failing-test
+           (lambda _
+             ;; $HOME needs to be set to somewhere writeable for tests to run
+             (setenv "HOME" "/tmp")
+             ;; Disable tests which fails on Ruby 2.3.  See
+             ;; https://github.com/lsegal/yard/issues/927
+             (substitute* "spec/parser/ruby/ruby_parser_spec.rb"
+               (("comment.type.should == :comment") "")
+               (("comment.docstring_hash_flag.should be_true") "")
+               (("comment.docstring.strip.should == .*") ""))
+             #t)))))
     (native-inputs
      `(("ruby-rspec" ,ruby-rspec-2)
        ("ruby-rack" ,ruby-rack)))
-- 
2.6.3


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #6: 0001-gnu-ruby-power-assert-Update-to-0.2.7.patch --]
[-- Type: text/x-patch; name="0001-gnu-ruby-power-assert-Update-to-0.2.7.patch", Size: 1561 bytes --]

From 3918146b6179f211fb7ef955f74561f9b1460a8b Mon Sep 17 00:00:00 2001
From: Ben Woodcroft <donttrustben@gmail.com>
Date: Wed, 6 Jan 2016 21:23:15 +1000
Subject: [PATCH 1/5] gnu: ruby-power-assert: Update to 0.2.7.

* gnu/packages/ruby.scm (ruby-power-assert): Update to 0.2.7.
---
 gnu/packages/ruby.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 47ac392..d3e6dbc 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -4,7 +4,7 @@
 ;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
 ;;; Copyright © 2014, 2015 David Thompson <davet@gnu.org>
 ;;; Copyright © 2015 Ricardo Wurmus <rekado@elephly.net>
-;;; Copyright © 2015 Ben Woodcroft <donttrustben@gmail.com>
+;;; Copyright © 2015, 2016 Ben Woodcroft <donttrustben@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1059,13 +1059,13 @@ using Net::HTTP, supporting reconnection and retry according to RFC 2616.")
 (define-public ruby-power-assert
   (package
     (name "ruby-power-assert")
-    (version "0.2.6")
+    (version "0.2.7")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "power_assert" version))
               (sha256
                (base32
-                "0gbj379jhnff8rbb6m3kzdm282szjz1a021xzxa38d1bnswj2jx3"))))
+                "0ka6w71lcan4wgf111xi3pcn9ma9lhakv31jg8w007nwzi0xfjbi"))))
     (build-system ruby-build-system)
     (native-inputs
      `(("bundler" ,bundler)))
-- 
2.6.3


  reply	other threads:[~2016-01-10 12:56 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-03 14:35 Freezing core-updates soon Ludovic Courtès
2016-01-03 16:25 ` Ricardo Wurmus
2016-01-03 22:27   ` Ludovic Courtès
2016-01-04 14:20     ` Mark H Weaver
2016-01-04 21:16       ` Mark H Weaver
2016-01-04 22:49         ` Ludovic Courtès
2016-01-04  0:59 ` Thompson, David
2016-01-04  1:17   ` Ben Woodcroft
2016-01-04 10:46     ` [PATCH] Update Ruby to 2.3.0 (was Re: Freezing core-updates soon) Ben Woodcroft
2016-01-05 22:24       ` Ludovic Courtès
2016-01-08 11:16         ` Ben Woodcroft
2016-01-08 16:52           ` [PATCH] Update Ruby to 2.3.0 Ludovic Courtès
2016-01-10 12:53             ` Ben Woodcroft
2016-01-10 12:56               ` Ben Woodcroft [this message]
2016-01-10 21:14                 ` Ludovic Courtès
2016-01-11 12:52                   ` Ben Woodcroft
2016-01-04 11:02 ` Freezing core-updates soon Efraim Flashner
2016-01-04 15:13   ` Ludovic Courtès
2016-01-04 15:21     ` Efraim Flashner
2016-01-13 17:48 ` Ludovic Courtès
2016-01-14 20:10   ` Mark H Weaver
2016-01-15 16:13     ` Ludovic Courtès
2016-01-19 10:34   ` util-linux test failure Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=569254F3.7070400@uq.edu.au \
    --to=b.woodcroft@uq.edu.au \
    --cc=Guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.