python312Packages.borb: fix build failure on darwin (#355819)

This commit is contained in:
Artturin
2024-11-14 20:04:24 +02:00
committed by GitHub
@@ -1,5 +1,6 @@
{
lib,
stdenv,
buildPythonPackage,
cryptography,
fetchFromGitHub,
@@ -30,6 +31,14 @@ buildPythonPackage rec {
hash = "sha256-eVxpcYL3ZgwidkSt6tUav3Bkne4lo1QCshdUFqkA0wI=";
};
# ModuleNotFoundError: No module named '_decimal'
postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
grep -Rl 'from _decimal' tests/ | while read -r test_file; do
substituteInPlace "$test_file" \
--replace-fail 'from _decimal' 'from decimal'
done
'';
build-system = [ setuptools ];
dependencies = [