2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
2024-06-20 14:57:18 +00:00
|
|
|
pythonAtLeast,
|
|
|
|
python,
|
2024-06-05 15:53:02 +00:00
|
|
|
fetchPypi,
|
|
|
|
setuptools,
|
|
|
|
pkgs,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "bsddb3";
|
2020-12-03 08:41:04 +00:00
|
|
|
version = "6.2.9";
|
2024-05-15 15:35:15 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-03 08:41:04 +00:00
|
|
|
sha256 = "70d05ec8dc568f42e70fc919a442e0daadc2a905a1cfb7ca77f549d49d6e7801";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ pkgs.db ];
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
# See : https://github.com/NixOS/nixpkgs/pull/311198#discussion_r1599257522
|
|
|
|
# More details here : https://www.jcea.es/programacion/pybsddb.htm
|
|
|
|
disabled = pythonAtLeast "3.10";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Path to database need to be set.
|
|
|
|
# Somehow the setup.py flag is not propagated.
|
|
|
|
#setupPyBuildFlags = [ "--berkeley-db=${pkgs.db}" ];
|
|
|
|
# We can also use a variable
|
|
|
|
preConfigure = ''
|
|
|
|
export BERKELEYDB_DIR=${pkgs.db.dev};
|
|
|
|
'';
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python bindings for Oracle Berkeley DB";
|
|
|
|
homepage = "https://www.jcea.es/programacion/pybsddb.htm";
|
2024-04-21 15:54:59 +00:00
|
|
|
license = with licenses; [ agpl3Only ]; # License changed from bsd3 to agpl3 since 6.x
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|