/[gentoo-x86]/eclass/wxwidgets.eclass
Gentoo

Diff of /eclass/wxwidgets.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.23 Revision 1.24
1# Copyright 1999-2007 Gentoo Foundation 1# Copyright 1999-2007 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.23 2007/11/25 14:19:39 swegener Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.24 2007/12/21 04:32:41 dirtyepic Exp $
4 4
5# @ECLASS: wxwidgets.eclass 5# @ECLASS: wxwidgets.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# dirtyepic@gentoo.org
8# wxwindows@gentoo.org 7# wxwindows@gentoo.org
9# @BLURB: Manages build configuration for wxGTK-using packages. 8# @BLURB: Manages build configuration for wxGTK-using packages.
10# @DESCRIPTION: 9# @DESCRIPTION:
11# The wxGTK libraries come in several different possible configurations 10# The wxGTK libraries come in several different possible configurations
12# (release/debug, ansi/unicode, etc.), most of which can be installed 11# (release/debug, ansi/unicode, etc.) some of which can be installed
13# side-by-side. The purpose of this eclass is to give ebuilds the ability to 12# side-by-side. The purpose of this eclass is to provide ebuilds the ability
14# specify what particular flavour they require to build against without 13# to build against a specific type without interfering with the user-set
15# interfering with the user-set system configuration. 14# system configuration.
16# 15#
17# Ebuilds that use wxGTK must inherit this eclass. Otherwise the system 16# Ebuilds that use wxGTK must inherit this eclass. Otherwise the system
18# default will be used, which would be anything the user set it to. 17# default will be used, which would be anything the user set it to through
18# eselect-wxwidgets.
19# 19#
20# Ebuilds are also required to set the global variable WX_GTK_VER, containing 20# Ebuilds are also required to set the variable WX_GTK_VER, containing
21# the wxGTK SLOT the ebuild requires. Note that in order for this to work, 21# the wxGTK SLOT the ebuild requires. You can either set this before the
22# WX_GTK_VER needs to be set before inheriting the eclass. 22# inherit line to get the default type for that SLOT, or later before calling
23# the need-wxwidgets function.
23# 24#
24# Simple Usage: 25# Simple Usage:
25# 26#
27# @CODE
26# WX_GTK_VER="2.6" 28# WX_GTK_VER="2.6"
29#
27# inherit wxwidgets 30# inherit wxwidgets
28# DEPEND="=x11-libs/wxGTK-2.6*"
29# RDEPEND="=x11-libs/wxGTK-2.6*"
30# 31#
31# That's it. The eclass will select a sane default configuration to use. In 32# DEPEND="=x11-libs/wxGTK-2.6*" (or x11-libs/wxGTK:2.6 for EAPI 1)
32# wxGTK-2.6 the default is ansi. In wxGTK-2.8 and later it's unicode. These 33# RDEPEND="${DEPEND}"
33# are the defaults because they are always guaranteed to exist. 34# [...]
35# @CODE
34# 36#
35# You'll often find yourself in need of a bit more control. For that see the 37# The eclass will select the default configuration, which is "ansi" in 2.6
38# and "unicode" in >=2.8. These are the defaults because they're always
39# guaranteed to exist.
40#
41# If you need more control over which version you need to use, see the
36# need-wxwidgets function below. 42# need-wxwidgets function below.
37 43
38inherit eutils multilib 44inherit eutils multilib
39 45
40# We do this globally so ebuilds can get sane defaults just by inheriting. They 46# We do this globally so ebuilds can get sane defaults just by inheriting. They
65 71
66 72
67# @FUNCTION: need-wxwidgets 73# @FUNCTION: need-wxwidgets
68# @USAGE: <configuration> 74# @USAGE: <configuration>
69# @DESCRIPTION: 75# @DESCRIPTION:
76#
70# need-wxwidgets is called with one argument, the wxGTK configuration to use. 77# need-wxwidgets is called with one argument, the wxGTK configuration to use.
71# 78#
72# Available configurations are: 79# Available configurations are:
73# 80#
74# ansi 81# ansi
75# unicode 82# unicode
76# base-ansi 83# base-ansi
77# base-unicode 84# base-unicode
78# 85#
79# Note that in >=wxGTK-2.8, only the unicode versions are available. The 86# Note that in >=wxGTK-2.8, only the unicode versions are available. The
80# eclass will automatically map ansi to unicode if WX_GTK_VER is set to 2.8 or 87# eclass will automatically map ansi to unicode for you if WX_GTK_VER is
81# later. 88# set to 2.8 or later.
82# 89#
83# There is one deprecated configuration, gtk2, that is equivalent to ansi. 90# There is one deprecated configuration, "gtk2", which is equivalent to ansi.
84# It is around for historical reasons and shouldn't be used by new ebuilds. 91# This is leftover from 2.4 when we had gtk1 and gtk2 builds and shouldn't
92# be used by new ebuilds.
85# 93#
86# This function will set the variable WX_CONFIG to the path of the wx-config 94# This function will export the variable WX_CONFIG, containing the absolute
87# script to use. In most cases you shouldn't have to use it since the 95# path to the wx-config script to use. In most cases you shouldn't need to
88# /usr/bin/wx-config wrapper points to ${WX_CONFIG} when called from portage. 96# use it since the /usr/bin/wx-config wrapper will already point to that
97# location when called from the eclass, but it's here if you do.
89 98
90need-wxwidgets() { 99need-wxwidgets() {
91 debug-print-function $FUNCNAME $* 100 debug-print-function $FUNCNAME $*
92 101
93 local wxtoolkit wxchar wxdebug wxconf 102 local wxtoolkit wxchar wxdebug wxconf
159 debug-print "wxchar is ${wxchar}" 168 debug-print "wxchar is ${wxchar}"
160 169
161 # since we're no longer in global scope we call built_with_use instead of 170 # since we're no longer in global scope we call built_with_use instead of
162 # all the crazy looping 171 # all the crazy looping
163 172
164 # base can be provided by both gtk2 and base installations 173 # wxBase can be provided by both gtk2 and base installations
165 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* X; then 174 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* X; then
166 wxtoolkit="gtk2" 175 wxtoolkit="gtk2"
167 else 176 else
168 wxtoolkit="base" 177 wxtoolkit="base"
169 fi 178 fi
192 die "Missing wx-config" 201 die "Missing wx-config"
193 fi 202 fi
194 203
195 debug-print "Found config ${wxconf} - setting WX_CONFIG" 204 debug-print "Found config ${wxconf} - setting WX_CONFIG"
196 205
197 # This is exported as some configure scripts will check for its presence in
198 # the environment.
199 export WX_CONFIG="/usr/$(get_libdir)/wx/config/${wxconf}" 206 export WX_CONFIG="/usr/$(get_libdir)/wx/config/${wxconf}"
200 207
201 debug-print "WX_CONFIG is ${WX_CONFIG}" 208 debug-print "WX_CONFIG is ${WX_CONFIG}"
202 209
203 # TODO: Used by the wx-config wrapper
204 export WX_ECLASS_CONFIG="${WX_CONFIG}" 210 export WX_ECLASS_CONFIG="${WX_CONFIG}"
205 211
206 echo 212 echo
207 einfo "Requested wxWidgets: ${1} ${WX_GTK_VER}" 213 einfo "Requested wxWidgets: ${1} ${WX_GTK_VER}"
208 einfo "Using wxWidgets: ${wxconf}" 214 einfo "Using wxWidgets: ${wxconf}"
211 217
212 218
213# @FUNCTION: check_wxuse 219# @FUNCTION: check_wxuse
214# @USAGE: <USE flag> 220# @USAGE: <USE flag>
215# @DESCRIPTION: 221# @DESCRIPTION:
222#
216# Provides a consistant way to check if wxGTK was built with a particular USE 223# Provides a consistant way to check if wxGTK was built with a particular USE
217# flag enabled. 224# flag enabled.
218 225
219check_wxuse() { 226check_wxuse() {
220 debug-print-function $FUNCNAME $* 227 debug-print-function $FUNCNAME $*

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24

  ViewVC Help
Powered by ViewVC 1.1.20