Gentoo Archives: gentoo-commits

From: Ryan Hill <rhill@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Sat, 24 Oct 2015 05:19:02
Message-Id: 1445663661.277aa8e05065e73499e8e24cfa9f24221348b4b3.rhill@gentoo
1 commit: 277aa8e05065e73499e8e24cfa9f24221348b4b3
2 Author: Ryan Hill <rhill <AT> gentoo <DOT> org>
3 AuthorDate: Fri Oct 23 05:19:44 2015 +0000
4 Commit: Ryan Hill <rhill <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 24 05:14:21 2015 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=277aa8e0
7
8 wxwidgets.eclass: Define -DNDEBUG when building against wxGTK:3.0
9
10 In wxGTK 3.0 debugging support is always enabled in the library and
11 it's up to packages to state if they want to use it or not. When
12 enabled this makes warning dialogs pop up any time an assertion
13 is encountered, which isn't very user friendly. This disables that
14 behavior by adding -DNDEBUG to CPPFLAGS unless the package has a
15 debug USE flag and it is enabled.
16
17 Gentoo-Bug: https://bugs.gentoo.org/562480
18
19 eclass/wxwidgets.eclass | 21 +++++++++++++++++++--
20 1 file changed, 19 insertions(+), 2 deletions(-)
21
22 diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
23 index 07e2d8c..ea7cf9f 100644
24 --- a/eclass/wxwidgets.eclass
25 +++ b/eclass/wxwidgets.eclass
26 @@ -52,8 +52,13 @@
27 #
28 # Note: unless you know your package works with wxbase (which is very
29 # doubtful), always depend on wxGTK[X].
30 +#
31 +# Debugging: In wxGTK 3.0 and later debugging support is enabled in the
32 +# library by default and needs to be controlled at the package level.
33 +# Use the -DNDEBUG preprocessor flag to disable debugging features.
34 +# (Using need-wxwidgets will do this for you, see below.)
35
36 -inherit eutils multilib
37 +inherit eutils flag-o-matic multilib
38
39 # We do this in global scope so ebuilds can get sane defaults just by
40 # inheriting.
41 @@ -80,10 +85,18 @@ fi
42 # @USAGE: <profile>
43 # @DESCRIPTION:
44 #
45 -# Available configurations are:
46 +# Available profiles are:
47 #
48 # unicode (USE="X")
49 # base-unicode (USE="-X")
50 +#
51 +# This lets you choose which config file from /usr/lib/wx/config is used when
52 +# building the package. It also exports ${WX_CONFIG} with the full path to
53 +# that config.
54 +#
55 +# If your ebuild does not have a debug USE flag, or it has one and it is
56 +# disabled, -DNDEBUG will be automatically added to CPPFLAGS. This can be
57 +# overridden by setting WX_DISABLE_DEBUG if you want to handle it yourself.
58
59 need-wxwidgets() {
60 local wxtoolkit wxdebug wxconf
61 @@ -124,6 +137,10 @@ need-wxwidgets() {
62 else
63 wxdebug="release-"
64 fi
65 + else
66 + if [[ -z ${WX_DISABLE_DEBUG} ]]; then
67 + use_if_iuse debug || append-cppflags -DNDEBUG
68 + fi
69 fi
70
71 wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}"