diff mbox series

[bug#63765,v6,07/10] gnu: Add tcb-span.

Message ID 90badab8a63e441ca70c8b4a7decf3e7e676fafa.1691240736.git.hako@ultrarare.space
State New
Headers show
Series gnu: python-lief: Update to 0.13.2. | expand

Commit Message

Hilton Chain Aug. 5, 2023, 1:19 p.m. UTC
* gnu/packages/cpp.scm (tcb-span): New variable.
---
 gnu/packages/cpp.scm | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 5d1361173f..8d20e698bb 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -1023,6 +1023,50 @@  (define-public sobjectizer
 development of concurrent and multithreaded applications in C++.")
     (license license:bsd-3)))
 
+(define-public tcb-span
+  ;; No released versions
+  (let ((commit "836dc6a0efd9849cb194e88e4aa2387436bb079b")
+        (revision "0"))
+    (package
+      (name "tcb-span")
+      (version (git-version "0.0.0" revision commit))
+      (source (origin
+                (method git-fetch)
+                (uri (git-reference
+                      (url "https://github.com/tcbrindle/span")
+                      (commit commit)))
+                (file-name (git-file-name name version))
+                (modules '((guix build utils)))
+                (snippet
+                 '(begin
+                    (delete-file "test/catch.hpp")
+                    (substitute* "test/CMakeLists.txt"
+                      (("add_library.*" line)
+                       (string-append
+                        line "find_package(Catch2 REQUIRED)\n")))
+                    (substitute* (find-files "test" "\\.cpp")
+                      (("\"catch.hpp\"") "<catch2/catch.hpp>"))))
+                (sha256
+                 (base32
+                  "1v3x1mj4if8jrr7cmrcbhv8n8ygla0liqb0dic6g6ji7px2pr6jf"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list #:phases
+             #~(modify-phases %standard-phases
+                 (replace 'install
+                   (lambda _
+                     (copy-recursively
+                      "../source/include"
+                      (string-append #$output "/include")))))))
+      (native-inputs (list catch2))
+      (home-page "https://github.com/tcbrindle/span")
+      (synopsis "@code{std::span} implementation for older compilers")
+      (description
+       "This package provides a single-header implementation of C++20's
+@code{std::span}, conforming to the C++20 committee draft.  It is compatible
+with C++11, but will use newer language features if they are available.")
+      (license license:boost1.0))))
+
 (define-public tweeny
   (package
     (name "tweeny")