Subject: [PATCH 1/2] gnu: Add debug-assert.

From: "Paul A. Patience" <[email-masked]>
Date: Wed, 14 Feb 2024 15:36:15 +0000

* gnu/packages/cpp.scm (debug-assert): New variable.

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

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 <[email-masked]>
 ;;; Copyright © 2023 Denis 'GNUtoo' Carikli <[email-masked]>
 ;;; Copyright © 2023 Foundation Devices, Inc. <[email-masked]>
-;;; Copyright © 2023 Paul A. Patience <[email-masked]>
+;;; Copyright © 2023-2024 Paul A. Patience <[email-masked]>
 ;;;
 ;;; 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))))
-- 
2.41.0