Files
MINGW-packages/mingw-w64-python-rtree/0001-fix-mingw-finder.patch
مهدي شينون (Mehdi Chinoune) 5697586285 python-rtree: update to 1.0.0
2022-04-06 23:47:30 +05:30

25 lines
714 B
Diff

--- a/rtree/finder.py
+++ b/rtree/finder.py
@@ -8,6 +8,7 @@
import os
import platform
import sys
+import sysconfig
from ctypes.util import find_library
# the current working directory of this file
@@ -29,6 +29,13 @@
:returns: 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"