From 10dda58229fddb6ac849c95b70bb48148bb355b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 Oct 2025 10:30:54 -0700 Subject: [PATCH 1/3] luabind: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 - Should fix `luabind`, `luabind_luajit` & `osrm-backend` --- pkgs/development/libraries/luabind/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/libraries/luabind/default.nix b/pkgs/development/libraries/luabind/default.nix index eb002cf895a6..d79515d18ded 100644 --- a/pkgs/development/libraries/luabind/default.nix +++ b/pkgs/development/libraries/luabind/default.nix @@ -28,6 +28,14 @@ stdenv.mkDerivation { inherit lua; }; + # CMake 2.8.3 is deprecated and is no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "cmake_minimum_required(VERSION 2.8.3)" \ + "cmake_minimum_required(VERSION 3.10)" + ''; + patches = [ ./0.9.1-discover-luajit.patch ]; meta = { From e6406ba156febfe473933d1f80236d8333e13033 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 Oct 2025 10:37:42 -0700 Subject: [PATCH 2/3] eigen2: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 - CMake Error at doc/snippets/CMakeLists.txt:17 (GET_TARGET_PROPERTY): The LOCATION property may not be read from target "compile_class_LU". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate. - CMake Error at doc/examples/CMakeLists.txt:11 (GET_TARGET_PROPERTY): The LOCATION property may not be read from target "Tutorial_simple_example_dynamic_size". Use the target name directly with add_custom_command, or use the generator expression $, as appropriate. --- pkgs/by-name/ei/eigen2/cmake-4-build.patch | 47 ++++++++++++++++++++++ pkgs/by-name/ei/eigen2/package.nix | 4 ++ 2 files changed, 51 insertions(+) create mode 100644 pkgs/by-name/ei/eigen2/cmake-4-build.patch diff --git a/pkgs/by-name/ei/eigen2/cmake-4-build.patch b/pkgs/by-name/ei/eigen2/cmake-4-build.patch new file mode 100644 index 000000000000..2fa18bbfc9d3 --- /dev/null +++ b/pkgs/by-name/ei/eigen2/cmake-4-build.patch @@ -0,0 +1,47 @@ +diff --git i/CMakeLists.txt w/CMakeLists.txt +index bb12a7cf5..932187427 100644 +--- i/CMakeLists.txt ++++ w/CMakeLists.txt +@@ -1,5 +1,5 @@ + project(Eigen) +-cmake_minimum_required(VERSION 2.6.2) ++cmake_minimum_required(VERSION 3.10) + + set(INCLUDE_INSTALL_DIR + "${CMAKE_INSTALL_PREFIX}/include/eigen2" +diff --git i/doc/examples/CMakeLists.txt w/doc/examples/CMakeLists.txt +index 9db5b1f58..b535ae80e 100644 +--- i/doc/examples/CMakeLists.txt ++++ w/doc/examples/CMakeLists.txt +@@ -8,12 +8,10 @@ ADD_EXECUTABLE(${example} ${example_src}) + if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) + target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + endif() +-GET_TARGET_PROPERTY(example_executable +- ${example} LOCATION) + ADD_CUSTOM_COMMAND( + TARGET ${example} + POST_BUILD +- COMMAND ${example_executable} ++ COMMAND ${example} + ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out + ) + ADD_DEPENDENCIES(all_examples ${example}) +diff --git i/doc/snippets/CMakeLists.txt w/doc/snippets/CMakeLists.txt +index 7458830b0..153dbfc68 100644 +--- i/doc/snippets/CMakeLists.txt ++++ w/doc/snippets/CMakeLists.txt +@@ -14,12 +14,10 @@ ADD_EXECUTABLE(${compile_snippet_target} + if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO) + target_link_libraries(${compile_snippet_target} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO}) + endif() +-GET_TARGET_PROPERTY(compile_snippet_executable +- ${compile_snippet_target} LOCATION) + ADD_CUSTOM_COMMAND( + TARGET ${compile_snippet_target} + POST_BUILD +- COMMAND ${compile_snippet_executable} ++ COMMAND ${compile_snippet_target} + ARGS >${CMAKE_CURRENT_BINARY_DIR}/${snippet}.out + ) + ADD_DEPENDENCIES(all_snippets ${compile_snippet_target}) diff --git a/pkgs/by-name/ei/eigen2/package.nix b/pkgs/by-name/ei/eigen2/package.nix index 2df45c985510..961879811827 100644 --- a/pkgs/by-name/ei/eigen2/package.nix +++ b/pkgs/by-name/ei/eigen2/package.nix @@ -18,6 +18,10 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; + # CMake 2.6.2 is deprecated and is no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + patches = [ ./cmake-4-build.patch ]; + meta = with lib; { homepage = "https://eigen.tuxfamily.org"; description = "C++ template library for linear algebra: vectors, matrices, and related algorithms"; From 070599299c38343820616f1a3e8c9a9f0af0bd00 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment?= Date: Thu, 16 Oct 2025 11:20:25 -0700 Subject: [PATCH 3/3] soi: fix build failure with cmake 4 - CMake 4 is no longer retro compatible with versions < 3.5 - PROJECT_VERSION variable was now overwritten by the call to project() function so updating how the version was set has been needed. --- pkgs/games/soi/cmake-4-build.patch | 60 ++++++++++++++++++++++++++++++ pkgs/games/soi/default.nix | 4 ++ 2 files changed, 64 insertions(+) create mode 100644 pkgs/games/soi/cmake-4-build.patch diff --git a/pkgs/games/soi/cmake-4-build.patch b/pkgs/games/soi/cmake-4-build.patch new file mode 100644 index 000000000000..e0d18c3a70cd --- /dev/null +++ b/pkgs/games/soi/cmake-4-build.patch @@ -0,0 +1,60 @@ +diff --git i/CMakeLists.txt w/CMakeLists.txt +index 1298088..73a5c2d 100644 +--- i/CMakeLists.txt ++++ w/CMakeLists.txt +@@ -1,11 +1,11 @@ + #CMake script for Spheres of Influence + #Run 'cmake ' to generate a makefile +-cmake_minimum_required(VERSION 2.6) ++cmake_minimum_required(VERSION 3.10) + + #definitions + set(PROJECT_NAME "Spheres\ of\ Influence") + set(APP_NAME soi) +-set(PROJECT_VERSION 0 1 2) ++set(PROJECT_VERSION "0.1.2") + set(DESCRIPTION "A physics-based 3D puzzle game") + set(README README.txt) + set(LICENSE ${README}) +@@ -52,7 +52,7 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} + "${CMAKE_SOURCE_DIR}/${EXTRA_MODULES_IN}") + + #declare the project +-project(${PROJECT_NAME}) ++project(${PROJECT_NAME} VERSION ${PROJECT_VERSION}) + + #grab source files + file(GLOB_RECURSE HEADERS ${CMAKE_SOURCE_DIR}/src/*.h) +@@ -105,18 +105,13 @@ endif() + #declare the target program + add_executable(${APP_NAME} ${SOURCES} ${EXTRA_SOURCES} ${HEADERS}) + +-#extract the proper versioning breakdown +-list(GET PROJECT_VERSION 0 VERSION_MAJOR ) +-list(GET PROJECT_VERSION 1 VERSION_MINOR ) +-list(GET PROJECT_VERSION 2 VERSION_PATCH ) +- + #add some useful preprocessor defines + set_property( + TARGET ${APP_NAME} PROPERTY COMPILE_DEFINITIONS + ${COMPILEDEFS} + # PROJECT_NAME="${PROJECT_NAME}" + # AUTHOR_NAMES="${AUTHORS}" +-# PROJECT_VERSION="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}" ++# PROJECT_VERSION="${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}" + ) + + #pass on the flags +@@ -168,9 +163,9 @@ set(CPACK_PACKAGE_INSTALL_DIRECTORY ${PROJECT_NAME}) + set(CPACK_PACKAGE_DESCRIPTION_FILE ${README}) + set(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${DESCRIPTION}) + set(CPACK_PACKAGE_DESCRIPTION ${DESCRIPTION}) +-set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) +-set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) +-set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH}) ++set(CPACK_PACKAGE_PROJECT_VERSION_MAJOR ${PROJECT_VERSION_MAJOR}) ++set(CPACK_PACKAGE_PROJECT_VERSION_MINOR ${PROJECT_VERSION_MINOR}) ++set(CPACK_PACKAGE_PROJECT_VERSION_PATCH ${PROJECT_VERSION_PATCH}) + #set(CPACK_PACKAGE_EXECUTABLES "${APP_NAME}";${PROJECT_NAME}) + set(CPACK_RESOURCE_FILE_README ${README}) + set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_SOURCE_DIR}/${LICENSE}) diff --git a/pkgs/games/soi/default.nix b/pkgs/games/soi/default.nix index c99a422fe27d..d46f093092e1 100644 --- a/pkgs/games/soi/default.nix +++ b/pkgs/games/soi/default.nix @@ -37,6 +37,10 @@ stdenv.mkDerivation rec { "-DLUABIND_LIBRARY=${luabind}/lib/libluabind09.a" ]; + # CMake 2.6 is deprecated and is no longer supported by CMake > 4 + # https://github.com/NixOS/nixpkgs/issues/445447 + patches = [ ./cmake-4-build.patch ]; + meta = with lib; { description = "Physics-based puzzle game"; mainProgram = "soi";