Files
MINGW-packages/mingw-w64-capstone/mingw_python.patch
2025-01-25 06:23:01 +00:00

37 lines
1.3 KiB
Diff

--- a/bindings/python/capstone/__init__.py
+++ b/bindings/python/capstone/__init__.py
@@ -364,7 +364,7 @@
if sys.platform == 'darwin':
_lib = "libcapstone.dylib"
elif sys.platform in ('win32', 'cygwin'):
- _lib = "capstone.dll"
+ _lib = "libcapstone.dll"
else:
_lib = "libcapstone.so"
--- a/bindings/python/setup.py
+++ b/bindings/python/setup.py
@@ -63,8 +63,8 @@
VERSIONED_LIBRARY_FILE = "libcapstone.{PKG_MAJOR}.dylib".format(**VERSION_DATA)
LIBRARY_FILE = "libcapstone.dylib"
elif SYSTEM in ('win32', 'cygwin'):
- VERSIONED_LIBRARY_FILE = "capstone.dll"
- LIBRARY_FILE = "capstone.dll"
+ VERSIONED_LIBRARY_FILE = "libcapstone.dll"
+ LIBRARY_FILE = "libcapstone.dll"
else:
VERSIONED_LIBRARY_FILE = "libcapstone.so.{PKG_MAJOR}".format(**VERSION_DATA)
LIBRARY_FILE = "libcapstone.so"
@@ -161,7 +161,10 @@
class custom_build(build):
def run(self):
if 'LIBCAPSTONE_PATH' in os.environ:
- logger.info('Skipping building C extensions since LIBCAPSTONE_PATH is set')
+ logger.info('Copying existing libcapstone to Python lib directory')
+ clean_bins()
+ os.mkdir(LIBS_DIR)
+ shutil.copy(os.environ['LIBCAPSTONE_PATH'], LIBS_DIR)
else:
logger.info('Building C extensions')
build_libraries()