From 46dd6d3b7263def00e084fa48ac1bbfb47a4a0da Mon Sep 17 00:00:00 2001 From: Emily Date: Wed, 10 Sep 2025 02:32:16 +0100 Subject: [PATCH] cjson: fix build with CMake 4 --- pkgs/by-name/cj/cjson/package.nix | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pkgs/by-name/cj/cjson/package.nix b/pkgs/by-name/cj/cjson/package.nix index b04408ec499b..c1fa9f4c55cd 100644 --- a/pkgs/by-name/cj/cjson/package.nix +++ b/pkgs/by-name/cj/cjson/package.nix @@ -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: + # * + # * + # * + + '' + 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";