[debhelper-devel] Bug#877357: Bug#877357: debhelper: Make qmake buildsystem support cross building

Niels Thykier niels at thykier.net
Sun Oct 1 06:07:00 UTC 2017


Dmitry Shachnev:
> Package: debhelper
> Version: 10.9
> Severity: wishlist
> Tags: patch
> 
> Dear debhelper maintainers,
> 
> I am attaching two patches against Git master that should make packages
> using qmake buildsystem cross-buildable (at least some of them).
> 
> The first patch sets the proper toolchain commands, the second one adds
> a very basic qt.conf so that qmake searches for Qt headers in a proper
> location. It was enough in my case, but we may extend it with other paths
> later if needed.
> 
> --
> Dmitry Shachnev
> 
> [...]

Hi Dmitry,

Thanks for providing this patch set. :)

I am CC'ing Helmut, who is usually on top of cross-building for his input.

I have done a quick review and with my remarks below:

[patch1]
> @@ -52,6 +52,10 @@ sub configure {
>  
>  	push @options, '-makefile';
>  	push @options, '-nocache';
> +	if (is_cross_compiling()) {
> +		# Force generic mkspec to avoid -m32 / -m64 flags
> +		push @options, ("-spec", "linux-g++");
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I believe we rely on cross-builds producing bit-for-bit identical output
with a native build as a part of the QA.  If so, then this need to be
unconditional (possibly in a later compat level).

If the -spec option is used, then I will need something that also works
for other architectures/OSes.  It is fine if it is a stable of known
OSes mapped to their option (like we do for cmake).


[patch2]
> @@ -55,6 +56,14 @@ sub configure {
>  	if (is_cross_compiling()) {
>  		# Force generic mkspec to avoid -m32 / -m64 flags
>  		push @options, ("-spec", "linux-g++");
> +
> +		my ($fh, $filename) = tempfile("qt.XXXX", SUFFIX => ".conf", TMPDIR => 1, UNLINK => 1);
> +		$fh->print("[Paths]\n");
> +		$fh->print("Prefix=/usr\n");
> +		$fh->print("HostData=lib/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "/qt5\n");
> +		$fh->print("Headers=include/" . dpkg_architecture_value("DEB_HOST_GNU_TYPE") . "/qt5\n");

These two lines should almost certainly use DEB_HOST_MULTIARCH.  :)

Thanks,
~Niels




More information about the debhelper-devel mailing list