commit:     77ff3a67bee9dcefd5f0fc9eb074f4e500c8a9ef
Author:     David Michael <fedora.dm0 <AT> gmail <DOT> com>
AuthorDate: Fri Mar 26 20:31:36 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Mar 26 20:31:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=77ff3a67

wxwidgets.eclass: fix cross-compiling

The wx-config file name is prefixed with CHOST when cross-compiling
wxGTK, so test for that path's existence as well.  It also needs to
be used from SYSROOT.

Closes: https://bugs.gentoo.org/774018
Signed-off-by: David Michael <fedora.dm0 <AT> gmail.com>
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 eclass/wxwidgets.eclass | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 9b37074d3b6..f031cdf5443 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # @ECLASS: wxwidgets.eclass
@@ -22,6 +22,7 @@
 # wxGTK was built with.
 
 if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
+_WXWIDGETS_ECLASS=1
 
 inherit flag-o-matic
 
@@ -80,7 +81,7 @@ esac
 # See: http://docs.wxwidgets.org/trunk/overview_debugging.html
 
 setup-wxwidgets() {
-       local wxtoolkit wxdebug wxconf
+       local w wxtoolkit wxdebug wxconf
 
        [[ -z ${WX_GTK_VER} ]] \
                && die "WX_GTK_VER must be set before calling $FUNCNAME."
@@ -116,17 +117,20 @@ setup-wxwidgets() {
        fi
 
        wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}"
+       for w in "${CHOST:-${CBUILD}}-${wxconf}" "${wxconf}"; do
+               if [[ -f 
${ESYSROOT:-${EPREFIX}}/usr/$(get_libdir)/wx/config/${w} ]]; then
+                       wxconf=${w}
+                       break
+               fi
+       done || die "Failed to find configuration ${wxconf}"
 
-       [[ ! -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]] \
-               && die "Failed to find configuration ${wxconf}"
-
-       export WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}"
+       export 
WX_CONFIG="${ESYSROOT:-${EPREFIX}}/usr/$(get_libdir)/wx/config/${wxconf}"
        export WX_ECLASS_CONFIG="${WX_CONFIG}"
 
-       echo
+       einfo
        einfo "Requested wxWidgets:        ${WX_GTK_VER}"
        einfo "Using wxWidgets:            ${wxconf}"
-       echo
+       einfo
 }
 
 case ${EAPI:-0} in
@@ -138,5 +142,4 @@ case ${EAPI:-0} in
                ;;
 esac
 
-_WXWIDGETS_ECLASS=1
 fi

Reply via email to