From 6e820d5632c6c3a86eb9c9b09e1e1e371a379339 Mon Sep 17 00:00:00 2001 From: Greg Hellings Date: Thu, 9 Jan 2025 11:23:27 -0600 Subject: [PATCH] python3Packages.python-prctl: Fix build failure Fixes #236443 by giving the build product support for versions of Python >= 3.10. Also fixes build failures in >= 3.12 by explicitly adding distutils dependency --- .../python-modules/python-prctl/default.nix | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/python-prctl/default.nix b/pkgs/development/python-modules/python-prctl/default.nix index ffc946a56f54..b4c3731a76cb 100644 --- a/pkgs/development/python-modules/python-prctl/default.nix +++ b/pkgs/development/python-modules/python-prctl/default.nix @@ -4,6 +4,7 @@ fetchPypi, libcap, pytestCheckHook, + distutils, }: buildPythonPackage rec { @@ -18,7 +19,17 @@ buildPythonPackage rec { buildInputs = [ libcap ]; - nativeCheckInputs = [ pytestCheckHook ]; + nativeCheckInputs = [ + distutils + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace test_prctl.py \ + --replace-fail \ + 'sys.version[0:3]' \ + '"cpython-%d%d" % (sys.version_info.major, sys.version_info.minor)' + ''; disabledTests = [ # Intel MPX support was removed in GCC 9.1 & Linux kernel 5.6