[Xapian-discuss] bindings - python module

Olly Betts olly at survex.com
Fri Sep 3 18:33:52 BST 2004


On Fri, Sep 03, 2004 at 12:13:16PM +0100, James Aylett wrote:
> On Fri, Sep 03, 2004 at 11:35:01AM +0100, Olly Betts wrote:
> 
> > > > James: We don't want _xapian.a installing there, do we?  I think that's
> > > > just a hangover from when I changed it to use libtool to build the
> > > > shared libraries for the bindings...
> > > 
> > > Don't need _xapian.la either - xapian.py is the Python file that
> > > import xapian will use; it itself imports _xapian as a shared object,
> > > so you need _xapian.so; the others won't be used.
> > 
> > There's an install hook which is meant to remove _xapian.la, but it
> > appears it's not working.  I'll investigate.
> 
> Hmm.

Ah, the library is installed by install-data not install-exec.  If I use
install-data-hook, it fires after the library is installed (as documented)
and I can removed _xapian.la.

I've also set the bindings to default to building shared libraries only
which stop .a libraries being built and installed, and save a bit of
time too.

> > > Incidentally, it might be nice to have an install hook to byte compile
> > > xapian.py, merely because if you're installing as root but
> > > subsequently running as another user it won't be able to save the .pyc
> > > as the user.
> > 
> > OK - do you know the command to do that to save me digging for it?  And
> > can I byte compile in the build directory, then install the .pyc as well
> > as the .py?
> 
> PYTHONPATH=... python -c "import xapian"
> 
> should do the trick. You should be able to compile in the build
> directory, I can't see why it wouldn't work. So PYTHONPATH=. which is
> simpler than substituting the target dir (just).

OK, done.  It needs .libs in PYTHONPATH too, as that's where libtool
hides the .so prior to installation.

Cheers,
    Olly



More information about the Xapian-discuss mailing list