Subject: [bug#69002] [PATCH] gnu: Add icecream-cpp.

From: "Paul A. Patience" <[email-masked]>
Date: Fri, 09 Feb 2024 16:27:04 +0000

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

Change-Id: Idfc9fd789fe4f0a163cc8a8be8ad2a3b35d50dfd
---
 gnu/packages/cpp.scm | 38 +++++++++++++++++++++++++++++++++++++-
 1 file changed, 37 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm
index 62a1923571..d589d44e43 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,39 @@ (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 icecream-cpp
+  ;; Last release was in 2020, last commit in 2023.
+  (let ((commit "04e8d3697e64e68d5150a6bc36ba8ebb8690f425")
+        (revision "0"))
+    (package
+      (name "icecream-cpp")
+      (version (git-version "0.3.1" revision commit))
+      (source
+       (origin
+         (method git-fetch)
+         (uri (git-reference
+               (url "https://github.com/renatoGarcia/icecream-cpp")
+               (commit commit)))
+         (file-name (git-file-name name version))
+         (sha256
+          (base32 "1adahzwm3wlk8d4cjzjakvrw2mm825vpxf37m0ffxxzd3kzrn6qy"))
+         ;; Remove bundled Catch2.
+         (snippet #~(delete-file "test/catch.hpp"))))
+      (build-system cmake-build-system)
+      (arguments
+       (list #:configure-flags #~(list "-DBUILD_TESTING=ON")
+             #:phases
+             #~(modify-phases %standard-phases
+                 (add-after 'unpack 'patch-test
+                   (lambda _
+                     (substitute* "test/test.cpp"
+                       (("#include \"catch\\.hpp\"")
+                        "#include <catch2/catch.hpp>")))))))
+      (native-inputs (list boost catch2))
+      (home-page "https://github.com/renatoGarcia/icecream-cpp")
+      (synopsis "C++ library for @code{printf} debugging")
+      (description "IceCream-Cpp is a C++ library for @code{printf} debugging.
+It is inspired by the @url{https://github.com/gruns/icecream, Python library}
+of the same name.")
+      (license license:expat))))

base-commit: 570ef13a87bb54d3410c431700ba78316a2641e2
-- 
2.41.0