summary refs log tree commit diff
path: root/pkgs/development/python-modules/shapely
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-09-05 08:38:02 +0100
committerJörg Thalheim <joerg@thalheim.io>2017-09-05 08:38:02 +0100
commit85011d70845f5705d6b06ba2a3c2a10eb352fcd7 (patch)
treee359c03c588e09ca434fd7af5244821de2ca2312 /pkgs/development/python-modules/shapely
parent1dbe68a5e8d52a70d815671023566058a14c70fc (diff)
downloadnixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar.gz
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar.bz2
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar.lz
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar.xz
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.tar.zst
nixlib-85011d70845f5705d6b06ba2a3c2a10eb352fcd7.zip
python.pkgs.shapely: fix library extension
there was one dot too much
Diffstat (limited to 'pkgs/development/python-modules/shapely')
-rw-r--r--pkgs/development/python-modules/shapely/default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/shapely/default.nix b/pkgs/development/python-modules/shapely/default.nix
new file mode 100644
index 000000000000..8b8b06f9a2cb
--- /dev/null
+++ b/pkgs/development/python-modules/shapely/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, buildPythonPackage, fetchPypi
+, geos, glibcLocales, pytest, cython, sharedLibraryExtension
+, numpy
+}:
+
+buildPythonPackage rec {
+  name = "${pname}-${version}";
+  pname = "Shapely";
+  version = "1.5.15";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0lfqxb3kpdn0g9zzlhzg79yc8iyy4fpsk0p5nd80gar1mmhr8pg7";
+  };
+
+  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 ''
+    sed -i "s|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${sharedLibraryExtension}'])|" shapely/geos.py
+    sed -i "s|free = load_dll('c').free|free = load_dll('c', fallbacks=['${stdenv.cc.libc}/lib/${stdenv.cc.libc}']).free|" shapely/geos.py
+  '';
+
+  # 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/";
+  };
+}