[debhelper-devel] Bug#833789: debhelper: improve cross build support with the cmake buildsystem: multiarch and pkg-config

Julian Andres Klode jak at debian.org
Mon Aug 8 17:27:52 UTC 2016


On Mon, Aug 08, 2016 at 06:17:57PM +0200, Helmut Grohne wrote:
>  * CMake has logic to place libraries in multiarch paths on Debian
>    systems. That logic is disabled for cross compilation. Thus CMake
>    puts libraries in /usr/lib durin cross compilation, which makes e.g.
>    apt fail to cross build. It's not clear what is the best place to fix
>    this, but debhelper certainly is one where this is possible.
>    Arguably, it's a good place, because CMake has no good way to
>    determine whether the host system will be a Debian system.
> 
> The patch is joint work with Julian.
> 
> Helmut

> --- debhelper-9.20160709/Debian/Debhelper/Buildsystem/cmake.pm
> +++ debhelper-9.20160709+nmu1/Debian/Debhelper/Buildsystem/cmake.pm
> +		push @flags, "-DCMAKE_INSTALL_LIBDIR=lib/" . dpkg_architecture_value("DEB_HOST_MULTIARCH");

I'm wondering if it makes sense to always push the LIBDIR variable. 

Reason: If you pass -DCMAKE_INSTALL_PREFIX=/ because your package is
very important and you want to install to /, it seems (from reading
the code) that CMake will use /lib/, not /lib/<MULTIARCH>. Or to explain
it easier: It only uses multi-arch paths for /usr.

I also wonder what to do about libexec. Apparently, the autotools
buildsystem pm does:
   push @opts, "--libexecdir=\${prefix}/lib/$multiarch";

We should probably do the same. But we should always push a libexecdir,
cmake currently hardcodes "libexec".

-- 
Debian Developer - deb.li/jak | jak-linux.org - free software dev

When replying, only quote what is necessary, and write each reply
directly below the part(s) it pertains to (`inline'). Thank you.



More information about the debhelper-devel mailing list