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@gmail.com>
Signed-off-by: David Seifert <soap@gentoo.org>
This commit is contained in:
David Michael
2021-03-26 21:31:36 +01:00
committed by David Seifert
parent 5e3bef0cc3
commit 77ff3a67be

View File

@@ -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 # Distributed under the terms of the GNU General Public License v2
# @ECLASS: wxwidgets.eclass # @ECLASS: wxwidgets.eclass
@@ -22,6 +22,7 @@
# wxGTK was built with. # wxGTK was built with.
if [[ -z ${_WXWIDGETS_ECLASS} ]]; then if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
_WXWIDGETS_ECLASS=1
inherit flag-o-matic inherit flag-o-matic
@@ -80,7 +81,7 @@ esac
# See: http://docs.wxwidgets.org/trunk/overview_debugging.html # See: http://docs.wxwidgets.org/trunk/overview_debugging.html
setup-wxwidgets() { setup-wxwidgets() {
local wxtoolkit wxdebug wxconf local w wxtoolkit wxdebug wxconf
[[ -z ${WX_GTK_VER} ]] \ [[ -z ${WX_GTK_VER} ]] \
&& die "WX_GTK_VER must be set before calling $FUNCNAME." && die "WX_GTK_VER must be set before calling $FUNCNAME."
@@ -116,17 +117,20 @@ setup-wxwidgets() {
fi fi
wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}" 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} ]] \ export WX_CONFIG="${ESYSROOT:-${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_ECLASS_CONFIG="${WX_CONFIG}" export WX_ECLASS_CONFIG="${WX_CONFIG}"
echo einfo
einfo "Requested wxWidgets: ${WX_GTK_VER}" einfo "Requested wxWidgets: ${WX_GTK_VER}"
einfo "Using wxWidgets: ${wxconf}" einfo "Using wxWidgets: ${wxconf}"
echo einfo
} }
case ${EAPI:-0} in case ${EAPI:-0} in
@@ -138,5 +142,4 @@ case ${EAPI:-0} in
;; ;;
esac esac
_WXWIDGETS_ECLASS=1
fi fi