summaryrefslogtreecommitdiff
path: root/gnu/packages/cpp.scm
diff options
context:
space:
mode:
authorArun Isaac <arunisaac@systemreboot.net>2026-03-26 01:51:54 +0000
committerArun Isaac <arunisaac@systemreboot.net>2026-05-21 17:10:48 +0100
commit5fc41108502e72d6f72d935df76dbaf1f12b6e60 (patch)
tree57b0270845f64f1b06c6929b64a670607d130198 /gnu/packages/cpp.scm
parentcaa2352f39b318172fc1596dca44397e7c0995e5 (diff)
gnu: Add span.
* gnu/packages/cpp.scm (span): New variable. Change-Id: Ic648e39b1537731c7fead944c7e8ea43bd4f24cb
Diffstat (limited to 'gnu/packages/cpp.scm')
-rw-r--r--gnu/packages/cpp.scm41
1 files changed, 41 insertions, 0 deletions
diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index e554ba75fe7..b260902c8d5 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -975,6 +975,47 @@ distribute with your projects
975@end itemize") 975@end itemize")
976 (license license:boost1.0))) 976 (license license:boost1.0)))
977 977
978(define-public span
979 (let ((commit "836dc6a0efd9849cb194e88e4aa2387436bb079b")
980 (revision "0"))
981 (package
982 (name "span")
983 (version (git-version "0.1.0" revision commit))
984 (source (origin
985 (method git-fetch)
986 (uri (git-reference
987 (url "https://github.com/tcbrindle/span")
988 (commit commit)))
989 (file-name (git-file-name name version))
990 (sha256
991 (base32
992 "1v3x1mj4if8jrr7cmrcbhv8n8ygla0liqb0dic6g6ji7px2pr6jf"))
993 (snippet
994 #~(delete-file "test/catch.hpp"))))
995 (build-system cmake-build-system)
996 (arguments
997 (list #:phases
998 #~(modify-phases %standard-phases
999 (add-after 'unpack 'patch-catch2
1000 (lambda _
1001 ;; Use catch2 from Guix.
1002 (substitute* (find-files "test" "\\.cpp$")
1003 (("#include \"catch.hpp\"")
1004 "#include <catch2/catch.hpp>"))))
1005 (replace 'install
1006 (lambda _
1007 (install-file "../source/include/tcb/span.hpp"
1008 (string-append #$output "/include")))))))
1009 (native-inputs
1010 (list catch2))
1011 (home-page "https://github.com/tcbrindle/span")
1012 (synopsis "C++20's @code{std::span} shim for older compilers")
1013 (description "This package provides a single-header implementation of
1014C++20's @code{std::span}, conforming to the C++20 committee draft. It is
1015compatible with C++11, but will use newer language features if they are
1016available.")
1017 (license license:boost1.0))))
1018
978(define-public google-highway 1019(define-public google-highway
979 (package 1020 (package
980 (name "google-highway") 1021 (name "google-highway")