jsoncpp: fix build with secure memory (#516800)

This commit is contained in:
nikstur
2026-05-05 12:18:39 +00:00
committed by GitHub
2 changed files with 6 additions and 4 deletions
+4 -4
View File
@@ -13,6 +13,9 @@ stdenv.mkDerivation (finalAttrs: {
pname = "jsoncpp";
version = "1.9.7";
strictDeps = true;
__structuredAttrs = true;
outputs = [
"out"
"dev"
@@ -35,10 +38,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 +45,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"
+2
View File
@@ -6227,6 +6227,8 @@ with pkgs;
}
);
jsoncppSecureMemory = jsoncpp.override { secureMemory = true; };
mtrace = callPackage ../development/libraries/glibc/mtrace.nix { };
# Provided by libc on Operating Systems that use the Extensible Linker Format.