diff mbox series

[bug#69126,v3,1/2] gnu: Add debug-assert.

Message ID 0191a95edf076b5cd24326d49e54ce13f2bdb0d4.1708457406.git.paul@apatience.com
State New
Headers show
Series gnu: Add type-safe. | expand

Commit Message

Paul A. Patience Feb. 20, 2024, 7:33 p.m. UTC
* gnu/packages/cpp.scm (debug-assert): New variable.

Change-Id: I4cee49ea2f5b761ab72bb7b063c2ea8fd99b991c
---
 gnu/packages/cpp.scm | 28 +++++++++++++++++++++++++++-
 1 file changed, 27 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 62a1923571..2456de5002 100644
--- a/gnu/packages/cpp.scm
+++ b/gnu/packages/cpp.scm
@@ -38,7 +38,7 @@ 
 ;;; Copyright © 2023 Liliana Marie Prikler <liliana.prikler@gmail.com>
 ;;; Copyright © 2023 Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
 ;;; Copyright © 2023 Foundation Devices, Inc. <hello@foundationdevices.com>
-;;; Copyright © 2023 Paul A. Patience <paul@apatience.com>
+;;; Copyright © 2023-2024 Paul A. Patience <paul@apatience.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -3048,3 +3048,29 @@  (define-public tl-optional
 the std::optional for C++11/14/17, with support for monadic operations added in
 C++23.")
     (license license:cc0)))
+
+(define-public debug-assert
+  ;; Newer version than last release, which was in 2018, is required for
+  ;; type_safe.
+  (let ((commit "d33781479baccf52a28e5c3c5a6da5ac59b09179")
+        (revision "0"))
+    (package
+      (name "debug-assert")
+      (version (git-version "1.3.3" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/foonathan/debug_assert")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "0njbzx767pndpl8hq5falr4c8m0xsr6njh0943xf8xkcqq6splpz"))))
+      (build-system cmake-build-system)
+      (arguments (list #:tests? #f))    ; no tests
+      (home-page "https://github.com/foonathan/debug_assert")
+      (synopsis "Assertion macro for C++")
+      (description "debug_assert is a C++11 header-only library which provides the
+@code{DEBUG_ASSERT()} macro, which among other features can be selectively
+enabled in different parts of your code.")
+      (license license:zlib))))