diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix index 8e56d3b70dd4..5a25cb3571d7 100644 --- a/pkgs/development/libraries/silgraphite/graphite2.nix +++ b/pkgs/development/libraries/silgraphite/graphite2.nix @@ -53,6 +53,22 @@ stdenv.mkDerivation (finalAttrs: { # headers are located in the dev output: substituteInPlace CMakeLists.txt \ --replace-fail ' ''${CMAKE_INSTALL_PREFIX}/include' " ${placeholder "dev"}/include" + + # Fix the build with CMake 4. + # + # See: + badCmakeFiles=( + CMakeLists.txt + src/CMakeLists.txt + tests/{bittwiddling,json,sparsetest,utftest}/CMakeLists.txt + gr2fonttest/CMakeLists.txt + ) + for file in "''${badCmakeFiles[@]}"; do + substituteInPlace "$file" \ + --replace-fail \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 2.8.0 FATAL_ERROR)' \ + 'CMAKE_MINIMUM_REQUIRED(VERSION 3.10 FATAL_ERROR)' + done ''; cmakeFlags = lib.optionals static [