From c7a4c331c2329665cd92e4f6fba8114784731065 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Sun, 19 Jan 2025 21:16:59 +0100 Subject: [PATCH] python3Packages.oslo-utils: 7.3.0 -> 8.0.0 --- .../python-modules/oslo-utils/ctypes.patch | 22 +++++++++++++++++++ .../python-modules/oslo-utils/default.nix | 15 +++++++++++-- 2 files changed, 35 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/python-modules/oslo-utils/ctypes.patch diff --git a/pkgs/development/python-modules/oslo-utils/ctypes.patch b/pkgs/development/python-modules/oslo-utils/ctypes.patch new file mode 100644 index 000000000000..bed62535a80f --- /dev/null +++ b/pkgs/development/python-modules/oslo-utils/ctypes.patch @@ -0,0 +1,22 @@ +diff --git a/oslo_utils/secretutils.py b/oslo_utils/secretutils.py +index 3183865..83e00e8 100644 +--- a/oslo_utils/secretutils.py ++++ b/oslo_utils/secretutils.py +@@ -46,13 +46,10 @@ def md5(string=b'', usedforsecurity=True): + return hashlib.md5(string, usedforsecurity=usedforsecurity) # nosec + + +-if ctypes.util.find_library("crypt"): +- _libcrypt = ctypes.CDLL(ctypes.util.find_library("crypt"), use_errno=True) +- _crypt = _libcrypt.crypt +- _crypt.argtypes = (ctypes.c_char_p, ctypes.c_char_p) +- _crypt.restype = ctypes.c_char_p +-else: +- _crypt = None ++_libcrypt = ctypes.CDLL("@crypt@", use_errno=True) ++_crypt = _libcrypt.crypt ++_crypt.argtypes = (ctypes.c_char_p, ctypes.c_char_p) ++_crypt.restype = ctypes.c_char_p + + + def crypt_mksalt(method): diff --git a/pkgs/development/python-modules/oslo-utils/default.nix b/pkgs/development/python-modules/oslo-utils/default.nix index 578e2dfdbf9a..ef35d15484ab 100644 --- a/pkgs/development/python-modules/oslo-utils/default.nix +++ b/pkgs/development/python-modules/oslo-utils/default.nix @@ -7,16 +7,20 @@ eventlet, fixtures, iso8601, + libxcrypt-legacy, netaddr, netifaces, oslo-i18n, oslotest, packaging, pbr, + psutil, pyparsing, pytz, qemu-utils, + replaceVars, setuptools, + stdenv, stestr, testscenarios, tzdata, @@ -27,15 +31,21 @@ buildPythonPackage rec { pname = "oslo-utils"; - version = "7.3.0"; + version = "8.0.0"; pyproject = true; src = fetchPypi { pname = "oslo.utils"; inherit version; - hash = "sha256-WaXT5Oe7x42AHM68K4I+QptiTBK7bjtudvccKfK/Id8="; + hash = "sha256-kG/PHIb2cfIkwZJbKo03WgU5FD+2FYsT4gKnndjmxpQ="; }; + patches = [ + (replaceVars ./ctypes.patch { + crypt = "${lib.getLib libxcrypt-legacy}/lib/libcrypt${stdenv.hostPlatform.extensions.sharedLibrary}"; + }) + ]; + postPatch = '' # only a small portion of the listed packages are actually needed for running the tests # so instead of removing them one by one remove everything @@ -54,6 +64,7 @@ buildPythonPackage rec { netifaces oslo-i18n packaging + psutil pyparsing pytz tzdata