From 7a9ca704478a2f11479ea95fe5e4343ee7eff423 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 9 Jul 2013 08:41:55 +0200 Subject: [PATCH] Re: [RFC PATCH] Python bindings: CDLL("libnotmuch.3.dylib") on Darwin --- 5d/0b7d99b4885a46d21b163b9bd1bbf6640e291d | 133 ++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 5d/0b7d99b4885a46d21b163b9bd1bbf6640e291d diff --git a/5d/0b7d99b4885a46d21b163b9bd1bbf6640e291d b/5d/0b7d99b4885a46d21b163b9bd1bbf6640e291d new file mode 100644 index 000000000..095b7ac86 --- /dev/null +++ b/5d/0b7d99b4885a46d21b163b9bd1bbf6640e291d @@ -0,0 +1,133 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 18411431FAF + for ; Mon, 8 Jul 2013 23:42:13 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.001 +X-Spam-Level: +X-Spam-Status: No, score=0.001 tagged_above=-999 required=5 + tests=[UNPARSEABLE_RELAY=0.001] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id tTAnCYOK8dDK for ; + Mon, 8 Jul 2013 23:42:04 -0700 (PDT) +Received: from mail.cryptobitch.de (cryptobitch.de [88.198.7.68]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id ABC77431FAE + for ; Mon, 8 Jul 2013 23:42:04 -0700 (PDT) +Received: from mail.jade-hamburg.de (mail.jade-hamburg.de [85.183.11.228]) + (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) + (No client certificate requested) + by mail.cryptobitch.de (Postfix) with ESMTPSA id A9B1261B068 + for ; Tue, 9 Jul 2013 08:42:02 +0200 (CEST) +Received: by mail.jade-hamburg.de (Postfix, from userid 401) + id 0F27FDF2A4; Tue, 9 Jul 2013 08:42:01 +0200 (CEST) +Received: from thinkbox.jade-hamburg.de (unknown + [IPv6:fe80::216:d3ff:fe3e:5058%br0]) + (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) + (No client certificate requested) (Authenticated sender: teythoon) + by mail.jade-hamburg.de (Postfix) with ESMTPSA id 52A40DF29F; + Tue, 9 Jul 2013 08:41:56 +0200 (CEST) +Received: from teythoon by thinkbox.jade-hamburg.de with local (Exim 4.80) + (envelope-from ) + id 1UwRcZ-0007Ky-LG; Tue, 09 Jul 2013 08:41:55 +0200 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: quoted-printable +To: Tomi Ollila , +From: Justus Winter <4winter@informatik.uni-hamburg.de> +In-Reply-To: +References: <1372171016-11935-1-git-send-email-tomi.ollila@iki.fi> + <20130625152159.17799.36764@thinkbox.jade-hamburg.de> + +Message-ID: <20130709064155.26399.23139@thinkbox.jade-hamburg.de> +User-Agent: alot/0.3.4 +Subject: Re: [RFC PATCH] Python bindings: CDLL("libnotmuch.3.dylib") on Darwin +Date: Tue, 09 Jul 2013 08:41:55 +0200 +Cc: , notmuch mailing list +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 09 Jul 2013 06:42:13 -0000 + +Quoting Tomi Ollila (2013-07-06 14:25:12) +> On Tue, Jun 25 2013, Justus Winter <4winter@informatik.uni-hamburg.de> wr= +ote: +> = + +> > Quoting Tomi Ollila (2013-06-25 16:36:56) +> >> Use os.uname() to check for 'Darwin' and load "libnotmuch.3.dylib" +> >> instead of "libnotmuch.so.3" if that is the case. +> >> --- +> >> = + +> >> This is followup to thread starting from +> >> = + +> >> id:1369540418-94177-1-git-send-email-Julian@GrayVines.com +> >> = + +> >> For anyone interested: this is basically no-overhead addition as ctypes +> >> already loads os module (is "available" as ctypes._os) -- Comparison u= +sing +> >> strace(1) showed that uname system call is used in addition to other p= +rocessing. +> >> = + +> >> This patch is modeled after _lb_'s comments on IRC: +> >> = + +> >> < _lb_> nmlib =3D CDLL("libnotmuch.so.3") needs to be replaced with +> >> nmlib =3D CDLL("libnotmuch.3.dylib") in OSX +> >> < _lb_> Works like a charm! Mmm... I'll have to subscribe to the list +> >> to send the patch... +> >> < _lb_> I guess the quid of the question is to have an os detection +> >> if so it loads the right lib? +> >> = + +> >> ... a few days ago, but the patch didn't arrive yet ;D +> >> = + +> >> I tested that this still works on Linux, but did not test on Mac OS X; +> >> also I did not think much how to handle the importing and the if test. +> >> = + +> >> Anyone using Mac care to take over -- you are probably more interested +> >> of getting this thing to work :D +> > +> > Looks good, though I'd prefer not to do the from..import +> > thing. os.uname is just as short and more concise, you can see where +> > the uname function comes from. +> > +> > If anyone on OSX confirms that this works I'll merge the patch. +> = + +> if you push id:1372171016-11935-1-git-send-email-tomi.ollila@iki.fi +> = + +> based on id:1372772667-sup-392@indy.local +> = + +> I'll make a NEWS entry and ask whether David includes this to 0.16 +> ( id:87ip0rj7vn.fsf@zancas.localnet ) +> = + +> (In a separate mail Steven Schmeiser told (when I asked) that he applied +> the patch verbatim on OS X 10.8) + +Done, and many thanks for keeping an eye on this. + +Justus -- 2.26.2