2022-06-26 10:26:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, libspatialindex
|
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
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";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.1.0";
|
2022-06-26 10:26:21 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2022-06-26 10:26:21 +00:00
|
|
|
pname = "Rtree";
|
|
|
|
inherit version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-b47lBN3l0AWyWwiq9b4LNASvOtX+zm4d3N41kIp5ipU=";
|
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
|
|
|
'';
|
|
|
|
|
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";
|
|
|
|
homepage = "https://toblerity.org/rtree/";
|
2021-03-15 08:37:03 +00:00
|
|
|
license = licenses.mit;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ bgamari ];
|
|
|
|
};
|
|
|
|
}
|