2022-01-26 04:04:25 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, python
|
|
|
|
, geos
|
|
|
|
, pytestCheckHook
|
|
|
|
, cython
|
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygeos";
|
2022-09-09 14:08:57 +00:00
|
|
|
version = "0.13";
|
2022-01-26 04:04:25 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-09-09 14:08:57 +00:00
|
|
|
sha256 = "sha256-HDcweKrVou/tHDnNcceXqiAzvzCH8191FrrIm+ULmGE=";
|
2022-01-26 04:04:25 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
patches = [
|
|
|
|
# Adapt https://github.com/shapely/shapely/commit/4889bd2d72ff500e51ba70d5b954241878349562,
|
|
|
|
# backporting to pygeos
|
|
|
|
./fix-for-geos-3-11.patch
|
|
|
|
];
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
geos # for geos-config
|
|
|
|
cython
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
|
|
|
|
# The cythonized extensions are required to exist in the pygeos/ directory
|
|
|
|
# for the package to function. Therefore override of buildPhase was
|
|
|
|
# necessary.
|
|
|
|
buildPhase = ''
|
|
|
|
${python.interpreter} setup.py build_ext --inplace
|
|
|
|
${python.interpreter} setup.py bdist_wheel
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "pygeos" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Wraps GEOS geometry functions in numpy ufuncs.";
|
|
|
|
homepage = "https://github.com/pygeos/pygeos";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ nialov ];
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|