mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2024-12-27 05:43:50 +03:00
python3Packages.shapely: fix build on darwin
This commit is contained in:
parent
4a75203f02
commit
c5a59b1cdd
@ -29,8 +29,7 @@ buildPythonPackage rec {
|
||||
(substituteAll {
|
||||
src = ./library-paths.patch;
|
||||
libgeos_c = GEOS_LIBRARY_PATH;
|
||||
libc = "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}"
|
||||
+ stdenv.lib.optionalString (!stdenv.isDarwin) ".6";
|
||||
libc = stdenv.lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
|
||||
})
|
||||
];
|
||||
|
||||
|
@ -2,7 +2,7 @@ diff --git a/shapely/geos.py b/shapely/geos.py
|
||||
index d5a67d2..19b7ffc 100644
|
||||
--- a/shapely/geos.py
|
||||
+++ b/shapely/geos.py
|
||||
@@ -61,127 +61,10 @@ def load_dll(libname, fallbacks=None, mode=DEFAULT_MODE):
|
||||
@@ -61,127 +61,17 @@ def load_dll(libname, fallbacks=None, mode=DEFAULT_MODE):
|
||||
"Could not find lib {} or load any of its variants {}.".format(
|
||||
libname, fallbacks or []))
|
||||
|
||||
@ -128,7 +128,14 @@ index d5a67d2..19b7ffc 100644
|
||||
- free.argtypes = [c_void_p]
|
||||
- free.restype = None
|
||||
+_lgeos = CDLL('@libgeos_c@')
|
||||
+free = CDLL('@libc@').free
|
||||
+if sys.platform == 'darwin':
|
||||
+ # ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
|
||||
+ # manpage says, "If filename is NULL, then the returned handle is for the
|
||||
+ # main program". This way we can let the linker do the work to figure out
|
||||
+ # which libc Python is actually using.
|
||||
+ free = CDLL(None).free
|
||||
+else:
|
||||
+ free = CDLL('@libc@').free
|
||||
+free.argtypes = [c_void_p]
|
||||
+free.restype = None
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user