2021-02-04 04:27:18 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, substituteAll
|
|
|
|
, pythonOlder
|
|
|
|
, geos
|
2021-02-26 09:25:13 +00:00
|
|
|
, pytestCheckHook
|
2021-02-04 04:27:18 +00:00
|
|
|
, cython
|
2017-09-05 08:38:02 +01:00
|
|
|
, numpy
|
2021-02-04 04:27:18 +00:00
|
|
|
, fetchpatch
|
2017-09-05 08:38:02 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Shapely";
|
2020-10-22 18:14:01 +01:00
|
|
|
version = "1.7.1";
|
2021-02-04 04:27:18 +00:00
|
|
|
disabled = pythonOlder "3.5";
|
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
|
|
|
};
|
|
|
|
|
2019-02-25 14:10:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
geos # for geos-config
|
|
|
|
cython
|
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2021-02-26 09:25:13 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
numpy
|
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2021-02-26 09:25:13 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2021-02-27 17:51:46 +00:00
|
|
|
# Environment variable used in shapely/_buildcfg.py
|
2019-02-25 14:10:45 +00:00
|
|
|
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 = [
|
2021-02-04 04:27:18 +00:00
|
|
|
# Fix with geos 3.9. This patch will be part of the next release after 1.7.1
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Toblerity/Shapely/commit/77879a954d24d1596f986d16ba3eff5e13861164.patch";
|
|
|
|
sha256 = "1w7ngjqbpf9vnvrfg4nyv34kckim9a60gvx20h6skc79xwihd4m5";
|
|
|
|
excludes = [
|
|
|
|
"tests/test_create_inconsistent_dimensionality.py"
|
|
|
|
"appveyor.yml"
|
|
|
|
".travis.yml"
|
|
|
|
];
|
|
|
|
})
|
|
|
|
# Patch to search form GOES .so/.dylib files in a Nix-aware way
|
2019-02-25 14:10:45 +00:00
|
|
|
(substituteAll {
|
|
|
|
src = ./library-paths.patch;
|
|
|
|
libgeos_c = GEOS_LIBRARY_PATH;
|
2021-01-24 00:29:22 +00:00
|
|
|
libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
|
2019-02-25 14:10:45 +00:00
|
|
|
})
|
2021-02-22 18:48:01 +00:00
|
|
|
];
|
2017-09-05 08:38:02 +01:00
|
|
|
|
2021-02-22 08:28:56 +00:00
|
|
|
preCheck = ''
|
2019-02-25 14:10:45 +00:00
|
|
|
rm -r shapely # prevent import of local shapely
|
2017-09-05 08:38:02 +01:00
|
|
|
'';
|
|
|
|
|
2021-02-22 08:28:56 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_collection"
|
|
|
|
];
|
|
|
|
|
2021-02-27 17:51:46 +00:00
|
|
|
pythonImportsCheck = [ "shapely" ];
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2017-09-05 08:38:02 +01:00
|
|
|
description = "Geometric objects, predicates, and operations";
|
|
|
|
homepage = "https://pypi.python.org/pypi/Shapely/";
|
2021-02-27 17:51:46 +00:00
|
|
|
license = with licenses; [ bsd3 ];
|
|
|
|
maintainers = with maintainers; [ knedlsepp ];
|
2017-09-05 08:38:02 +01:00
|
|
|
};
|
|
|
|
}
|