2022-06-26 10:26:21 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
2024-01-25 14:12:00 +00:00
|
|
|
, fetchFromGitHub
|
2022-06-26 10:26:21 +00:00
|
|
|
, libspatialindex
|
|
|
|
, numpy
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
2024-01-25 14:12:00 +00:00
|
|
|
, 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-01-25 14:12:00 +00:00
|
|
|
version = "1.2.0";
|
|
|
|
pyproject = true;
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Toblerity";
|
|
|
|
repo = "rtree";
|
|
|
|
rev = "refs/tags/${version}";
|
|
|
|
hash = "sha256-RmAiyYrkUMBN/ebmo27WvFcRmYlKkywuQHLLUbluTTw=";
|
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;
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ bgamari ];
|
|
|
|
};
|
|
|
|
}
|