[PATCH] Fix shared library loading in Python bindings.
authorJulian Berman <Julian@GrayVines.com>
Sun, 26 May 2013 03:53:38 +0000 (23:53 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:55:00 +0000 (09:55 -0800)
eb/b08979e41db1cc53420d71c2edd0d87cb840d4 [new file with mode: 0644]

diff --git a/eb/b08979e41db1cc53420d71c2edd0d87cb840d4 b/eb/b08979e41db1cc53420d71c2edd0d87cb840d4
new file mode 100644 (file)
index 0000000..920f82b
--- /dev/null
@@ -0,0 +1,73 @@
+Return-Path: <Julian@air.localhost>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 16372431FB6\r
+       for <notmuch@notmuchmail.org>; Tue, 28 May 2013 13:23:54 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.379\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.379 tagged_above=-999 required=5\r
+       tests=[NO_DNS_FOR_FROM=0.379] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Ku0oAvNs8xuL for <notmuch@notmuchmail.org>;\r
+       Tue, 28 May 2013 13:23:46 -0700 (PDT)\r
+X-Greylist: delayed 4202 seconds by postgrey-1.32 at olra;\r
+       Tue, 28 May 2013 13:23:46 PDT\r
+Received: from Air.local (static-72-80-117-250.nycmny.fios.verizon.net\r
+       [72.80.117.250])\r
+       by olra.theworths.org (Postfix) with ESMTP id 0E98B431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 28 May 2013 13:23:46 -0700 (PDT)\r
+Received: by air.localhost (Postfix, from userid 501)\r
+       id D60E14982E7C; Sat, 25 May 2013 23:53:39 -0400 (EDT)\r
+From: Julian Berman <Julian@GrayVines.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] Fix shared library loading in Python bindings.\r
+Date: Sat, 25 May 2013 23:53:38 -0400\r
+Message-Id: <1369540418-94177-1-git-send-email-Julian@GrayVines.com>\r
+X-Mailer: git-send-email 1.8.3\r
+X-Mailman-Approved-At: Tue, 28 May 2013 22:56:15 -0700\r
+Cc: Julian Berman <Julian@GrayVines.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 28 May 2013 20:23:54 -0000\r
+\r
+Specifically, fixes loading on OS X, where libnotmuch will be\r
+a dylib.:\r
+---\r
+ bindings/python/notmuch/globals.py | 3 ++-\r
+ 1 file changed, 2 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/bindings/python/notmuch/globals.py b/bindings/python/notmuch/globals.py\r
+index c7632c3..5e08e73 100644\r
+--- a/bindings/python/notmuch/globals.py\r
++++ b/bindings/python/notmuch/globals.py\r
+@@ -18,11 +18,12 @@ Copyright 2010 Sebastian Spaeth <Sebastian@SSpaeth.de>\r
+ """\r
\r
+ from ctypes import CDLL, Structure, POINTER\r
++from ctypes.util import find_library\r
\r
+ #-----------------------------------------------------------------------------\r
+ #package-global instance of the notmuch library\r
+ try:\r
+-    nmlib = CDLL("libnotmuch.so.3")\r
++    nmlib = CDLL(find_library("libnotmuch"))\r
+ except:\r
+     raise ImportError("Could not find shared 'notmuch' library.")\r
\r
+-- \r
+1.8.3\r
+\r