jsoncpp: fix build with secure memory

jsoncpp changed the secure memory definition
with 1.9.7 and made it possible to enable it directly
via cmake.

Signed-off-by: Markus Theil <theil.markus@gmail.com>
This commit is contained in:
Markus Theil
2026-05-05 11:55:25 +02:00
parent 3e698a8526
commit 7b42e5eb99
+1 -4
View File
@@ -35,10 +35,6 @@ stdenv.mkDerivation (finalAttrs: {
export sourceRoot=${finalAttrs.src.name}
'';
postPatch = lib.optionalString secureMemory ''
sed -i 's/#define JSONCPP_USING_SECURE_MEMORY 0/#define JSONCPP_USING_SECURE_MEMORY 1/' include/json/version.h
'';
nativeBuildInputs = [
cmake
python3
@@ -46,6 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
];
cmakeFlags = [
"-DJSONCPP_USE_SECURE_MEMORY=${if secureMemory then "ON" else "OFF"}"
"-DBUILD_SHARED_LIBS=ON"
"-DBUILD_OBJECT_LIBS=OFF"
"-DJSONCPP_WITH_CMAKE_PACKAGE=ON"