diff mbox series

[bug#56240] gnu: Add ubench-h

Message ID 87zgaz47m0.fsf@gmail.com
State New
Headers show
Series [bug#56240] gnu: Add ubench-h | expand

Commit Message

Artyom V. Poptsov Jan. 3, 2023, 9:43 p.m. UTC
Hello,

I've rebased my patch that adds "ubench.h" benchmark framework onto the
"master" branch.
Could you please review the patch?

Thanks,
avp
diff mbox series

Patch

From c2f163bb8f8f2acf82432893f3860e35dbb95d5a Mon Sep 17 00:00:00 2001
From: "Artyom V. Poptsov" <poptsov.artyom@gmail.com>
Date: Wed, 4 Jan 2023 00:39:27 +0300
Subject: [PATCH] gnu: Add ubench-h.

* gnu/packages/c.scm (ubench-h): New variable.
---
 gnu/packages/c.scm | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)

diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm
index 04c9fcdc62..0bdc6e9fc5 100644
--- a/gnu/packages/c.scm
+++ b/gnu/packages/c.scm
@@ -1376,3 +1376,39 @@  (define-public utest-h
       (description
        "This package provides a header-only unit testing library for C/C++.")
       (license license:unlicense))))
+
+(define-public ubench-h
+  ;; The latest commit is used as there is no release.
+  (let ((commit "bcf152d83c3495242aa46df69cecdc9f3fbdf687") (revision "0"))
+    (package
+      (name "ubench-h")
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/sheredom/ubench.h")
+                      (commit commit)))
+                (file-name (git-file-name "ubench.h" version))
+                (sha256
+                 (base32
+                  "0sdnycxmrp78zhwydqbca985c3cg7px3n90vfs8c3agzra7xrhsi"))))
+      (build-system cmake-build-system)
+      (arguments
+       `(#:phases (modify-phases %standard-phases
+                    (delete 'build)
+                    (delete 'configure)
+                    (replace 'check
+                      (lambda* (#:key tests? #:allow-other-keys)
+                        (when tests?
+                          (with-directory-excursion "test"
+                                                    (invoke "cmake" ".")
+                                                    (invoke "make")))))
+                    (replace 'install
+                      (lambda* (#:key outputs #:allow-other-keys)
+                        (let ((out (assoc-ref outputs "out")))
+                          (install-file "ubench.h"
+                                        (string-append out "/include"))))))))
+      (home-page "https://github.com/sheredom/ubench.h")
+      (synopsis "Single header benchmark framework for C and C++")
+      (description "A simple one header solution to benchmarking for C/C++.")
+      (license license:unlicense))))
-- 
2.34.1