[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Problems converting a library to Multi-Arch



Hi Adrian,

On Mon, Feb 20, 2012 at 09:28:48PM +0100, John Paul Adrian Glaubitz wrote:
> I am the maintainer of the packages z80ex and kcemu in Debian.

> I have been working on converting the package z80ex (a library) to
> Multi-Arch.  I have so far followed the guide in [1] to make the package
> ready for Multi-Arch and I have succeeded in creating a Multi-Arch
> version.  When I install the package, all the shared library files now go
> into /usr/lib/${DEB_HOST_MULTIARCH}.

> Now, I have checked whether the -dev version of z80ex still works and
> turns out, it doesn't.  When trying to build kcemu, which depends on
> z80ex, the configure script of kcemu doesn't find the library anymore:

> checking for z80ex_create in -lz80ex... no
> configure: error: 
> ***
> *** Can not find required library z80ex.
> ***

> I'm a bit unsure how to tackle this problem, but I assume I need another -L
> or similar to have configure also look into  /usr/lib/${DEB_HOST_MULTIARCH}
> instead of just /usr/lib.

No, you should not need to pass any -L options, provided you're using a
multiarch-aware Debian toolchain.

The problem here is that you're using dh_install to move the runtime
libraries from /usr/lib (where the upstream rules install them) to the
multiarch directory, but you aren't updating the contents of libz80ex-dev at
all for multiarch.  This means that libz80ex-dev is shipping
/usr/lib/libz80ex.so as a dangling symlink, since the contents of libz80ex1
have been moved out from under it.

The ideal way to fix this is by telling the upstream build system to install
directly to /usr/lib/${DEB_HOST_MULTIARCH} as the library path.  This would
make your preprocessing of debian/libz80ex1.install unnecessary, since you
could then use globs for both libz80ex1.install and libz80ex-dev.install. 
However, you've probably noticed that the wiki page you've referenced,
<http://wiki.debian.org/Multiarch/Implementation>, doesn't provide any
guidance on how to do this for cmake.  If there is a standard way to set
target library directories with cmake, I don't know what it is.  Perhaps you
or someone else on the list who's familiar with cmake can work that out and
provide recommendations on the wiki page.

Barring a general cmake solution, you at least need to make sure the -dev
symlinks point to the multiarch runtime directory; and you might as well
install the -dev files in /usr/lib/${DEB_HOST_MULTIARCH} instead of /usr/lib
as well, since a) the toolchain knows to look for them there, b) this moves
the -dev package itself farther along towards being Multi-Arch: same, c)
it's more maintainable to move the .so symlink in the .install file than it
is to update the target of the symlink.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slangasek@ubuntu.com                                     vorlon@debian.org


Reply to: