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";
|
|
|
|
version = "1.0.0";
|
|
|
|
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;
|
|
|
|
sha256 = "sha256-0Eg0ghITRrCTuaQlGNQPkhrfRFkVt66jB+smdoyDloI=";
|
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 ];
|
|
|
|
|
2021-03-15 08:37:03 +00:00
|
|
|
checkInputs = [
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|