2019-02-25 14:10:45 +00:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi, substituteAll
|
|
|
|
, geos, pytest, cython
|
2017-09-05 08:38:02 +01:00
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Shapely";
|
2018-07-22 11:20:56 +01:00
|
|
|
version = "1.6.4.post2";
|
2017-09-05 08:38:02 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-07-22 11:20:56 +01:00
|
|
|
sha256 = "c4b87bb61fc3de59fc1f85e71a79b0c709dc68364d9584473697aad4aa13240f";
|
2017-09-05 08:38:02 +01:00
|
|
|
};
|
|
|
|
|
2019-02-25 14:10:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
geos # for geos-config
|
|
|
|
cython
|
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
|
2019-02-25 14:10:45 +00:00
|
|
|
# environment variable used in shapely/_buildcfg.py
|
|
|
|
GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2019-02-25 14:10:45 +00:00
|
|
|
patches = [
|
|
|
|
(substituteAll {
|
|
|
|
src = ./library-paths.patch;
|
|
|
|
libgeos_c = GEOS_LIBRARY_PATH;
|
|
|
|
libc = "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}"
|
|
|
|
+ stdenv.lib.optionalString (!stdenv.isDarwin) ".6";
|
|
|
|
})
|
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2018-03-12 00:29:44 +00:00
|
|
|
# Disable the tests that improperly try to use the built extensions
|
2017-09-05 08:38:02 +01:00
|
|
|
checkPhase = ''
|
2019-02-25 14:10:45 +00:00
|
|
|
rm -r shapely # prevent import of local shapely
|
|
|
|
py.test tests
|
2017-09-05 08:38:02 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Geometric objects, predicates, and operations";
|
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
|
|
|
homepage = "https://pypi.python.org/pypi/Shapely/";
|
|
|
|
};
|
|
|
|
}
|