From b94aae49b75478ec6eab937161fb994386099042 Mon Sep 17 00:00:00 2001 From: David Elsing Date: Tue, 29 Jul 2025 16:19:32 +0200 Subject: [PATCH] gnu: sajson: Fix build. Prevent the example from calling fclose multiple times. * gnu/packages/cpp.scm (sajson)[arguments]: Add 'fix-example phase. Change-Id: Icec4ef43fe5835810411a5a5681d552c5744aae6 Signed-off-by: Sharlatan Hellseher --- gnu/packages/cpp.scm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnu/packages/cpp.scm b/gnu/packages/cpp.scm index 1a991ac08c..0e61b49bbf 100644 --- a/gnu/packages/cpp.scm +++ b/gnu/packages/cpp.scm @@ -3562,6 +3562,11 @@ different floating point sizes and complex transformations.") (string-append #$(this-package-native-input "unittest-cpp") "/lib") "', LIBS=['UnitTest++'])"))))) + (add-after 'unpack 'fix-example + (lambda _ + (substitute* "example/main.cpp" + (("fclose\\(file\\);") + "if (file != nullptr) {fclose(file); file = nullptr;}")))) (replace 'build (lambda* (#:key tests? #:allow-other-keys #:rest args) (when tests?