#1023744 meson: debcrossgen: should include cmake

Package:
meson
Source:
meson
Submitter:
Helmut Grohne
Date:
2024-10-22 19:06:03 UTC
Severity:
normal
Tags:
#1023744#5
Date:
2022-11-09 09:03:34 UTC
From:
To:
zim-tools fails to cross build from source, because it cannot resolve
its dependency on docopt. It's a plain dependency without setting a
method. In this case, meson is supposed to try pkg-config and cmake. It
does try pkg-config. docopt doesn't ship a .pc file, but it does ship
.cmake files. meson refuses to consider the native installed cmake,
which feels roughly correct as it wouldn't otherwise know the right
paths without a suitable toolchain file.

IRC user nirbheek pointed out that we can set these things in a meson
crossfile and how. The task for generating this file (at this time)
still falls to debcrossgen even though I know you want to move it to
env2mfile. For that reason I'm sending a patch to debcrossgen and hope
that you can port it to env2mfile as needed.

The attached patch makes zim-tools cross buildable.

Helmut

#1023744#12
Date:
2024-10-22 13:41:45 UTC
From:
To:
As of 1.6.0, `meson env2mfile --debarch i386 --cross -o cross.txt` outputs
a cross-file that includes cmake = ['/usr/bin/cmake'].

Similarly,
`MESON_USE_NEW_CROSSGEN=1 /usr/share/meson/debcrossgen --arch i386 -o cross.txt`
outputs a suitable cross-file.

This is *not* fixed for the default code path, used when the environment
variable MESON_USE_NEW_CROSSGEN is unset.

So to solve this, either the debcrossgen in Meson's Debian packaging
needs to use what is currently the MESON_USE_NEW_CROSSGEN=1 code path
by default (possibly with an opt-out to go back to the old behaviour if
we are concerned about regressions), or consumers of information from
debcrossgen (which I believe means debhelper and debputy but nothing else)
need to be updated to invoke `meson env2mfile` instead.

    smcv

#1023744#17
Date:
2024-10-22 15:27:54 UTC
From:
To:
Hi Simon,

A change to debhelper to make it use env2mfile is prepared at
https://salsa.debian.org/debian/debhelper/-/merge_requests/127. We are
waiting for green light from Jussi before merging.

Helmut