Files
MINGW-packages/mingw-w64-python-rtree/0001-fix-mingw-finder.patch
Christoph Reiter f420d63435 Add python-rtree
2021-11-20 14:06:17 +01:00

25 lines
807 B
Diff

--- rtree-0.9.7/rtree/finder.py.orig 2021-11-20 12:23:16.300000000 +0100
+++ rtree-0.9.7/rtree/finder.py 2021-11-20 12:23:42.113496900 +0100
@@ -8,6 +8,7 @@
import sys
import ctypes
import platform
+import sysconfig
from ctypes.util import find_library
# the current working directory of this file
@@ -33,6 +34,13 @@
Loaded shared library
"""
if os.name == 'nt':
+ if sysconfig.get_platform().startswith("mingw"):
+ lib_name = 'libspatialindex_c'
+ path = find_library(lib_name)
+ if path is None:
+ raise OSError("could not find or load {}".format(lib_name))
+ return ctypes.cdll.LoadLibrary(path)
+
# check the platform architecture
if '64' in platform.architecture()[0]:
arch = '64'