From a01707e1a431e7413b93a8bb9ed9a171e8217cea Mon Sep 17 00:00:00 2001 From: Mrmaxmeier Date: Tue, 9 Jul 2024 17:17:59 +0200 Subject: [PATCH] python312Packages.capstone: enable, add distutils patch --- .../python-modules/capstone/default.nix | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pkgs/development/python-modules/capstone/default.nix b/pkgs/development/python-modules/capstone/default.nix index ce7063adcd51..74035c9bef30 100644 --- a/pkgs/development/python-modules/capstone/default.nix +++ b/pkgs/development/python-modules/capstone/default.nix @@ -4,19 +4,24 @@ capstone, stdenv, setuptools, - pythonAtLeast, + fetchpatch, }: buildPythonPackage rec { pname = "capstone"; version = lib.getVersion capstone; - format = "setuptools"; - - # distutils usage - disabled = pythonAtLeast "3.12"; src = capstone.src; sourceRoot = "${src.name}/bindings/python"; + patches = [ + # Drop distutils in python binding (PR 2271) + (fetchpatch { + name = "drop-distutils-in-python-binding.patch"; + url = "https://github.com/capstone-engine/capstone/commit/d63211e3acb64fceb8b1c4a0d804b4b027f4ef71.patch"; + hash = "sha256-zUGeFmm3xH5dzfPJE8nnHwqwFBrsZ7w8LBJAy20/3RI="; + stripLen = 2; + }) + ]; # libcapstone.a is not built with BUILD_SHARED_LIBS. For some reason setup.py # checks if it exists but it is not really needed. Most likely a bug in setup.py.