aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Woodcroft <donttrustben@gmail.com>2017-07-28 17:50:36 +1000
committerBen Woodcroft <donttrustben@gmail.com>2017-07-28 20:18:53 +1000
commitac01cb07902ec88b390a7597513c534017f76bf3 (patch)
treebaef6c29b36988b3a8ffee1fe901c9f6dd6cd1a1
parent9c14bc7a4d5274477401833cdee45310e6aea091 (diff)
downloadpatches-ac01cb07902ec88b390a7597513c534017f76bf3.tar
patches-ac01cb07902ec88b390a7597513c534017f76bf3.tar.gz
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.
-rw-r--r--gnu/packages/ruby.scm48
1 files changed, 18 insertions, 30 deletions
diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index ff3ccfb0dd..bc98dc2845 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.")