From 993162a5f78d6ded701ab675703fe0a9169c0952 Mon Sep 17 00:00:00 2001 From: Dave Walker Date: Thu, 9 Oct 2025 10:23:59 +0100 Subject: [PATCH] catimg: fix build with cmake 4 Patches CMakeLists.txt to require CMake 3.10 instead of 2.8. CMake 4 doesn't support versions older than 3.5, and versions between 3.5-3.10 are deprecated. Uses fetchpatch to pull the fix from the merged upstream PR. Fixes: https://github.com/NixOS/nixpkgs/issues/449801 Signed-off-by: Dave Walker --- pkgs/by-name/ca/catimg/package.nix | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/pkgs/by-name/ca/catimg/package.nix b/pkgs/by-name/ca/catimg/package.nix index 64ede6e57525..7a0ee8b8d6cc 100644 --- a/pkgs/by-name/ca/catimg/package.nix +++ b/pkgs/by-name/ca/catimg/package.nix @@ -2,6 +2,7 @@ lib, stdenv, fetchFromGitHub, + fetchpatch, cmake, }: @@ -16,14 +17,18 @@ stdenv.mkDerivation rec { sha256 = "0a2dswbv4xddb2l2d55hc43lzvjwrjs5z9am7v6i0p0mi2fmc89s"; }; - nativeBuildInputs = [ cmake ]; - - # Fix build with CMake 4: https://github.com/NixOS/nixpkgs/issues/449801 - # CMake 4 removed support for CMake < 3.5, so we set the minimum policy version - cmakeFlags = [ - (lib.cmakeFeature "CMAKE_POLICY_VERSION_MINIMUM" "3.5") + patches = [ + # Update CMake minimum required version for CMake 4 compatibility + # https://github.com/NixOS/nixpkgs/issues/449801 + # https://github.com/posva/catimg/pull/73 + (fetchpatch { + url = "https://github.com/posva/catimg/commit/155786229230e2ddc2dd97e4e0219d1e2aa66099.patch"; + hash = "sha256-eDXYa8eGvhC7NGL6V+R3Ui5FBtx/APGUC6Sw9rv2ho4="; + }) ]; + nativeBuildInputs = [ cmake ]; + env = lib.optionalAttrs (stdenv.hostPlatform.libc == "glibc") { CFLAGS = "-D_DEFAULT_SOURCE"; };