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";
|
2020-03-29 12:15:20 +01:00
|
|
|
version = "1.7.0";
|
2017-09-05 08:38:02 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-03-29 12:15:20 +01:00
|
|
|
sha256 = "07lmrihj6pa7f99m97hbf2anqlhhwippcdz03bqkyihnlkhry6p2";
|
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/";
|
|
|
|
};
|
|
|
|
}
|