Merge pull request #29282 from obsidiansystems/soext

lib, treewide: Add `*Platform.extensions` and use it where possible
This commit is contained in:
John Ericson
2017-09-13 11:20:06 -04:00
committed by GitHub
18 changed files with 53 additions and 64 deletions

View File

@@ -7,12 +7,12 @@
, psutil
, memory_profiler
, pytest_xdist
, sharedLibraryExtension
}:
let
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${sharedLibraryExtension}";
imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${sharedLibraryExtension}";
soext = stdenv.hostPlatform.extensions.sharedLibrary;
magick_wand_library = "${imagemagick}/lib/libMagickWand-6.Q16${soext}";
imagemagick_library = "${imagemagick}/lib/libMagickCore-6.Q16${soext}";
in buildPythonPackage rec {
pname = "Wand";
version = "0.4.4";

View File

@@ -1,5 +1,5 @@
{ stdenv, buildPythonPackage, fetchPypi
, geos, glibcLocales, pytest, cython, sharedLibraryExtension
, geos, glibcLocales, pytest, cython
, numpy
}:
@@ -26,7 +26,7 @@ buildPythonPackage rec {
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|_lgeos = load_dll('geos_c', fallbacks=.*)|_lgeos = load_dll('geos_c', fallbacks=['${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}'])|" 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
'';