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.
This commit is contained in:
Ben Woodcroft 2017-07-28 17:50:36 +10:00
parent 9c14bc7a4d
commit ac01cb0790
No known key found for this signature in database
GPG key ID: 2A6AD9F4AAC20DF6

View file

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