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

Diff of /eclass/wxwidgets.eclass

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

Revision 1.25 Revision 1.26
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.25 2007/12/25 14:46:29 leio Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.26 2008/11/26 06:49:34 dirtyepic Exp $
4 4
5# @ECLASS: wxwidgets.eclass 5# @ECLASS: wxwidgets.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# wxwindows@gentoo.org 7# wxwindows@gentoo.org
8# @BLURB: Manages build configuration for wxGTK-using packages. 8# @BLURB: Manages build configuration for wxGTK-using packages.
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The wxGTK libraries come in several different possible configurations 10# The wxGTK libraries come in several different possible configurations
11# (release/debug, ansi/unicode, etc.) some of which can be installed 11# (release, debug, ansi, unicode, etc.) most of which can be installed
12# side-by-side. The purpose of this eclass is to provide ebuilds the ability 12# side-by-side. The purpose of this eclass is to provide ebuilds the ability
13# to build against a specific type without interfering with the user-set 13# to build against a specific type of profile without interfering with the
14# system configuration. 14# user-set system configuration.
15# 15#
16# Ebuilds that use wxGTK must inherit this eclass. Otherwise the system 16# Ebuilds that use wxGTK _must_ inherit this eclass. Otherwise the system
17# default will be used, which would be anything the user set it to through 17# profile will be used, meaning whatever the user happened to set it to
18# eselect-wxwidgets. 18# through eselect-wxwidgets.
19# 19#
20# Ebuilds are also required to set the 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. You can either set this before the 21# the wxGTK SLOT the ebuild requires.
22# inherit line to get the default type for that SLOT, or later before calling
23# the need-wxwidgets function.
24# 22#
25# Simple Usage: 23# Simple Usage:
26# 24#
27# @CODE 25# @CODE
28# WX_GTK_VER="2.6" 26# WX_GTK_VER="2.8"
29# 27#
30# inherit wxwidgets 28# inherit wxwidgets
31# 29#
32# DEPEND="=x11-libs/wxGTK-2.6*" (or x11-libs/wxGTK:2.6 for EAPI 1) 30# DEPEND="=x11-libs/wxGTK-2.8*" (or x11-libs/wxGTK:2.8 for >=EAPI 1)
33# RDEPEND="${DEPEND}" 31# RDEPEND="${DEPEND}"
34# [...] 32# [...]
35# @CODE 33# @CODE
36# 34#
37# The eclass will select the default configuration, which is "ansi" in 2.6 35# In this case the eclass will use the default configuration, which is the GTK
38# and "unicode" in >=2.8. These are the defaults because they're always 36# libraries and either the "ansi" (in 2.6) or "unicode" (>=2.8) charsets.
39# guaranteed to exist.
40# 37#
41# If you need more control over which version you need to use, see the 38# If you need more control over which profile(s) you need to use, see the
42# need-wxwidgets function below. 39# need-wxwidgets function below.
43 40
44inherit eutils multilib 41inherit eutils multilib
42
43EXPORT_FUNCTIONS pkg_setup
45 44
46# We do this globally so ebuilds can get sane defaults just by inheriting. They 45# We do this globally so ebuilds can get sane defaults just by inheriting. They
47# can be overridden with need-wxwidgets later if need be. 46# can be overridden with need-wxwidgets later if need be.
48 47
49if [[ -z ${WX_CONFIG} ]]; then 48if [[ -z ${WX_CONFIG} ]]; then
55 fi 54 fi
56 55
57 for wxtoolkit in gtk2 base; do 56 for wxtoolkit in gtk2 base; do
58 for wxdebug in release debug; do 57 for wxdebug in release debug; do
59 wxconf="${wxtoolkit}-${wxchar}-${wxdebug}-${WX_GTK_VER}" 58 wxconf="${wxtoolkit}-${wxchar}-${wxdebug}-${WX_GTK_VER}"
60 [[ -f /usr/$(get_libdir)/wx/config/${wxconf} ]] || continue 59 if [[ -f /usr/$(get_libdir)/wx/config/${wxconf} ]]; then
60 [[ $wxtoolkit == "base" ]] && WXBASE_DIE=1 # see wxwidgets_pkg_setup
61 else
62 continue
63 fi
61 WX_CONFIG="/usr/$(get_libdir)/wx/config/${wxconf}" 64 WX_CONFIG="/usr/$(get_libdir)/wx/config/${wxconf}"
62 # TODO: needed for the wx-config wrapper 65 # TODO: needed for the wx-config wrapper
63 WX_ECLASS_CONFIG="${WX_CONFIG}" 66 WX_ECLASS_CONFIG="${WX_CONFIG}"
64 break 67 break
65 done 68 done
67 done 70 done
68 [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG 71 [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG
69 fi 72 fi
70fi 73fi
71 74
75# @FUNCTION: wxwidgets_pkg_setup
76# @DESCRIPTION:
77#
78# 99.99% of the time, packages building against wxGTK need the GTK libraries.
79# When using the "Simple Usage" case above (WX_GTK_VER before inherit), we have
80# to take into account that the user may have only installed the base libraries
81# (with USE="-X"). Since we can't die in global scope we instead check for
82# the presence of a base profile and then die here if found.
83#
84# If you do need to build against the wxBase libraries, you'll have to use
85# need-wxwidgets to do so.
86#
87# Note that with an EAPI 2 ebuild you can just DEPEND on x11-libs/wxGTK:2.8[X]
88# and ignore all this nonsense.
89
90wxwidgets_pkg_setup() {
91 [[ -n $WXBASE_DIE ]] && check_wxuse X
92}
72 93
73# @FUNCTION: need-wxwidgets 94# @FUNCTION: need-wxwidgets
74# @USAGE: <configuration> 95# @USAGE: <configuration>
75# @DESCRIPTION: 96# @DESCRIPTION:
76# 97#

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26

  ViewVC Help
Powered by ViewVC 1.1.20