Subject: [PATCH v5 1/3] gnu: Add fast-double-parser.

From: Vinicius Monego <[email-masked]>
Date: Fri, 7 Apr 2023 15:17:15 +0000

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

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index ed6ae69198..af1d436bc2 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]>
@@ -445,6 +445,39 @@ (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.")
+    (license license:asl2.0)))
+
 (define-public google-highway
   (package
     (name "google-highway")

base-commit: 2853a4dd5eee7eedb1c19a5fd2d0f2ca468a4509
-- 
2.34.1