Python bindings: CDLL("libnotmuch.3.dylib") on Darwin
authorTomi Ollila <tomi.ollila@iki.fi>
Tue, 25 Jun 2013 14:36:56 +0000 (17:36 +0300)
committerJustus Winter <4winter@informatik.uni-hamburg.de>
Tue, 9 Jul 2013 06:38:42 +0000 (08:38 +0200)
Use os.uname() to check for 'Darwin' and load "libnotmuch.3.dylib"
instead of "libnotmuch.so.3" if that is the case.

bindings/python/notmuch/globals.py

index c7632c3266d428cc42ee43c652701df13c7364dd..2deb87cf02b15d9a2db642dbec8224290f00d548 100644 (file)
@@ -22,7 +22,11 @@ from ctypes import CDLL, Structure, POINTER
 #-----------------------------------------------------------------------------
 #package-global instance of the notmuch library
 try:
-    nmlib = CDLL("libnotmuch.so.3")
+    from os import uname
+    if uname()[0] == 'Darwin':
+        nmlib = CDLL("libnotmuch.3.dylib")
+    else:
+        nmlib = CDLL("libnotmuch.so.3")
 except:
     raise ImportError("Could not find shared 'notmuch' library.")