diff mbox series

[bug#48785,v5,1/3] gnu: Add fast-double-parser.

Message ID 20230407151717.1429006-1-monego@posteo.net
State New
Headers show
Series [bug#48785,v5,1/3] gnu: Add fast-double-parser. | expand

Commit Message

Vinicius Monego April 7, 2023, 3:17 p.m. UTC
* gnu/packages/cpp.scm (fast-double-parser): New variable.
---
 gnu/packages/cpp.scm | 35 ++++++++++++++++++++++++++++++++++-
 1 file changed, 34 insertions(+), 1 deletion(-)


base-commit: 2853a4dd5eee7eedb1c19a5fd2d0f2ca468a4509
diff mbox series

Patch

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 <roel@gnu.org>
 ;;; Copyright © 2020, 2021, 2023 Ricardo Wurmus <rekado@elephly.net>
 ;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
-;;; Copyright © 2020, 2021, 2022 Vinicius Monego <monego@posteo.net>
+;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego@posteo.net>
 ;;; Copyright © 2020, 2022 Marius Bakke <marius@gnu.org>
 ;;; Copyright © 2020 Michael Rohleder <mike@rohleder.de>
 ;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
@@ -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")