guix-commits
[Top][All Lists]
Advanced

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

07/23: gnu: Add ruby-json-pure.


From: Ricardo Wurmus
Subject: 07/23: gnu: Add ruby-json-pure.
Date: Mon, 14 Dec 2015 13:10:49 +0000

rekado pushed a commit to branch master
in repository guix.

commit 763624f56616eae6c974e8d6c1acc257020154dd
Author: Ricardo Wurmus <address@hidden>
Date:   Wed Nov 25 15:36:24 2015 +0100

    gnu: Add ruby-json-pure.
    
    * gnu/packages/ruby.scm (ruby-json-pure): New variable.
---
 gnu/packages/ruby.scm |   48 ++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 48 insertions(+), 0 deletions(-)

diff --git a/gnu/packages/ruby.scm b/gnu/packages/ruby.scm
index 2f3e9f3..eb6abbf 100644
--- a/gnu/packages/ruby.scm
+++ b/gnu/packages/ruby.scm
@@ -30,6 +30,7 @@
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages java)
   #:use-module (gnu packages libffi)
+  #:use-module (gnu packages ragel)
   #:use-module (gnu packages tls)
   #:use-module (gnu packages version-control)
   #:use-module (guix packages)
@@ -2089,6 +2090,53 @@ a native C extension.")
     (home-page "http://json-jruby.rubyforge.org/";)
     (license (list license:ruby license:gpl2)))) ; GPL2 only
 
+(define-public ruby-json-pure
+  (package
+    (name "ruby-json-pure")
+    (version "1.8.3")
+    (source (origin
+              (method url-fetch)
+              (uri (rubygems-uri "json_pure" version))
+              (sha256
+               (base32
+                "025aykr360x6dr1jmg8pmsrx7gr30pws4p1q686vnb48zyw1sc94"))))
+    (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
+       (modify-phases %standard-phases
+         (add-after 'unpack 'replace-git-ls-files
+           (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))))
+             #t)))))
+    (native-inputs
+     `(("ruby-permutation" ,ruby-permutation)
+       ("ruby-utils" ,ruby-utils)
+       ("ragel" ,ragel)
+       ("bundler" ,bundler)))
+    (synopsis "JSON implementation in pure Ruby")
+    (description
+     "This package provides a JSON implementation written in pure Ruby.")
+    (home-page "http://flori.github.com/json";)
+    (license license:ruby)))
+
 (define-public ruby-listen
   (package
     (name "ruby-listen")



reply via email to

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