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

Diff of /eclass/wxwidgets.eclass

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

Revision 1.34 Revision 1.35
1# Copyright 1999-2011 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.34 2013/08/16 07:59:17 heroxbd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/wxwidgets.eclass,v 1.35 2013/11/16 08:21:23 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.
31# RDEPEND="${DEPEND}" 31# RDEPEND="${DEPEND}"
32# [...] 32# [...]
33# @CODE 33# @CODE
34# 34#
35# This will get you the default configuration, which is what you want 99% 35# This will get you the default configuration, which is what you want 99%
36# of the time (in 2.6 the default is "ansi", all other versions default to 36# of the time.
37# "unicode").
38# 37#
39# If your package has optional wxGTK support controlled by a USE flag or you 38# If your package has optional wxGTK support controlled by a USE flag or you
40# need to use the wxBase libraries (USE="-X") then you should not set 39# need to use the wxBase libraries (USE="-X") then you should not set
41# WX_GTK_VER before inherit and instead refer to the need-wxwidgets function 40# WX_GTK_VER before inherit and instead refer to the need-wxwidgets function
42# below. 41# below.
60 59
61# ensure this only runs once 60# ensure this only runs once
62if [[ -z ${WX_CONFIG} ]]; then 61if [[ -z ${WX_CONFIG} ]]; then
63 # and only if WX_GTK_VER is set before inherit 62 # and only if WX_GTK_VER is set before inherit
64 if [[ -n ${WX_GTK_VER} ]]; then 63 if [[ -n ${WX_GTK_VER} ]]; then
65 if [[ ${WX_GTK_VER} == 2.6 ]]; then
66 wxchar="ansi"
67 else
68 wxchar="unicode"
69 fi
70 for wxtoolkit in gtk2 base; do 64 for wxtoolkit in gtk2 base; do
71 # newer versions don't have a seperate debug profile 65 # newer versions don't have a seperate debug profile
72 for wxdebug in xxx release- debug-; do 66 for wxdebug in xxx release- debug-; do
73 wxconf="${wxtoolkit}-${wxchar}-${wxdebug/xxx/}${WX_GTK_VER}" 67 wxconf="${wxtoolkit}-unicode-${wxdebug/xxx/}${WX_GTK_VER}"
74 if [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then 68 if [[ -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then
75 # if this is a wxBase install, die in pkg_setup 69 # if this is a wxBase install, die in pkg_setup
76 [[ ${wxtoolkit} == "base" ]] && WXBASE_DIE=1 70 [[ ${wxtoolkit} == "base" ]] && WXBASE_DIE=1
77 else 71 else
78 continue 72 continue
107# @USAGE: <configuration> 101# @USAGE: <configuration>
108# @DESCRIPTION: 102# @DESCRIPTION:
109# 103#
110# Available configurations are: 104# Available configurations are:
111# 105#
112# [2.6] ansi [>=2.8] unicode 106# unicode (USE="X")
113# unicode base-unicode 107# base-unicode (USE="-X")
114# base
115# base-unicode
116# 108#
117# If your package has optional wxGTK support controlled by a USE flag, set 109# If your package has optional wxGTK support controlled by a USE flag, set
118# WX_GTK_VER inside a conditional rather than before inherit. Some broken 110# WX_GTK_VER inside a conditional rather than before inherit. Some broken
119# configure scripts will force wxGTK on if they find ${WX_CONFIG} set. 111# configure scripts will force wxGTK on if they find ${WX_CONFIG} set.
120# 112#
132# 124#
133 125
134need-wxwidgets() { 126need-wxwidgets() {
135 debug-print-function $FUNCNAME $* 127 debug-print-function $FUNCNAME $*
136 128
137 local wxtoolkit wxchar wxdebug wxconf 129 local wxtoolkit wxdebug wxconf
138 130
139 if [[ -z ${WX_GTK_VER} ]]; then 131 if [[ -z ${WX_GTK_VER} ]]; then
140 echo 132 echo
141 eerror "WX_GTK_VER must be set before calling $FUNCNAME." 133 eerror "WX_GTK_VER must be set before calling $FUNCNAME."
142 echo 134 echo
143 die "WX_GTK_VER missing" 135 die "WX_GTK_VER missing"
144 fi 136 fi
145 137
146 if [[ ${WX_GTK_VER} != 2.6 && ${WX_GTK_VER} != 2.8 && ${WX_GTK_VER} != 2.9 ]]; then 138 if [[ ${WX_GTK_VER} != 2.8 && ${WX_GTK_VER} != 2.9 ]]; then
147 echo 139 echo
148 eerror "Invalid WX_GTK_VER: ${WX_GTK_VER} - must be set to a valid wxGTK SLOT." 140 eerror "Invalid WX_GTK_VER: ${WX_GTK_VER} - must be set to a valid wxGTK SLOT."
149 echo 141 echo
150 die "Invalid WX_GTK_VER" 142 die "Invalid WX_GTK_VER"
151 fi 143 fi
152 144
153 debug-print "WX_GTK_VER is ${WX_GTK_VER}" 145 debug-print "WX_GTK_VER is ${WX_GTK_VER}"
154 146
155 case $1 in 147 case $1 in
156 ansi) 148 unicode|base-unicode) ;;
157 debug-print-section ansi
158 if [[ ${WX_GTK_VER} == 2.6 ]]; then
159 wxchar="ansi"
160 else
161 wxchar="unicode"
162 fi
163 check_wxuse X
164 ;;
165 unicode)
166 debug-print-section unicode
167 check_wxuse X
168 [[ ${WX_GTK_VER} == 2.6 ]] && check_wxuse unicode
169 wxchar="unicode"
170 ;;
171 base)
172 debug-print-section base
173 if [[ ${WX_GTK_VER} == 2.6 ]]; then
174 wxchar="ansi"
175 else
176 wxchar="unicode"
177 fi
178 ;;
179 base-unicode)
180 debug-print-section base-unicode
181 [[ ${WX_GTK_VER} == 2.6 ]] && check_wxuse unicode
182 wxchar="unicode"
183 ;;
184 # backwards compatibility
185 gtk2)
186 debug-print-section gtk2
187 if [[ ${WX_GTK_VER} == 2.6 ]]; then
188 wxchar="ansi"
189 else
190 wxchar="unicode"
191 fi
192 check_wxuse X
193 ;;
194 *) 149 *)
195 echo
196 eerror "Invalid $FUNCNAME argument: $1" 150 eerror "Invalid $FUNCNAME argument: $1"
197 echo 151 echo
198 die "Invalid argument" 152 die
199 ;; 153 ;;
200 esac 154 esac
201
202 debug-print "wxchar is ${wxchar}"
203 155
204 # TODO: remove built_with_use 156 # TODO: remove built_with_use
205 157
206 # wxBase can be provided by both gtk2 and base installations 158 # wxBase can be provided by both gtk2 and base installations
207 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* X; then 159 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* X; then
210 wxtoolkit="base" 162 wxtoolkit="base"
211 fi 163 fi
212 164
213 debug-print "wxtoolkit is ${wxtoolkit}" 165 debug-print "wxtoolkit is ${wxtoolkit}"
214 166
215 # debug or release? 167 # 2.8 has a separate debug tuple
216 if [[ ${WX_GTK_VER} == 2.6 || ${WX_GTK_VER} == 2.8 ]]; then 168 if [[ ${WX_GTK_VER} == 2.8 ]]; then
217 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* debug; then 169 if built_with_use =x11-libs/wxGTK-${WX_GTK_VER}* debug; then
218 wxdebug="debug-" 170 wxdebug="debug-"
219 else 171 else
220 wxdebug="release-" 172 wxdebug="release-"
221 fi 173 fi
222 fi 174 fi
223 175
224 debug-print "wxdebug is ${wxdebug}" 176 debug-print "wxdebug is ${wxdebug}"
225 177
226 # put it all together 178 # put it all together
227 wxconf="${wxtoolkit}-${wxchar}-${wxdebug}${WX_GTK_VER}" 179 wxconf="${wxtoolkit}-unicode-${wxdebug}${WX_GTK_VER}"
228 180
229 debug-print "wxconf is ${wxconf}" 181 debug-print "wxconf is ${wxconf}"
230 182
231 # if this doesn't work, something is seriously screwed 183 # if this doesn't work, something is seriously screwed
232 if [[ ! -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then 184 if [[ ! -f ${EPREFIX}/usr/$(get_libdir)/wx/config/${wxconf} ]]; then

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

  ViewVC Help
Powered by ViewVC 1.1.20