Subject: [bug#48785] [PATCH v6 1/3] gnu: Add fast-double-parser.

From: Vinicius Monego <[email-masked]>
Date: Mon, 26 Jun 2023 01:06:33 +0000

* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 36 +++++++++++++++++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 39a34c20dd..65e040700c 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -10,7 +10,7 @@
 ;;; Copyright © 2020 Roel Janssen <[email-masked]>
 ;;; Copyright © 2020, 2021, 2023 Ricardo Wurmus <[email-masked]>
 ;;; Copyright © 2020 Brice Waegeneire <[email-masked]>
-;;; Copyright © 2020, 2021, 2022 Vinicius Monego <[email-masked]>
+;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <[email-masked]>
 ;;; Copyright © 2020, 2022 Marius Bakke <[email-masked]>
 ;;; Copyright © 2020 Michael Rohleder <[email-masked]>
 ;;; Copyright © 2020 Alexandros Theodotou <[email-masked]>
@@ -448,6 +448,40 @@ (define-public xsimd
 operating on batches.")
     (license license:bsd-3)))
 
+(define-public fast-double-parser
+  (package
+    (name "fast-double-parser")
+    (version "0.7.0")
+    (source (origin
+              (method git-fetch)
+              (uri (git-reference
+                    (url "https://github.com/lemire/fast_double_parser")
+                    (commit (string-append "v" version))))
+              (file-name (git-file-name name version))
+              (sha256
+               (base32
+                "0c3ajwm65yip61iq3ybvrkx5d3136r9dc68j1c1fmrv61n5nfmlb"))))
+    (build-system cmake-build-system)
+    (arguments
+     (list #:phases
+           #~(modify-phases %standard-phases
+               ;; There is no install target, we have to do it manually.
+               (replace 'install
+                 (lambda _
+                   (mkdir-p (string-append #$output "/include"))
+                   (copy-file
+                    (string-append #$(package-source this-package)
+                                   "/include/fast_double_parser.h")
+                    (string-append #$output
+                                   "/include/fast_double_parser.h")))))))
+    (home-page "https://github.com/lemire/fast_double_parser")
+    (synopsis "Parse strings into double floating-point values")
+    (description "@code{fast-double-parser} provides a fast function to parse
+strings into double (binary64) floating-point values, enforces the RFC 7159
+(JSON standard) grammar.")
+    ;; Dual-licensed, either license applies.
+    (license (list license:asl2.0 license:boost1.0))))
+
 (define-public google-highway
   (package
     (name "google-highway")

base-commit: 41e8726c8924e9f5b79a9f44fad94ab5586bfc50
-- 
2.34.1