cjson: fix build with CMake 4

This commit is contained in:
Emily
2025-09-19 16:29:10 +01:00
parent 781543fce4
commit 46dd6d3b72
+18 -5
View File
@@ -22,11 +22,24 @@ stdenv.mkDerivation rec {
lib.cmakeBool "ENABLE_CUSTOM_COMPILER_FLAGS" false
);
# cJSON actually uses C99 standard, not C89
# https://github.com/DaveGamble/cJSON/issues/275
postPatch = ''
substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99
'';
postPatch =
# cJSON actually uses C99 standard, not C89
# https://github.com/DaveGamble/cJSON/issues/275
''
substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99
''
# Fix the build with CMake 4.
#
# See:
# * <https://github.com/DaveGamble/cJSON/issues/946>
# * <https://github.com/DaveGamble/cJSON/pull/935>
# * <https://github.com/DaveGamble/cJSON/pull/949>
+ ''
substituteInPlace CMakeLists.txt \
--replace-fail \
'cmake_minimum_required(VERSION 3.0)' \
'cmake_minimum_required(VERSION 3.10)'
'';
meta = with lib; {
homepage = "https://github.com/DaveGamble/cJSON";