* [gentoo-dev] [PATCH 2/6] wxwidgets.eclass: Make WX_GTK_VER a PRE_INHERIT variable
2021-04-25 13:53 [gentoo-dev] [PATCH 1/6] wxwidgets.eclass: Remove need-wxwidgets alias David Seifert
@ 2021-04-25 13:53 ` David Seifert
2021-04-25 13:53 ` [gentoo-dev] [PATCH 3/6] wxwidgets.eclass: Remove dead SLOTs David Seifert
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Seifert @ 2021-04-25 13:53 UTC (permalink / raw
To: gentoo-dev; +Cc: David Seifert
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/wxwidgets.eclass | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 5d6d175392b..80c0fc5dea3 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -24,6 +24,19 @@
if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
_WXWIDGETS_ECLASS=1
+# @ECLASS-VARIABLE: WX_GTK_VER
+# @PRE_INHERIT
+# @REQUIRED
+# @DESCRIPTION:
+# The SLOT of the x11-libs/wxGTK you're targeting. Needs to be defined before
+# inheriting the eclass. Can be either "3.0" or "3.0-gtk3".
+case ${WX_GTK_VER} in
+ 3.0|3.0-gtk3) ;;
+ "") die "WX_GTK_VER not declared" ;;
+ *) die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT ('3.0' or '3.0-gtk3')" ;;
+esac
+readonly WX_GTK_VER
+
inherit flag-o-matic
case ${EAPI:-0} in
@@ -83,9 +96,6 @@ esac
setup-wxwidgets() {
local w wxtoolkit wxdebug wxconf
- [[ -z ${WX_GTK_VER} ]] \
- && die "WX_GTK_VER must be set before calling $FUNCNAME."
-
case "${WX_GTK_VER}" in
3.0-gtk3)
wxtoolkit=gtk3
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 3/6] wxwidgets.eclass: Remove dead SLOTs
2021-04-25 13:53 [gentoo-dev] [PATCH 1/6] wxwidgets.eclass: Remove need-wxwidgets alias David Seifert
2021-04-25 13:53 ` [gentoo-dev] [PATCH 2/6] wxwidgets.eclass: Make WX_GTK_VER a PRE_INHERIT variable David Seifert
@ 2021-04-25 13:53 ` David Seifert
2021-04-25 13:53 ` [gentoo-dev] [PATCH 4/6] wxwidgets.eclass: Clean up setup-wxwidgets eclassdoc David Seifert
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: David Seifert @ 2021-04-25 13:53 UTC (permalink / raw
To: gentoo-dev; +Cc: David Seifert
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/wxwidgets.eclass | 32 +++++++++-----------------------
1 file changed, 9 insertions(+), 23 deletions(-)
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 80c0fc5dea3..09c45ba48a5 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -94,31 +94,17 @@ esac
# See: http://docs.wxwidgets.org/trunk/overview_debugging.html
setup-wxwidgets() {
- local w wxtoolkit wxdebug wxconf
+ local w wxtoolkit wxconf
- case "${WX_GTK_VER}" in
- 3.0-gtk3)
- wxtoolkit=gtk3
- if [[ -z ${WX_DISABLE_NDEBUG} ]]; then
- ( in_iuse debug && use debug ) || append-cppflags -DNDEBUG
- fi
- ;;
- 2.9|3.0)
- wxtoolkit=gtk2
- if [[ -z ${WX_DISABLE_NDEBUG} ]]; then
- ( in_iuse debug && use debug ) || append-cppflags -DNDEBUG
- fi
- ;;
- 2.8)
- wxtoolkit=gtk2
- wxdebug="release-"
- has_version x11-libs/wxGTK:${WX_GTK_VER}[debug] && wxdebug="debug-"
- ;;
- *)
- die "Invalid WX_GTK_VER: must be set to a valid wxGTK SLOT"
- ;;
+ case ${WX_GTK_VER} in
+ 3.0-gtk3) wxtoolkit=gtk3 ;;
+ 3.0) wxtoolkit=gtk2 ;;
esac
+ if [[ -z ${WX_DISABLE_NDEBUG} ]]; then
+ { in_iuse debug && use debug; } || append-cppflags -DNDEBUG
+ fi
+
# toolkit overrides
if has_version "x11-libs/wxGTK:${WX_GTK_VER}[aqua]"; then
wxtoolkit="mac"
@@ -126,7 +112,7 @@ setup-wxwidgets() {
wxtoolkit="base"
fi
- wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}"
+ wxconf="${wxtoolkit}-unicode-${WX_GTK_VER}"
for w in "${CHOST:-${CBUILD}}-${wxconf}" "${wxconf}"; do
[[ -f ${ESYSROOT:-${EPREFIX}}/usr/$(get_libdir)/wx/config/${w} ]] && wxconf=${w} && break
done || die "Failed to find configuration ${wxconf}"
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 4/6] wxwidgets.eclass: Clean up setup-wxwidgets eclassdoc
2021-04-25 13:53 [gentoo-dev] [PATCH 1/6] wxwidgets.eclass: Remove need-wxwidgets alias David Seifert
2021-04-25 13:53 ` [gentoo-dev] [PATCH 2/6] wxwidgets.eclass: Make WX_GTK_VER a PRE_INHERIT variable David Seifert
2021-04-25 13:53 ` [gentoo-dev] [PATCH 3/6] wxwidgets.eclass: Remove dead SLOTs David Seifert
@ 2021-04-25 13:53 ` David Seifert
2021-04-25 13:54 ` [gentoo-dev] [PATCH 5/6] wxwidgets.eclass: Restrict to EAPI 7 David Seifert
2021-04-25 13:54 ` [gentoo-dev] [PATCH 6/6] wxwidgets.eclass: Add eqawarn for GTK 2 slot David Seifert
4 siblings, 0 replies; 6+ messages in thread
From: David Seifert @ 2021-04-25 13:53 UTC (permalink / raw
To: gentoo-dev; +Cc: David Seifert
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/wxwidgets.eclass | 22 ++++++++++------------
1 file changed, 10 insertions(+), 12 deletions(-)
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 09c45ba48a5..019bc75ee79 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -79,20 +79,18 @@ esac
# @FUNCTION: setup-wxwidgets
# @DESCRIPTION:
-# Call this in your ebuild to set up the environment for wxGTK. Besides
-# controlling the wx-config wrapper this exports WX_CONFIG containing
-# the path to the config in case it needs to be passed to a build system.
+# Call this in your ebuild to set up the environment for wxGTK in src_configure.
+# Besides controlling the wx-config wrapper, this exports WX_CONFIG containing
+# the path to the config in case it needs to be passed to the build system.
#
-# In wxGTK-2.9 and later it also controls the level of debugging output
-# from the libraries. In these versions debugging features are enabled
-# by default and need to be disabled at the package level. Because this
-# causes many warning dialogs to pop up during runtime we add -DNDEBUG to
-# CPPFLAGS to disable debugging features (unless your ebuild has a debug
-# USE flag and it's enabled). If you don't like this behavior you can set
-# WX_DISABLE_NDEBUG to override it.
+# This function also controls the level of debugging output from the libraries.
+# Debugging features are enabled by default and need to be disabled at the
+# package level. Because this causes many warning dialogs to pop up during
+# runtime, we add -DNDEBUG to CPPFLAGS to disable debugging features (unless
+# your ebuild has a debug USE flag and it's enabled). If you don't like this
+# behavior, you can set WX_DISABLE_NDEBUG to override it.
#
-# See: http://docs.wxwidgets.org/trunk/overview_debugging.html
-
+# See: https://docs.wxwidgets.org/trunk/overview_debugging.html
setup-wxwidgets() {
local w wxtoolkit wxconf
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 5/6] wxwidgets.eclass: Restrict to EAPI 7
2021-04-25 13:53 [gentoo-dev] [PATCH 1/6] wxwidgets.eclass: Remove need-wxwidgets alias David Seifert
` (2 preceding siblings ...)
2021-04-25 13:53 ` [gentoo-dev] [PATCH 4/6] wxwidgets.eclass: Clean up setup-wxwidgets eclassdoc David Seifert
@ 2021-04-25 13:54 ` David Seifert
2021-04-25 13:54 ` [gentoo-dev] [PATCH 6/6] wxwidgets.eclass: Add eqawarn for GTK 2 slot David Seifert
4 siblings, 0 replies; 6+ messages in thread
From: David Seifert @ 2021-04-25 13:54 UTC (permalink / raw
To: gentoo-dev; +Cc: David Seifert
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/wxwidgets.eclass | 56 +++++++++--------------------------------
1 file changed, 12 insertions(+), 44 deletions(-)
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 019bc75ee79..5e9d569a16a 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -4,14 +4,14 @@
# @ECLASS: wxwidgets.eclass
# @MAINTAINER:
# wxwidgets@gentoo.org
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 7
# @BLURB: Manages build configuration for wxGTK-using packages.
# @DESCRIPTION:
# This eclass sets up the proper environment for ebuilds using the wxGTK
# libraries. Ebuilds using wxPython do not need to inherit this eclass.
#
# More specifically, this eclass controls the configuration chosen by the
-# /usr/bin/wx-config wrapper.
+# ${ESYSROOT}/usr/bin/wx-config wrapper.
#
# Using the eclass is simple:
#
@@ -21,6 +21,12 @@
# The configuration chosen is based on the version required and the flags
# wxGTK was built with.
+case ${EAPI:-0} in
+ [0-6]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+ 7) ;;
+ *) die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
+esac
+
if [[ -z ${_WXWIDGETS_ECLASS} ]]; then
_WXWIDGETS_ECLASS=1
@@ -39,44 +45,6 @@ readonly WX_GTK_VER
inherit flag-o-matic
-case ${EAPI:-0} in
- 0|1|2|3|4|5)
- inherit eutils multilib
-
- # This was used to set up a sane default for ebuilds so they could
- # avoid calling need-wxwidgets if they didn't need a particular build.
- # This was a bad idea for a couple different reasons, and because
- # get_libdir() is now illegal in global scope in EAPI 6 we can't do it
- # anymore. All ebuilds must now use setup-wxwidgets and this code is
- # only here for backwards compatability.
- if [[ -z ${WX_CONFIG} ]]; then
- if [[ -n ${WX_GTK_VER} ]]; then
- for _wxtoolkit in mac gtk2 base; do
- # newer versions don't have a seperate debug config
- for _wxdebug in xxx release- debug-; do
- _wxconf="${_wxtoolkit}-unicode-${_wxdebug/xxx/}${WX_GTK_VER}"
-
- [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${_wxconf} ]] \
- || continue
-
- WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${_wxconf}"
- WX_ECLASS_CONFIG="${WX_CONFIG}"
- break
- done
- [[ -n ${WX_CONFIG} ]] && break
- done
- [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG
- fi
- fi
- unset _wxtoolkit
- unset _wxdebug
- unset _wxconf
- ;;
- 6) inherit multilib ;; # compatibility only, not needed by eclass
- 7) ;;
- *) die "${ECLASS}: EAPI ${EAPI:-0} is not supported" ;;
-esac
-
# @FUNCTION: setup-wxwidgets
# @DESCRIPTION:
# Call this in your ebuild to set up the environment for wxGTK in src_configure.
@@ -104,18 +72,18 @@ setup-wxwidgets() {
fi
# toolkit overrides
- if has_version "x11-libs/wxGTK:${WX_GTK_VER}[aqua]"; then
+ if has_version -d "x11-libs/wxGTK:${WX_GTK_VER}[aqua]"; then
wxtoolkit="mac"
- elif ! has_version "x11-libs/wxGTK:${WX_GTK_VER}[X]"; then
+ elif ! has_version -d "x11-libs/wxGTK:${WX_GTK_VER}[X]"; then
wxtoolkit="base"
fi
wxconf="${wxtoolkit}-unicode-${WX_GTK_VER}"
for w in "${CHOST:-${CBUILD}}-${wxconf}" "${wxconf}"; do
- [[ -f ${ESYSROOT:-${EPREFIX}}/usr/$(get_libdir)/wx/config/${w} ]] && wxconf=${w} && break
+ [[ -f ${ESYSROOT}/usr/$(get_libdir)/wx/config/${w} ]] && wxconf=${w} && break
done || die "Failed to find configuration ${wxconf}"
- export WX_CONFIG="${ESYSROOT:-${EPREFIX}}/usr/$(get_libdir)/wx/config/${wxconf}"
+ export WX_CONFIG="${ESYSROOT}/usr/$(get_libdir)/wx/config/${wxconf}"
export WX_ECLASS_CONFIG="${WX_CONFIG}"
einfo
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [gentoo-dev] [PATCH 6/6] wxwidgets.eclass: Add eqawarn for GTK 2 slot
2021-04-25 13:53 [gentoo-dev] [PATCH 1/6] wxwidgets.eclass: Remove need-wxwidgets alias David Seifert
` (3 preceding siblings ...)
2021-04-25 13:54 ` [gentoo-dev] [PATCH 5/6] wxwidgets.eclass: Restrict to EAPI 7 David Seifert
@ 2021-04-25 13:54 ` David Seifert
4 siblings, 0 replies; 6+ messages in thread
From: David Seifert @ 2021-04-25 13:54 UTC (permalink / raw
To: gentoo-dev; +Cc: David Seifert
Signed-off-by: David Seifert <soap@gentoo.org>
---
eclass/wxwidgets.eclass | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index 5e9d569a16a..4357e7367cc 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -64,7 +64,9 @@ setup-wxwidgets() {
case ${WX_GTK_VER} in
3.0-gtk3) wxtoolkit=gtk3 ;;
- 3.0) wxtoolkit=gtk2 ;;
+ 3.0) wxtoolkit=gtk2
+ eqawarn "This package relies on the deprecated GTK 2 slot, which will go away soon (https://bugs.gentoo.org/618642)"
+ ;;
esac
if [[ -z ${WX_DISABLE_NDEBUG} ]]; then
--
2.31.1
^ permalink raw reply related [flat|nested] 6+ messages in thread