2017-09-05 09:38:02 +02:00
|
|
|
{ stdenv, buildPythonPackage, fetchPypi
|
2017-09-12 21:36:41 +02:00
|
|
|
, geos, glibcLocales, pytest, cython
|
2017-09-05 09:38:02 +02:00
|
|
|
, numpy
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
pname = "Shapely";
|
2017-10-09 22:16:43 +02:00
|
|
|
version = "1.6.1";
|
2017-09-05 09:38:02 +02:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2017-10-09 22:16:43 +02:00
|
|
|
sha256 = "1iyhrkm6g233gwbd20sf4aq4by0kg52cz1d2k7imnqgzjpmkgqas";
|
2017-09-05 09:38:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ geos glibcLocales cython ];
|
|
|
|
|
|
|
|
checkInputs = [ pytest ];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [ numpy ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
export LANG="en_US.UTF-8";
|
|
|
|
'';
|
|
|
|
|
|
|
|
patchPhase = let
|
|
|
|
libc = if stdenv.isDarwin then "libc.dylib" else "libc.so.6";
|
|
|
|
in ''
|
2017-09-12 21:36:41 +02:00
|
|
|
sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}'])|" shapely/geos.py
|
2017-10-09 22:15:17 +02:00
|
|
|
sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${libc}']).free|" shapely/geos.py
|
2017-09-05 09:38:02 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
# tests/test_voctorized fails because the vectorized extension is not
|
|
|
|
# available in when running tests
|
|
|
|
checkPhase = ''
|
|
|
|
py.test --ignore tests/test_vectorized.py
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Geometric objects, predicates, and operations";
|
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
|
|
|
homepage = "https://pypi.python.org/pypi/Shapely/";
|
|
|
|
};
|
|
|
|
}
|