capstone_4, edb: fix build failure with cmake 4 (#452783)

This commit is contained in:
Yohann Boniface
2025-10-23 21:14:34 +00:00
committed by GitHub
2 changed files with 23 additions and 0 deletions
+11
View File
@@ -26,6 +26,17 @@ stdenv.mkDerivation rec {
doCheck = true;
# CMake 2.6 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.6)" \
"cmake_minimum_required(VERSION 3.10)" \
--replace-fail \
"cmake_policy (SET CMP0048 OLD)" \
"cmake_policy (SET CMP0048 NEW)"
'';
meta = {
description = "Advanced disassembly library";
homepage = "http://www.capstone-engine.org";
@@ -53,6 +53,18 @@ stdenv.mkDerivation (finalAttrs: {
# submodules were fetched and will throw an error if it's not there.
# Avoid using leaveDotGit in the fetchFromGitHub options as it is non-deterministic.
mkdir -p src/qhexview/.git lib/gdtoa-desktop/.git
# CMake 3.1 is deprecated and is no longer supported by CMake > 4
# https://github.com/NixOS/nixpkgs/issues/445447
substituteInPlace CMakeLists.txt src/CMakeLists.txt src/test/CMakeLists.txt plugins/CMakeLists.txt plugins/*/CMakeLists.txt --replace-fail \
"cmake_minimum_required (VERSION 3.1)" \
"cmake_minimum_required(VERSION 3.10)"
substituteInPlace lib/CMakeLists.txt lib/libELF/CMakeLists.txt lib/libPE/CMakeLists.txt --replace-fail \
"cmake_minimum_required(VERSION 3.1)" \
"cmake_minimum_required(VERSION 3.10)"
substituteInPlace lib/gdtoa-desktop/CMakeLists.txt --replace-fail \
"cmake_minimum_required (VERSION 3.0)" \
"cmake_minimum_required (VERSION 3.10)"
'';
passthru = {