2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libspatialindex,
|
|
|
|
numpy,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
|
|
|
wheel,
|
2021-03-15 08:37:03 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2022-06-26 10:26:21 +00:00
|
|
|
pname = "rtree";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.3.0";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Toblerity";
|
|
|
|
repo = "rtree";
|
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-yuSPRb8SRz+FRmwFCKDx+gtp9IWaneQ84jDuZP7TX0A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
postPatch = ''
|
2021-03-15 08:37:03 +00:00
|
|
|
substituteInPlace rtree/finder.py --replace \
|
2022-06-26 10:26:21 +00:00
|
|
|
'find_library("spatialindex_c")' '"${libspatialindex}/lib/libspatialindex_c${stdenv.hostPlatform.extensions.sharedLibrary}"'
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools
|
|
|
|
wheel
|
|
|
|
];
|
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
buildInputs = [ libspatialindex ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-03-15 08:37:03 +00:00
|
|
|
numpy
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
pythonImportsCheck = [ "rtree" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "R-Tree spatial index for Python GIS";
|
2024-01-25 14:12:00 +00:00
|
|
|
homepage = "https://github.com/Toblerity/rtree";
|
|
|
|
changelog = "https://github.com/Toblerity/rtree/blob/${version}/CHANGES.rst";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = licenses.mit;
|
2024-09-19 14:19:46 +00:00
|
|
|
maintainers = with maintainers; teams.geospatial.members ++ [ bgamari ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|