python39Packages.bsddb3: disable on Python 3.10+, remove distutils usage

This commit is contained in:
kenshin 2024-05-25 21:07:08 +02:00 committed by Sandro Jäckel
parent 92fd43bd75
commit 10e9deb798

View File

@ -1,11 +1,11 @@
{
lib,
buildPythonPackage,
pythonAtLeast,
python,
fetchPypi,
setuptools,
pkgs,
python,
pythonOlder,
}:
buildPythonPackage rec {
@ -22,11 +22,9 @@ buildPythonPackage rec {
buildInputs = [ pkgs.db ];
doCheck = pythonOlder "3.12"; # distutils usage
checkPhase = ''
${python.interpreter} test.py
'';
# See : https://github.com/NixOS/nixpkgs/pull/311198#discussion_r1599257522
# More details here : https://www.jcea.es/programacion/pybsddb.htm
disabled = pythonAtLeast "3.10";
# Path to database need to be set.
# Somehow the setup.py flag is not propagated.
@ -36,6 +34,16 @@ buildPythonPackage rec {
export BERKELEYDB_DIR=${pkgs.db.dev};
'';
postPatch = ''
substituteInPlace test3.py \
--replace-fail "from distutils.util import get_platform" "from sysconfig import get_platform" \
--replace-fail "sys.config[0:3]" "sys.implementation.cache_tag"
'';
checkPhase = ''
${python.interpreter} test.py
'';
meta = with lib; {
description = "Python bindings for Oracle Berkeley DB";
homepage = "https://www.jcea.es/programacion/pybsddb.htm";