guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/07: gnu: ruby-json-pure: Update to 2.1.0.


From: Ben Woodcroft
Subject: 06/07: gnu: ruby-json-pure: Update to 2.1.0.
Date: Fri, 28 Jul 2017 07:12:43 -0400 (EDT)

benwoodcroft pushed a commit to branch master
in repository guix.

commit ac01cb07902ec88b390a7597513c534017f76bf3
Author: Ben Woodcroft <address@hidden>
Date:   Fri Jul 28 17:50:36 2017 +1000

    gnu: ruby-json-pure: Update to 2.1.0.
    
    * gnu/packages/ruby.scm (ruby-json-pure): Update to 2.1.0.
    [arguments]: Replace 'replace-git-ls-files' phase with 'fix-rakefile'
    and 'regenerate-gemspec' phases.
    [inputs]: Remove ruby-permutation, ruby-utils, ragel. Add ruby-test-unit,
    ruby-simplecov.
---
 gnu/packages/ruby.scm | 48 ++++++++++++++++++------------------------------
 1 file changed, 18 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ff3ccfb..bc98dc2 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -2463,46 +2463,34 @@ a native C extension.")
 (define-public ruby-json-pure
   (package
     (name "ruby-json-pure")
-    (version "1.8.3")
+    (version "2.1.0")
     (source (origin
               (method url-fetch)
               (uri (rubygems-uri "json_pure" version))
               (sha256
                (base32
-                "025aykr360x6dr1jmg8pmsrx7gr30pws4p1q686vnb48zyw1sc94"))))
+                "12yf9fmhr4c2jm3xl20vf1qyz5i63vc8a6ngz9j0f86nqwhmi2as"))))
     (build-system ruby-build-system)
     (arguments
-     `(#:modules ((srfi srfi-1)
-                  (ice-9 regex)
-                  (rnrs io ports)
-                  (guix build ruby-build-system)
-                  (guix build utils))
-       #:phases
+     `(#:phases
        (modify-phases %standard-phases
-         (add-after 'unpack 'replace-git-ls-files
+         (add-after 'unpack 'fix-rakefile
            (lambda _
-             ;; The existing gemspec file already contains a nice list of
-             ;; files that belong to the gem.  We extract the list from the
-             ;; gemspec file and then replace the file list in the Rakefile to
-             ;; get rid of the call to "git ls-files".
-             (let* ((contents (call-with-input-file "json.gemspec" 
get-string-all))
-                    ;; Guile is unhappy about the #\nul characters in comments.
-                    (filtered (string-filter (lambda (char)
-                                               (not (equal? #\nul char)))
-                                             contents))
-                    (files (match:substring
-                            (string-match "  s\\.files = ([^]]+\\])" filtered) 
1)))
-               (substitute* "Rakefile"
-                 (("FileList\\[`git ls-files`\\.split\\(/\\\\n/\\)\\]")
-                  (string-append "FileList" files))))
-             (substitute* "Gemfile"
-               ((".*json-java.*") "\n"))
-             #t)))))
+             (substitute* "Rakefile"
+               ;; Since this is not a git repository, do not call 'git'.
+               (("`git ls-files`") "`find . -type f |sort`")
+               ;; Loosen dependency constraint.
+               (("'test-unit', '~> 2.0'") "'test-unit', '>= 2.0'"))
+             #t))
+         (add-after 'replace-git-ls-files 'regenerate-gemspec
+           (lambda _
+             ;; Regenerate gemspec so loosened dependency constraints are
+             ;; propagated.
+             (zero? (system* "rake" "gemspec")))))))
     (native-inputs
-     `(("ruby-permutation" ,ruby-permutation)
-       ("ruby-utils" ,ruby-utils)
-       ("ragel" ,ragel)
-       ("bundler" ,bundler)))
+     `(("bundler" ,bundler)
+       ("ruby-test-unit" ,ruby-test-unit)
+       ("ruby-simplecov" ,ruby-simplecov)))
     (synopsis "JSON implementation in pure Ruby")
     (description
      "This package provides a JSON implementation written in pure Ruby.")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]