From 0ab968860f88e347186a4dea489a50c3d356a44c Mon Sep 17 00:00:00 2001 From: Marcin Serwin Date: Sun, 5 Oct 2025 00:36:22 +0200 Subject: [PATCH] maxflow: fix build with CMake 4 Signed-off-by: Marcin Serwin --- .../0001-Raise-minimum-CMake-version.patch | 42 +++++++++++++++++++ pkgs/by-name/ma/maxflow/package.nix | 5 +++ 2 files changed, 47 insertions(+) create mode 100644 pkgs/by-name/ma/maxflow/0001-Raise-minimum-CMake-version.patch diff --git a/pkgs/by-name/ma/maxflow/0001-Raise-minimum-CMake-version.patch b/pkgs/by-name/ma/maxflow/0001-Raise-minimum-CMake-version.patch new file mode 100644 index 000000000000..42523114b071 --- /dev/null +++ b/pkgs/by-name/ma/maxflow/0001-Raise-minimum-CMake-version.patch @@ -0,0 +1,42 @@ +From e4d8d49beebea53f5ed71d7134528a806e89d95f Mon Sep 17 00:00:00 2001 +From: Marcin Serwin +Date: Sun, 5 Oct 2025 00:35:33 +0200 +Subject: [PATCH] Raise minimum CMake version + +Compatibility with CMake versions older than 3.5 is removed in CMake 4 +and older than 3.10 is deprecated. + +Signed-off-by: Marcin Serwin +--- + CMakeLists.txt | 12 +----------- + 1 file changed, 1 insertion(+), 11 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 68c9781..c77176c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -13,20 +13,10 @@ + # You should have received a copy of the GNU General Public License + # along with MAXFLOW. If not, see . + ++CMAKE_MINIMUM_REQUIRED(VERSION 3.10) + + PROJECT("maxflow") + +-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.5 FATAL_ERROR) +- +-if(COMMAND cmake_policy) +- cmake_policy(SET CMP0003 NEW) +- cmake_policy(SET CMP0012 NEW) +- IF(${CMAKE_VERSION} VERSION_GREATER 3.0.0) +- cmake_policy(SET CMP0042 NEW) +- ENDIF() +-endif(COMMAND cmake_policy) +- +- + SET(PACKAGE_NAME "maxflow") + SET(MAJOR_VERSION 3) + SET(MINOR_VERSION 0) +-- +2.51.0 + diff --git a/pkgs/by-name/ma/maxflow/package.nix b/pkgs/by-name/ma/maxflow/package.nix index 5615fc005456..8837d39bc76a 100644 --- a/pkgs/by-name/ma/maxflow/package.nix +++ b/pkgs/by-name/ma/maxflow/package.nix @@ -16,6 +16,11 @@ stdenv.mkDerivation rec { hash = "sha256-a84SxGMnfBEaoMEeeIFffTOtErSN5yzZBrAUDjkalGY="; }; + patches = [ + # https://github.com/gerddie/maxflow/pull/7 + ./0001-Raise-minimum-CMake-version.patch + ]; + nativeBuildInputs = [ cmake ]; meta = with lib; {