diff options
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch')
-rw-r--r-- | nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch b/nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch index 4081936abe36..7681fb1d9bb2 100644 --- a/nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch +++ b/nixpkgs/pkgs/development/python-modules/shapely/library-paths.patch @@ -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,123 +61,11 @@ 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 [])) @@ -80,7 +80,11 @@ index d5a67d2..19b7ffc 100644 - ] - _lgeos = load_dll('geos_c', fallbacks=alt_paths) - -- free = load_dll('c').free +- # 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 - free.argtypes = [c_void_p] - free.restype = None - @@ -112,7 +116,7 @@ index d5a67d2..19b7ffc 100644 - except WindowsError: - # XXX: See http://trac.gispython.org/projects/PCL/ticket/149 - pass - +- -elif sys.platform == 'sunos5': - _lgeos = load_dll('geos_c', fallbacks=['libgeos_c.so.1', 'libgeos_c.so']) - free = CDLL('libc.so.1').free @@ -124,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 |