2020-11-22 14:13:40 +00:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi, substituteAll, pythonOlder
|
2019-02-25 14:10:45 +00:00
|
|
|
, geos, pytest, cython
|
2017-09-05 08:38:02 +01:00
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Shapely";
|
2020-10-22 18:14:01 +01:00
|
|
|
version = "1.7.1";
|
2017-09-05 08:38:02 +01:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-10-22 18:14:01 +01:00
|
|
|
sha256 = "0adiz4jwmwxk7k1awqifb1a9bj5x4nx4gglb5dz9liam21674h8n";
|
2017-09-05 08:38:02 +01:00
|
|
|
};
|
2020-11-22 14:13:40 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
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;
|
2020-12-28 04:20:00 +00:00
|
|
|
libc = stdenv.lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
|
2019-02-25 14:10:45 +00:00
|
|
|
})
|
|
|
|
];
|
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/";
|
|
|
|
};
|
|
|
|
}
|