summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Hill <dirtyepic@gentoo.org>2007-07-30 01:34:13 +0000
committerRyan Hill <dirtyepic@gentoo.org>2007-07-30 01:34:13 +0000
commitc861af48d4cb89a671562f77715262c63e92460e (patch)
tree38ad9453522a0028af70113effcee8603a4f3524 /eclass/wxwidgets.eclass
parentVersion bump for bug #181324 (diff)
downloadgentoo-2-c861af48d4cb89a671562f77715262c63e92460e.tar.gz
gentoo-2-c861af48d4cb89a671562f77715262c63e92460e.tar.bz2
gentoo-2-c861af48d4cb89a671562f77715262c63e92460e.zip
Add check_wxuse, a small utility fuction to make checking wxGTK USE flags consistent.
Diffstat (limited to 'eclass/wxwidgets.eclass')
-rw-r--r--eclass/wxwidgets.eclass34
1 files changed, 29 insertions, 5 deletions
diff --git a/eclass/wxwidgets.eclass b/eclass/wxwidgets.eclass
index fcd7a408a1c1..97f0fef3900b 100644
--- a/eclass/wxwidgets.eclass
+++ b/eclass/wxwidgets.eclass
@@ -1,8 +1,9 @@
-# Copyright 1999-2005 Gentoo Foundation
+# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.18 2007/01/02 08:10:31 dirtyepic Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.19 2007/07/30 01:34:13 dirtyepic Exp $
#
-# Author Rob Cakebread <pythonhead@gentoo.org>
+# Original Author: Rob Cakebread <pythonhead@gentoo.org>
+# Current Maintainers: wxWidgets team <wxwidgets@gentoo.org>
# This eclass helps you find the correct wx-config script so ebuilds
# can use gtk, gtk2 or gtk2+unicode versions of wxGTK
@@ -13,11 +14,15 @@
# 2.4: gtk gtk2 unicode !!! 2.4 is being removed from the tree !!!
# 2.6: gtk2 unicode base base-unicode mac mac-unicode
#
-#
# set-wxconfig
# Arguments: (wxGTK 2.4) wxgtk, wxgtk2, or wxgtk2u
# Arguments: (wxGTK 2.6) gtk-ansi gtk2-ansi unicode base-ansi base-unicode mac-ansi mac-unicode
# Note: Don't call this function directly from ebuilds
+#
+# check_wxuse
+# Check if wxGTK was built with the specified USE flag.
+# Usage: check_wxuse <USE flag>
+# Note: for now, requires WX_GTK_VER to be set.
inherit multilib flag-o-matic
@@ -51,7 +56,6 @@ need-wxwidgets() {
fi
}
-
set-wxconfig() {
debug-print-function $FUNCNAME $*
@@ -106,3 +110,23 @@ set-wxconfig() {
fi
}
+check_wxuse() {
+ if [[ -z ${WX_GTK_VER} ]]; then
+ echo
+ eerror "You need to set WX_GTK_VER before calling ${FUNCNAME}."
+ die "Missing WX_GTK_VER."
+ fi
+
+ ebegin "Checking wxGTK-${WX_GTK_VER} for ${1} support"
+ if $(built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* ${1}); then
+ eend 0
+ else
+ eend 1
+ echo
+ eerror "${FUNCNAME} - You have requested functionality that requires ${1} support to"
+ eerror "have been built into x11-libs/wxGTK."
+ eerror
+ eerror "Please re-merge =x11-libs/wxGTK-${WX_GTK_VER}* with the ${1} USE flag enabled."
+ die "Missing USE flags."
+ fi
+}