[RFC PATCH] Python bindings: CDLL("libnotmuch.3.dylib") on Darwin

Justus Winter 4winter at informatik.uni-hamburg.de
Mon Jul 8 23:41:55 PDT 2013


Quoting Tomi Ollila (2013-07-06 14:25:12)
> On Tue, Jun 25 2013, Justus Winter <4winter at informatik.uni-hamburg.de> wrote:
> 
> > 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 at GrayVines.com
> >> 
> >> For anyone interested: this is basically no-overhead addition as ctypes
> >> already loads os module (is "available" as ctypes._os) -- Comparison using
> >> strace(1) showed that uname system call is used in addition to other processing.
> >> 
> >> This patch is modeled after _lb_'s comments on IRC:
> >> 
> >> < _lb_> nmlib = CDLL("libnotmuch.so.3") needs to be replaced with
> >>         nmlib = 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 at iki.fi
> 
> based on id:1372772667-sup-392 at indy.local
> 
> I'll make a NEWS entry and ask whether David includes this to 0.16
> ( id:87ip0rj7vn.fsf at 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


More information about the notmuch mailing list