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

Re: Request for help/advice for cross-building src:langdrill



Hi Nilesh,

On Sat, Apr 29, 2023 at 11:09:10PM +0530, Nilesh Patra wrote:
> I have been trying to make langdrill cross-build. I did make
> some changes in makefile to pass in right (cross-)compiler, pkg-config
> et. al.

Thanks for reaching out!

> But in the makefile, there are some flags that are needed by passing a
> `vdk-config-2 --libs` and `vdk-config-2 --cflags`. On looking at the
> code in vdk-config-2, it has a few pkg-config calls which is
> making the cross-build choke (because of native pkg-config being
> called).

I confirm the analysis. Fundamentally, vdk-config-2 is broken when
installed for a foreign architcture and this means that it is
libvdk2-dev that needs to be fixed rather than langdrill.

As for fixing libvdk2-dev, I see two possible options to handle the
situation.

For one thing, libvdk2-dev could simply gain a pkg-config file. Since
there are not that many reverse dependencies of libvdk2-dev (essentially
src:langdrill is the only reverse dependency), it can then be switched
to use the pkg-config file and be happy. vdk-config-2 would continue to
get shipped and it is considered broken for Multi-Arch/cross use. If
vdk-config-2 would also get removed from the binary package, it could
possibly also become M-A:same.

The other option is fixing vdk-config-2 for foreign installations. And
that practically means replacing all uses of pkg-config in the installed
vdk-config-2 with triplet-prefixed instances. This can be done as a
post-processing step in debian/rules and of course, this completely
breaks M-A:same. vdk-config-2 is an architecture-dependent interface
that does not encode the architecture into the invocation, so there is
quite simply no way to fix it for multiarch. Don't try.

Quite obviously, I prefer pkg-config as a long-term solution, but it
requires uploads of two packages and breaks an API contract.

> Since I wasn't sure if there is a proper way to handle this in the
> config file, I copied the file to the debian package, modified it a
> little and hacked around to get proper values during cross (and native)
> builds which is admittedly a bit ugly. It cross-builds fine now but
> I'm not sure if there's a better way, or if my changes can be
> applied to vdk-config (libvdk-dev) or not.

Please don't do that in Debian. Such workarounds may be necessary
locally, but for the Debian archive, let's try fixing the problem at the
root (i.e. libvdk2-dev).

Helmut


Reply to: