From 82de3ea0a00e13e3b01cc3cfa19c8aec7a9237e2 Mon Sep 17 00:00:00 2001 From: Emily Date: Tue, 9 Sep 2025 19:59:37 +0100 Subject: [PATCH] graphite2: fix build with CMake 4 --- .../libraries/silgraphite/graphite2.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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 [