catimg: use proper patch for cmake 4 compatibility (#450222)

This commit is contained in:
Leona Maroni
2025-10-10 08:37:38 +00:00
committed by GitHub
+11 -6
View File
@@ -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";
};