pythonPackages.python_magic: fix build and run tests

This commit is contained in:
Robert Schütz
2021-02-28 11:32:30 +01:00
parent d80850806d
commit 6c3b5c1942
2 changed files with 42 additions and 13 deletions
@@ -0,0 +1,17 @@
diff --git a/magic/loader.py b/magic/loader.py
index 6b2bfcb..69778af 100644
--- a/magic/loader.py
+++ b/magic/loader.py
@@ -5,11 +5,7 @@ import glob
def load_lib():
libmagic = None
# Let's try to find magic or magic1
- dll = ctypes.util.find_library('magic') \
- or ctypes.util.find_library('magic1') \
- or ctypes.util.find_library('cygmagic-1') \
- or ctypes.util.find_library('libmagic-1') \
- or ctypes.util.find_library('msys-magic-1') # for MSYS2
+ dll = '@libmagic@'
# necessary because find_library returns None if it doesn't find the library
if dll: