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

Diff of /eclass/wxwidgets.eclass

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

Revision 1.35 Revision 1.36
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2013 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.35 2013/11/16 08:21:23 dirtyepic Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.36 2013/11/16 10:25:39 dirtyepic Exp $
4 4
5# @ECLASS: wxwidgets.eclass 5# @ECLASS: wxwidgets.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# wxwidgets@gentoo.org 7# wxwidgets@gentoo.org
8# @BLURB: Manages build configuration for wxGTK-using packages. 8# @BLURB: Manages build configuration for wxGTK-using packages.
44# wx-config file to use. Most configure scripts use this path if it's set in 44# wx-config file to use. Most configure scripts use this path if it's set in
45# the environment or accept --with-wx-config="${WX_CONFIG}". 45# the environment or accept --with-wx-config="${WX_CONFIG}".
46 46
47inherit eutils multilib 47inherit eutils multilib
48 48
49case "${EAPI:-0}" in
50 0|1)
51 EXPORT_FUNCTIONS pkg_setup
52 ;;
53 *)
54 ;;
55esac
56
57# We do this globally so ebuilds can get sane defaults just by inheriting. They 49# We do this globally so ebuilds can get sane defaults just by inheriting. They
58# can be overridden with need-wxwidgets later if need be. 50# can be overridden with need-wxwidgets later if need be.
59 51
60# ensure this only runs once 52# ensure this only runs once
61if [[ -z ${WX_CONFIG} ]]; then 53if [[ -z ${WX_CONFIG} ]]; then
63 if [[ -n ${WX_GTK_VER} ]]; then 55 if [[ -n ${WX_GTK_VER} ]]; then
64 for wxtoolkit in gtk2 base; do 56 for wxtoolkit in gtk2 base; do
65 # newer versions don't have a seperate debug profile 57 # newer versions don't have a seperate debug profile
66 for wxdebug in xxx release- debug-; do 58 for wxdebug in xxx release- debug-; do
67 wxconf="${wxtoolkit}-unicode-${wxdebug/xxx/}${WX_GTK_VER}" 59 wxconf="${wxtoolkit}-unicode-${wxdebug/xxx/}${WX_GTK_VER}"
60
68 if [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then 61 [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]] || continue
69 # if this is a wxBase install, die in pkg_setup 62
70 [[ ${wxtoolkit} == "base" ]] && WXBASE_DIE=1
71 else
72 continue
73 fi
74 WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}" 63 WX_CONFIG="${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf}"
75 WX_ECLASS_CONFIG="${WX_CONFIG}" 64 WX_ECLASS_CONFIG="${WX_CONFIG}"
76 break 65 break
77 done 66 done
78 [[ -n ${WX_CONFIG} ]] && break 67 [[ -n ${WX_CONFIG} ]] && break
79 done 68 done
80 [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG 69 [[ -n ${WX_CONFIG} ]] && export WX_CONFIG WX_ECLASS_CONFIG
81 fi 70 fi
82fi 71fi
83
84# @FUNCTION: wxwidgets_pkg_setup
85# @DESCRIPTION:
86#
87# It's possible for wxGTK to be installed with USE="-X", resulting in something
88# called wxBase. There's only ever been a couple packages in the tree that use
89# wxBase so this is probably not what you want. Whenever possible, use EAPI 2
90# USE dependencies(tm) to ensure that wxGTK was built with USE="X". This
91# function is only exported for EAPI 0 or 1 and catches any remaining cases.
92#
93# If you do use wxBase, don't set WX_GTK_VER before inherit. Use
94# need-wxwidgets() instead.
95
96wxwidgets_pkg_setup() {
97 [[ -n $WXBASE_DIE ]] && check_wxuse X
98}
99 72
100# @FUNCTION: need-wxwidgets 73# @FUNCTION: need-wxwidgets
101# @USAGE: <configuration> 74# @USAGE: <configuration>
102# @DESCRIPTION: 75# @DESCRIPTION:
103# 76#
199 echo 172 echo
200 einfo "Requested wxWidgets: ${1} ${WX_GTK_VER}" 173 einfo "Requested wxWidgets: ${1} ${WX_GTK_VER}"
201 einfo "Using wxWidgets: ${wxconf}" 174 einfo "Using wxWidgets: ${wxconf}"
202 echo 175 echo
203} 176}
204
205
206# @FUNCTION: check_wxuse
207# @USAGE: <USE flag>
208# @DESCRIPTION:
209#
210# Provides a consistant way to check if wxGTK was built with a particular USE
211# flag enabled. A better way is EAPI 2 USE dependencies (hint hint).
212
213check_wxuse() {
214 debug-print-function $FUNCNAME $*
215
216 if [[ -z ${WX_GTK_VER} ]]; then
217 echo
218 eerror "WX_GTK_VER must be set before calling $FUNCNAME."
219 echo
220 die "WX_GTK_VER missing"
221 fi
222
223 # TODO: Remove built_with_use
224
225 ebegin "Checking wxGTK-${WX_GTK_VER} for ${1} support"
226 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* "${1}"; then
227 eend 0
228 else
229 eend 1
230 echo
231 eerror "${FUNCNAME} - You have requested functionality that requires ${1} support to"
232 eerror "have been built into x11-libs/wxGTK."
233 eerror
234 eerror "Please re-merge =x11-libs/wxGTK-${WX_GTK_VER}* with the ${1} USE flag enabled."
235 die "Missing USE flags."
236 fi
237}

Legend:
Removed from v.1.35  
changed lines
  Added in v.1.36

  ViewVC Help
Powered by ViewVC 1.1.20