depot/third_party/nixpkgs/pkgs/development/python-modules/rtree/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

54 lines
1.1 KiB
Nix

{
lib,
stdenv,
buildPythonPackage,
fetchFromGitHub,
libspatialindex,
numpy,
pytestCheckHook,
pythonOlder,
setuptools,
wheel,
}:
buildPythonPackage rec {
pname = "rtree";
version = "1.3.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "Toblerity";
repo = "rtree";
rev = "refs/tags/${version}";
hash = "sha256-yuSPRb8SRz+FRmwFCKDx+gtp9IWaneQ84jDuZP7TX0A=";
};
postPatch = ''
substituteInPlace rtree/finder.py --replace \
'find_library("spatialindex_c")' '"${libspatialindex}/lib/libspatialindex_c${stdenv.hostPlatform.extensions.sharedLibrary}"'
'';
nativeBuildInputs = [
setuptools
wheel
];
buildInputs = [ libspatialindex ];
nativeCheckInputs = [
numpy
pytestCheckHook
];
pythonImportsCheck = [ "rtree" ];
meta = with lib; {
description = "R-Tree spatial index for Python GIS";
homepage = "https://github.com/Toblerity/rtree";
changelog = "https://github.com/Toblerity/rtree/blob/${version}/CHANGES.rst";
license = licenses.mit;
maintainers = with maintainers; teams.geospatial.members ++ [ bgamari ];
};
}