Merge pull request #116128 from marcus7070/marcus7070/rtree-fix

python3Packages.Rtree: fix build
This commit is contained in:
Sandro 2021-03-13 16:44:56 +01:00 committed by GitHub
commit f2846df823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,11 @@
{ lib, stdenv, buildPythonPackage, fetchPypi, libspatialindex, numpy }: { lib,
stdenv,
buildPythonPackage,
fetchPypi,
libspatialindex,
numpy,
pytestCheckHook
}:
buildPythonPackage rec { buildPythonPackage rec {
pname = "Rtree"; pname = "Rtree";
@ -9,21 +16,23 @@ buildPythonPackage rec {
sha256 = "be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e"; sha256 = "be8772ca34699a9ad3fb4cfe2cfb6629854e453c10b3328039301bbfc128ca3e";
}; };
propagatedBuildInputs = [ libspatialindex ]; buildInputs = [ libspatialindex ];
patchPhase = '' patchPhase = ''
substituteInPlace rtree/core.py --replace \ substituteInPlace rtree/finder.py --replace \
"find_library('spatialindex_c')" "'${libspatialindex}/lib/libspatialindex_c${stdenv.hostPlatform.extensions.sharedLibrary}'" "find_library('spatialindex_c')" "'${libspatialindex}/lib/libspatialindex_c${stdenv.hostPlatform.extensions.sharedLibrary}'"
''; '';
# Tests appear to be broken due to mysterious memory unsafe issues. See #36760 checkInputs = [
doCheck = false; numpy
checkInputs = [ numpy ]; pytestCheckHook
];
pythonImportsCheck = [ "rtree" ];
meta = with lib; { meta = with lib; {
description = "R-Tree spatial index for Python GIS"; description = "R-Tree spatial index for Python GIS";
homepage = "https://toblerity.org/rtree/"; homepage = "https://toblerity.org/rtree/";
license = licenses.lgpl21; license = licenses.mit;
maintainers = with maintainers; [ bgamari ]; maintainers = with maintainers; [ bgamari ];
}; };
} }