graphite2: fix build with CMake 4

This commit is contained in:
Emily
2025-09-19 16:29:10 +01:00
parent d65ad56f1b
commit 82de3ea0a0
@@ -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: <https://github.com/silnrsi/graphite/issues/98>
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 [