depot/third_party/nixpkgs/pkgs/development/python-modules/rtree/default.nix
Default email 23b612e36f Project import generated by Copybara.
GitOrigin-RevId: ae5c332cbb5827f6b1f02572496b141021de335f
2024-01-25 23:12:00 +09:00

53 lines
1.1 KiB
Nix

{ lib
, stdenv
, buildPythonPackage
, fetchFromGitHub
, libspatialindex
, numpy
, pytestCheckHook
, pythonOlder
, setuptools
, wheel
}:
buildPythonPackage rec {
pname = "rtree";
version = "1.2.0";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "Toblerity";
repo = "rtree";
rev = "refs/tags/${version}";
hash = "sha256-RmAiyYrkUMBN/ebmo27WvFcRmYlKkywuQHLLUbluTTw=";
};
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; [ bgamari ];
};
}