diff options
author | kali <kali@leap.se> | 2013-01-16 23:33:46 +0900 |
---|---|---|
committer | kali <kali@leap.se> | 2013-01-17 00:15:06 +0900 |
commit | 68af5b2f807ac8acd9525d46d37cfd2a28a06b47 (patch) | |
tree | eb691f1b7f08eca6c21ec2b87a35f8c4bc51989a /src/leap/crypto | |
parent | d72b5d9057bcea884c2e828f5e3045920d4c2205 (diff) |
fix ctypes dependency discovery for libgnutls
Diffstat (limited to 'src/leap/crypto')
-rw-r--r-- | src/leap/crypto/__init__.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/leap/crypto/__init__.py b/src/leap/crypto/__init__.py index e69de29b..8df3fc6c 100644 --- a/src/leap/crypto/__init__.py +++ b/src/leap/crypto/__init__.py @@ -0,0 +1,26 @@ +""" +DEBUG! ----------- gnutls lib: libgnutls.26.dylib +DEBUG! ----------- gnutls lib: /usr/local/lib/libgnutls.26.dylib +DEBUG! ----------- gnutls lib: /opt/local/lib/libgnutls.26.dylib +DEBUG! ----------- gnutls lib: libgnutls-extra.26.dylib +DEBUG! ----------- gnutls lib: /usr/local/lib/libgnutls-extra.26.dylib +DEBUG! ----------- gnutls lib: /opt/local/lib/libgnutls-extra.26.dylib +""" +import sys + +# hackaround pyinstaller ctypes dependencies discovery +# See: +# http://www.pyinstaller.org/wiki/Features/CtypesDependencySupport#SolutioninPyInstaller +# gnutls.library.load_library is using a style of dep loading +# unsupported by pyinstaller. So we force these imports here. + +if sys.platform == "darwin": + from ctypes import CDLL + try: + CDLL("libgnutls.26.dylib") + except OSError: + pass + try: + CDLL("libgnutls-extra.26.dylib") + except OSError: + pass |