Source: wxwidgets3.2
Version: 3.2.1+dfsg-4
Tags: patch upstream
User: debian-cr...@lists.debian.org
Usertags: ftcbfs

Hi,

wxwidgets3.2 fails to cross build from source, because it is
deliberately broken by upstream on two accounts. I'm unsure how we can
find a cooperative solution to this.

The first aspect is that upstream doesn't trust pkg-config during cross
building. They argue that it'll report wrong things. While that may be
true in some environments, it is the thing that just works for Debian
cross builds. Consequently, configure fails finding GTK and things don't
get much better after that.

The second aspect is that wx changes its toolchain name for cross
compilation. That is, your build deliberately differs when it is
natively built vs being cross built. Of course, this totally breaks
Debian's approach to reproducible builds and also makes dh_install fail
to locate relevant files (due to having been renamed).

This latter aspect probably interacts with #875827. I guess that the
actual issue is that wx assumes that if you want to cross build using
wx, you should have a cross built wx. We don't do this distinction in
Debian at all and believe that packages shouldn't differ between being
cross built or natively built.

So I'm offering a patch that makes wxwidgets3.2 cross build on Debian.
It almost certainly is not upstreamable in the current form as it simply
deletes the "breaking" changes. As much as this fixes Debian builds,
applying it as is, will make other people unhappy and given #875827,
toolchains cross built with this patch will not work for cross
compilation (neither on Debian nor elsewhere).

For the pkg-config, I think the best we can do is to add a configure
switch such as --trust-pkg-config. While the current upstream behaviour
is rather odd, I see how it may be useful rarely, though I'd rather pass
PKG_CONFIG=false then.

For the renaming the toolchain, more discussion is likely needed and the
relevant upstream ticket
https://github.com/wxWidgets/wxWidgets/issues/12698  doesn't seem to be
doing much progress either.

Any chance you could facilitate either discussion?

Helmut
--- wxwidgets3.2-3.2.1+dfsg.orig/configure.in
+++ wxwidgets3.2-3.2.1+dfsg/configure.in
@@ -23,16 +23,8 @@
 AC_CANONICAL_BUILD
 AC_CANONICAL_HOST
 
-dnl notice that if --host was given but --build was not, cross_compiling is
-dnl only set to "maybe" and not "yes" and will be either set to "yes" later or
-dnl configure will exit with error in AC_PROG_CC so don't test for = "yes" here
-if test "$cross_compiling" != "no"; then
-    HOST_PREFIX="${host_alias}-"
-    HOST_SUFFIX="-$host_alias"
-else
-    HOST_PREFIX=
-    HOST_SUFFIX=
-fi
+HOST_PREFIX=
+HOST_SUFFIX=
 
 dnl When making releases do:
 dnl
@@ -2382,23 +2374,6 @@
 dnl Find pkg-config outside of any conditional.  Done before any PKG_* call.
 PKG_PROG_PKG_CONFIG
 
-dnl When cross-compiling, don't use .pc files on the build system, they are at
-dnl best useless and can be harmful (e.g. they may define options inappropriate
-dnl for the cross-build, resulting in the failure of all the subsequent tests).
-if test "$build" != "$host"; then
-    dnl pkg.m4 forbids the use of PKG_XXX, so undo it here to avoid autoconf
-    dnl errors.
-    m4_pattern_allow([PKG_CONFIG_LIBDIR])
-
-    dnl If pkg-config libdir is already defined, we suppose that they know what
-    dnl they're doing and leave it alone, but if not, set it to a path in which
-    dnl no .pc files will be found.
-    if test -z "$PKG_CONFIG_LIBDIR"; then
-        PKG_CONFIG_LIBDIR=/dev/null
-        export PKG_CONFIG_LIBDIR
-    fi
-fi
-
 dnl ---------------------------------------------------------------------------
 dnl Optional libraries
 dnl
--- wxwidgets3.2-3.2.1+dfsg.orig/configure
+++ wxwidgets3.2-3.2.1+dfsg/configure
@@ -3845,16 +3845,8 @@
 IFS=$ac_save_IFS
 case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
-
-
-if test "$cross_compiling" != "no"; then
-    HOST_PREFIX="${host_alias}-"
-    HOST_SUFFIX="-$host_alias"
-else
-    HOST_PREFIX=
-    HOST_SUFFIX=
-fi
-
+HOST_PREFIX=
+HOST_SUFFIX=
 
 wx_major_version_number=3
 wx_minor_version_number=2
@@ -25836,16 +25828,6 @@
 
 fi
 
-if test "$build" != "$host"; then
-
-
-                if test -z "$PKG_CONFIG_LIBDIR"; then
-        PKG_CONFIG_LIBDIR=/dev/null
-        export PKG_CONFIG_LIBDIR
-    fi
-fi
-
-
 
 if test "$wxUSE_REGEX" != "no"; then
     $as_echo "#define wxUSE_REGEX 1" >>confdefs.h

Reply via email to