Skip to content

Commit

Permalink
Merge pull request #373 from climbfuji/feature/bugfix_in_shapely_180_…
Browse files Browse the repository at this point in the history
…geos_patch

Fix bug for Linux in var/spack/repos/builtin/packages/py-shapely/shapely-1.8.0-geos.py.patch
  • Loading branch information
climbfuji authored Dec 1, 2023
2 parents 42fbcfb + 1c1f00b commit 1c9041b
Showing 1 changed file with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
--- a/shapely/geos.py 2022-08-24 13:21:33.000000000 -0600
+++ b/shapely/geos.py 2022-08-24 13:23:54.000000000 -0600
@@ -88,14 +88,21 @@
--- a/shapely/geos.py 2023-11-29 20:34:39.000000000 -0700
+++ b/shapely/geos.py 2023-11-29 20:35:39.000000000 -0700
@@ -88,14 +88,26 @@
if len(geos_pyinstaller_so) >= 1:
_lgeos = CDLL(geos_pyinstaller_so[0])
LOG.debug("Found GEOS DLL: %r, using it.", _lgeos)
Expand All @@ -20,7 +20,12 @@
- ]
+ # Use geos installation if spack geos module is loaded
+ if 'geos_ROOT' in os.environ:
+ alt_paths = [os.path.join(os.environ['geos_ROOT'], 'lib', 'libgeos_c.dylib')]
+ alt_paths = [
+ os.path.join(os.environ['geos_ROOT'], 'lib', 'libgeos_c.so'),
+ os.path.join(os.environ['geos_ROOT'], 'lib64', 'libgeos_c.so'),
+ os.path.join(os.environ['geos_ROOT'], 'lib', 'libgeos_c.so.1'),
+ os.path.join(os.environ['geos_ROOT'], 'lib64', 'libgeos_c.so.1'),
+ ]
+ else:
+ alt_paths = [
+ 'libgeos_c.so.1',
Expand All @@ -29,7 +34,7 @@
_lgeos = load_dll('geos_c', fallbacks=alt_paths)

# ctypes.CDLL(None) internally calls dlopen(NULL), and as the dlopen
@@ -119,10 +126,12 @@
@@ -119,10 +131,12 @@
else:
_lgeos = CDLL(geos_whl_dylib)
LOG.debug("Found GEOS DLL: %r, using it.", _lgeos)
Expand All @@ -46,7 +51,7 @@
else:
if hasattr(sys, 'frozen'):
try:
@@ -139,6 +148,9 @@
@@ -139,6 +153,9 @@
if hasattr(sys, '_MEIPASS'):
alt_paths.append(
os.path.join(sys._MEIPASS, 'libgeos_c.1.dylib'))
Expand Down

0 comments on commit 1c9041b

Please sign in to comment.