[bug#33347,3/4] gnu: Add json-parser.

Message ID 87o9av1lf3.fsf@gmail.com
State Accepted
Headers show
Series gnu: teeworlds: Update to 0.7.0 [fixes CVE-2018-18541]. | expand

Checks

Context Check Description
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success Successfully applied
cbaines/applying patch success
cbaines/Applying patch success Description

Commit Message

Alex Vong Nov. 11, 2018, 7:09 p.m. UTC

Comments

Leo Famulari Nov. 13, 2018, 4:47 p.m. UTC | #1
On Mon, Nov 12, 2018 at 03:09:04AM +0800, Alex Vong wrote:
> From 6696a1dd8c69b9349c4897d1ce5b73d585d9f077 Mon Sep 17 00:00:00 2001
> From: Alex Vong <alexvong1995@gmail.com>
> Date: Mon, 12 Nov 2018 02:23:27 +0800
> Subject: [PATCH 2/4] gnu: Add json-parser.
> 
> * gnu/packages/web.scm (json-parser): New variable.

> +    (arguments '(#:tests? #f))

Please add a comment explaining why we skip the tests. If there are no
tests, it can be as simple as "No test suite.".

> +    (description "Very low footprint JSON parser written in portable ANSI C.

Please use a complete sentence. For example, "This package provides a
very low footprint ...".
Alex Vong Nov. 14, 2018, 1:14 p.m. UTC | #2
Leo Famulari <leo@famulari.name> writes:

> On Mon, Nov 12, 2018 at 03:09:04AM +0800, Alex Vong wrote:
>> From 6696a1dd8c69b9349c4897d1ce5b73d585d9f077 Mon Sep 17 00:00:00 2001
>> From: Alex Vong <alexvong1995@gmail.com>
>> Date: Mon, 12 Nov 2018 02:23:27 +0800
>> Subject: [PATCH 2/4] gnu: Add json-parser.
>> 
>> * gnu/packages/web.scm (json-parser): New variable.
>
>> +    (arguments '(#:tests? #f))
>
> Please add a comment explaining why we skip the tests. If there are no
> tests, it can be as simple as "No test suite.".
>
OK

>> +    (description "Very low footprint JSON parser written in portable ANSI C.
>
> Please use a complete sentence. For example, "This package provides a
> very low footprint ...".

The description was copied from upstream, but of course we can improve
it.

Patch

From 6696a1dd8c69b9349c4897d1ce5b73d585d9f077 Mon Sep 17 00:00:00 2001
From: Alex Vong <alexvong1995@gmail.com>
Date: Mon, 12 Nov 2018 02:23:27 +0800
Subject: [PATCH 2/4] gnu: Add json-parser.

* gnu/packages/web.scm (json-parser): New variable.
---
 gnu/packages/web.scm | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/gnu/packages/web.scm b/gnu/packages/web.scm
index b0ab4add8..082337d00 100644
--- a/gnu/packages/web.scm
+++ b/gnu/packages/web.scm
@@ -28,6 +28,7 @@ 
 ;;; Copyright © 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
 ;;; Copyright © 2018 Gábor Boskovits <boskovits@gmail.com>
 ;;; Copyright © 2018 Mădălin Ionel Patrașcu <madalinionel.patrascu@mdc-berlin.de>
+;;; Copyright © 2018 Alex Vong <alexvong1995@gmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -582,6 +583,32 @@  It aims to conform to RFC 7159.")
                    (("-Werror") ""))
                  #t))))))
 
+(define-public json-parser
+  (package
+    (name "json-parser")
+    (version "1.1.0")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "https://github.com/udp/json-parser"
+                                  "/archive/v" version ".tar.gz"))
+              (file-name (string-append name "-" version ".tar.gz"))
+              (sha256
+               (base32
+                "0cyixd9azd2l86hkha4d11lxz0a54fbwg4hmby6zkfwx4s9qf9sw"))))
+    (build-system gnu-build-system)
+    (arguments '(#:tests? #f))
+    (home-page "https://github.com/udp/json-parser")
+    (synopsis "JSON parser written in ANSI C")
+    (description "Very low footprint JSON parser written in portable ANSI C.
+
+@itemize
+@item BSD licensed with no dependencies (i.e. just drop the C file into your
+project)
+@item Never recurses or allocates more memory than it needs
+@item Very simple API with operator sugar for C++
+@end itemize")
+    (license l:bsd-2)))
+
 (define-public qjson
   (package
     (name "qjson")
-- 
2.19.1