/[gentoo-x86]/eclass/kde4-base.eclass
Gentoo

Diff of /eclass/kde4-base.eclass

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

Revision 1.33 Revision 1.34
1# Copyright 2007-2009 Gentoo Foundation 1# Copyright 2007-2009 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/kde4-base.eclass,v 1.33 2009/03/26 21:55:09 jmbsvicetto Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.34 2009/04/13 00:02:45 scarabeus Exp $
4 4
5# @ECLASS: kde4-base.eclass 5# @ECLASS: kde4-base.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# kde@gentoo.org 7# kde@gentoo.org
8# @BLURB: This eclass provides functions for kde 4.X ebuilds 8# @BLURB: This eclass provides functions for kde 4.X ebuilds
20 inherit subversion 20 inherit subversion
21fi 21fi
22 22
23EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 23EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
24 24
25# @FUNCTION: kde4-base_set_qt_dependencies 25# @ECLASS-VARIABLE: OPENGL_REQUIRED
26# @DESCRIPTION: 26# @DESCRIPTION:
27# Set qt dependencies. And use opengl based on OPENGL_REQUIRED variable. 27# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
28kde4-base_set_qt_dependencies() { 28# This variable must be set before inheriting any eclasses. Defaults to 'never'.
29 local qtdepend qtopengldepend 29OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
30 30
31 qtdepend=" 31# @ECLASS-VARIABLE: WEBKIT_REQUIRED
32 x11-libs/qt-core:4[qt3support,ssl] 32# @DESCRIPTION:
33 x11-libs/qt-gui:4[accessibility,dbus] 33# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
34 x11-libs/qt-qt3support:4[accessibility] 34# This variable must be set before inheriting any eclasses. Defaults to 'never'.
35 x11-libs/qt-script:4 35WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
36 x11-libs/qt-sql:4[qt3support]
37 x11-libs/qt-svg:4
38 x11-libs/qt-test:4
39 "
40 qtwebkitdepend="
41 x11-libs/qt-webkit:4
42 "
43 qtopengldepend="
44 x11-libs/qt-opengl:4
45 "
46 36
47 case ${WEBKIT_REQUIRED} in 37# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
48 always) 38# @DESCRIPTION:
49 qtdepend="${qtdepend} 39# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
50 ${qtwebkitdepend}" 40# This variable must be set before inheriting any eclasses. Defaults to 'never'.
41CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
42
43# @ECLASS-VARIABLE: KDE_REQUIRED
44# @DESCRIPTION:
45# Is kde required? Possible values are 'always', 'optional' and 'never'.
46# This variable must be set before inheriting any eclasses. Defaults to 'always'
47# If set to always or optional, KDE_MINIMAL may be overriden as well.
48# Note that for kde-base packages this variable is fixed to 'always'.
49KDE_REQUIRED="${KDE_REQUIRED:-always}"
50
51# Verify KDE_MINIMAL (display QA notice in pkg_setup, still we need to fix it here)
52if [[ -n ${KDE_MINIMAL} ]]; then
53 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
54 [[ ${KDE_MINIMAL} = ${slot} ]] && KDE_MINIMAL_VALID=1 && break
55 done
56 [[ -z ${KDE_MINIMAL_VALID} ]] && unset KDE_MINIMAL
57else
58 KDE_MINIMAL_VALID=1
59fi
60
61# @ECLASS-VARIABLE: KDE_MINIMAL
62# @DESCRIPTION:
63# This wariable is used when KDE_REQUIRED is set, to specify required KDE minimal
64# version for apps to work. Currently defaults to 4.2
65# One may override this variable to raise version requirements.
66# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
67# Note that for kde-base packages is fixed to ${SLOT}.
68KDE_MINIMAL="${KDE_MINIMAL:-4.2}"
69
70# Fallback behaviour (for now)
71# TODO Remove when tree is clean
72if [[ -n ${NEED_KDE} ]]; then
73 case ${NEED_KDE} in
74 none)
75 KDE_REQUIRED="never"
51 ;; 76 ;;
52 optional) 77 *)
53 IUSE="${IUSE} webkit" 78 KDE_REQUIRED="always"
54 qtdepend="${qtdepend} 79 KDE_MINIMAL="${NEED_KDE}"
55 webkit? ( ${qtwebkitdepend} )
56 "
57 ;; 80 ;;
58 *) WEBKIT_REQUIRED="never" ;;
59 esac 81 esac
82fi
83
60 # opengl dependencies 84# OpenGL dependencies
85qtopengldepend="
86 x11-libs/qt-opengl:4
87"
61 case ${OPENGL_REQUIRED} in 88case ${OPENGL_REQUIRED} in
62 always) 89 always)
63 qtdepend="${qtdepend} 90 COMMONDEPEND="${COMMONDEPEND} ${qtopengldepend}"
64 ${qtopengldepend}
65 "
66 ;; 91 ;;
67 optional) 92 optional)
68 IUSE="${IUSE} opengl" 93 IUSE="${IUSE} opengl"
69 qtdepend="${qtdepend} 94 COMMONDEPEND="${COMMONDEPEND}
70 opengl? ( ${qtopengldepend} ) 95 opengl? ( ${qtopengldepend} )
71 " 96 "
72 ;; 97 ;;
73 *) OPENGL_REQUIRED="never" ;; 98 *) ;;
74 esac 99esac
100unset qtopengldepend
75 101
102# WebKit dependencies
103qtwebkitdepend="
104 x11-libs/qt-webkit:4
105"
106case ${WEBKIT_REQUIRED} in
107 always)
76 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}" 108 COMMONDEPEND="${COMMONDEPEND} ${qtwebkitdepend}"
77} 109 ;;
110 optional)
111 IUSE="${IUSE} webkit"
112 COMMONDEPEND="${COMMONDEPEND}
113 webkit? ( ${qtwebkitdepend} )
114 "
115 ;;
116 *) ;;
117esac
118unset qtwebkitdepend
78 119
120# CppUnit dependencies
121cppuintdepend="
122 dev-util/cppunit
123"
124case ${CPPUNIT_REQUIRED} in
125 always)
126 DEPEND="${DEPEND} ${cppuintdepend}"
127 ;;
128 optional)
129 IUSE="${IUSE} test"
130 DEPEND="${DEPEND}
131 test? ( ${cppuintdepend} )
132 "
133 ;;
134 *) ;;
135esac
136unset cppuintdepend
137
138# DEPRECATED block
79if [[ ${NEED_KDE} != "none" ]] ; then 139if [[ ${NEED_KDE} != "none" ]]; then
80 # Qt
81 kde4-base_set_qt_dependencies
82
83 # X11 libs
84 COMMONDEPEND="${COMMONDEPEND}
85 x11-libs/libXext
86 x11-libs/libXt
87 x11-libs/libXxf86vm
88 "
89
90 # localization deps 140 # localization deps
91 # DISABLED UNTIL PMS decide correct approach :( 141 # DISABLED UNTIL PMS decide correct approach :(
92 if [[ -n ${KDE_LINGUAS} ]]; then 142 if [[ -n ${KDE_LINGUAS} ]]; then
93 LNG_DEP="" 143 LNG_DEP=""
94 for _lng in ${KDE_LINGUAS}; do 144 for _lng in ${KDE_LINGUAS}; do
95 # there must be or due to issue if lingua is not present in kde-l10n so 145 # there must be or due to issue if lingua is not present in kde-l10n so
96 # it wont die but pick kde-l10n as-is. 146 # it wont die but pick kde-l10n as-is.
97 LNG_DEP="${LNG_DEP} 147 LNG_DEP="${LNG_DEP}
98 || ( kde-base/kde-l10n[linguas_${_lng},kdeprefix=] kde-base/kde-l10n[kdeprefix=] )" 148 || (
149 kde-base/kde-l10n[linguas_${_lng},kdeprefix=]
150 kde-base/kde-l10n[kdeprefix=]
151 )
152 "
99 done 153 done
100 fi 154 fi
101
102 # Set common dependencies for all ebuilds that inherit this eclass
103 DEPEND="${DEPEND} ${COMMONDEPEND}
104 >=dev-util/cmake-2.6.2
105 dev-util/pkgconfig
106 >=sys-apps/sandbox-1.3.2
107 "
108 RDEPEND="${RDEPEND} ${COMMONDEPEND}"
109fi # NEED_KDE != NONE block 155fi # NEED_KDE != NONE block
110 156
157# Setup packages inheriting this eclass
158case ${KDEBASE} in
159
160 kde-base)
111if [[ $BUILD_TYPE = live ]]; then 161 if [[ $BUILD_TYPE = live ]]; then
112 # Disable tests for live ebuilds 162 # Disable tests for live ebuilds
113 RESTRICT="${RESTRICT} test" 163 RESTRICT="${RESTRICT} test"
114 # Live ebuilds in kde-base default to kdeprefix by default 164 # Live ebuilds in kde-base default to kdeprefix by default
115 IUSE="${IUSE} +kdeprefix" 165 IUSE="${IUSE} +kdeprefix"
116else 166 else
117 # All other ebuild types default to -kdeprefix as before 167 # All other ebuild types default to -kdeprefix as before
118 IUSE="${IUSE} kdeprefix" 168 IUSE="${IUSE} kdeprefix"
169 fi
170 # Determine SLOT from PV
171 case ${PV} in
172 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;;
173 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;;
174 *9999*) SLOT="live" ;;
175 *) die "Unsupported ${PV}" ;;
176 esac
177 _kdedir="${SLOT}"
178 _pv="-${PV}:${SLOT}"
179 _pvn="-${PV}"
180
181 # Block installation of other SLOTS unless kdeprefix
182 for slot in ${KDE_SLOTS[@]}; do
183 # Block non kdeprefix ${PN} on other slots
184 if [[ ${SLOT} != ${slot} ]]; then
185 RDEPEND="${RDEPEND}
186 !kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )
187 "
188 fi
189 done
190 ;;
191
192 koffice)
193 SLOT="2"
194 _pv="-${KDE_MINIMAL}"
195 _pvn="${_pv}"
196 ;;
197
198 *)
199 _pv="-${KDE_MINIMAL}"
200 _pvn="${_pv}"
201 ;;
202
203esac
204
205# KDE dependencies
206kdecommondepend="
207 dev-lang/perl
208 x11-libs/libXext
209 x11-libs/libXt
210 x11-libs/libXxf86vm
211 x11-libs/qt-core:4[qt3support,ssl]
212 x11-libs/qt-gui:4[accessibility,dbus]
213 x11-libs/qt-qt3support:4[accessibility]
214 x11-libs/qt-script:4
215 x11-libs/qt-sql:4[qt3support]
216 x11-libs/qt-svg:4
217 x11-libs/qt-test:4
218"
219if [[ ${PN} != kdelibs ]]; then
220 if [[ ${KDEBASE} = kde-base ]]; then
221 kdecommondepend="${kdecommondepend}
222 kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] )
223 !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] )
224 "
225 else
226 kdecommondepend="${kdecommondepend}
227 >=kde-base/kdelibs${_pv}
228 "
229 fi
119fi 230fi
120 231unset _pv _pvn
121# @ECLASS-VARIABLE: OPENGL_REQUIRED 232kdedepend="
122# @DESCRIPTION: 233 >=dev-util/cmake-2.6.2
123# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. 234 dev-util/pkgconfig
124# This variable must be set before inheriting any eclasses. Defaults to 'never'. 235 >=sys-apps/sandbox-1.3.2
125OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" 236"
126
127# @ECLASS-VARIABLE: WEBKIT_REQUIRED
128# @DESCRIPTION:
129# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
130# This variable must be set before inheriting any eclasses. Defaults to 'never'.
131WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
132
133# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
134# @DESCRIPTION:
135# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
136# This variable must be set before inheriting any eclasses. Defaults to 'never'.
137CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
138
139case ${CPPUNIT_REQUIRED} in 237case ${KDE_REQUIRED} in
140 always) 238 always)
239 COMMONDEPEND="${COMMONDEPEND} ${kdecommondepend}"
240 DEPEND="${DEPEND} ${kdedepend}"
241 ;;
242 optional)
243 IUSE="${IUSE} kde"
244 COMMONDEPEND="${COMMONDEPEND}
245 kde? ( ${kdecommondepend} )"
141 DEPEND="${DEPEND} 246 DEPEND="${DEPEND}
142 dev-util/cppunit 247 kde? ( ${kdedepend} )"
143 "
144 ;; 248 ;;
145 optional) 249 *) ;;
146 IUSE="${IUSE} test"
147 DEPEND="${DEPEND}
148 test? ( dev-util/cppunit )
149 "
150 ;;
151 *)
152 CPPUNIT_REQUIRED="never"
153 ;;
154esac 250esac
251unset kdecommondepend kdedepend
155 252
156# @ECLASS-VARIABLE: NEED_KDE 253debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
157# @DESCRIPTION: 254debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
158# This variable sets the version of KDE4 which will be used by the eclass. 255debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
159# For kde-base packages, if it is not set by the ebuild,
160# it's assumed that the required KDE4 version is the latest available.
161# For non kde-base packages, it is also set to the latest by default.
162#
163# For more precise adjustments or for specifying particular kde version,
164# KDE_MINIMAL variable can be used.
165#
166# @CODE
167# Acceptable values are:
168# - latest - Use latest version in the portage tree
169# Default for kde-base ebuilds.
170# - live - Use live release (live ebuilds)
171# - none - Let the ebuild handle SLOT, kde dependencies, KDEDIR, ...
172# - 4.2, 4.1, kde-4 - respective slots for kde versions
173# @CODE
174# Note: default NEED_KDE is latest
175NEED_KDE="${NEED_KDE:=latest}"
176export NEED_KDE
177 256
178# @ECLASS-VARIABLE: KDE_MINIMAL 257# Accumulate dependencies set by this eclass
179# @DESCRIPTION: 258DEPEND="${DEPEND} ${COMMONDEPEND}"
180# This wariable is used when NEED_KDE="latest" is set, to specify the 259RDEPEND="${RDEPEND} ${COMMONDEPEND}"
181# required KDE minimal version for which apps will work.
182# @CODE
183# KDE_MINIMAL="-4.1"
184# @CODE
185# Note: default minimal version is kde-4.1, which means that the apps will work
186# with any KDE version >=${KDE_MINIMAL}
187KDE_MINIMAL="${KDE_MINIMAL:=4.2}"
188export KDE_MINIMAL
189
190# FIXME: the code section, explanation of live. The last sentence needs other
191# formulation too.
192#
193# @ECLASS-VARIABLE: KDE_WANTED
194# @DESCRIPTION:
195# When NEED_KDE=latest is inherited, KDE_WANTED serves to indicate the prefered kde
196# version. It's value is looked for before any other. Useful when having more
197# +kdeprefix installs: you can choose which kde version, if present, to link
198# against.
199#
200# @CODE
201# Acceptable values are:
202# stable = whatever is main tree (now 4.1)
203# testing = whatever is in testing on main tree
204# snapshot = whatever is released under snapshots (4.2 at present)
205# live = live svn ebuilds, also default value, do not be scared it goes in this
206#
207# order: live->snapshot->testing->stable, when searching for kde. This way we
208# allow users to use just kde4snapshots and use software from the tree.
209KDE_WANTED="${KDE_WANTED:=live}"
210export KDE_WANTED
211
212case ${NEED_KDE} in
213 latest)
214 if [[ $KDEBASE = kde-base ]]; then
215 case ${PV} in
216 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
217 _kdedir="4.3"
218 _pv="-${PV}:4.3"
219 _pvn="-${PV}"
220 ;;
221 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*)
222 _kdedir="4.2"
223 _pv="-${PV}:4.2"
224 _pvn="-${PV}"
225 ;;
226 4.1*| 4.0.9* | 4.0.8*)
227 _kdedir="4.1"
228 _pv="-${PV}:4.1"
229 _pvn="-${PV}"
230 ;;
231 4.0*)
232 _kdedir="4.0"
233 _pv="-${PV}:kde-4"
234 _pvn="-${PV}"
235 ;;
236 3.9*)
237 _kdedir="3.9"
238 _pv="-${PV}:kde-4"
239 _pvn="-${PV}"
240 ;;
241 9999*)
242 _kdedir="live"
243 _pv="-${PV}:live"
244 _pvn="-${PV}"
245 ;;
246 *)
247 die "NEED_KDE=latest not supported for PV=${PV}" ;;
248 esac
249 _operator=">="
250 else
251 # this creates dependency on any version of kde4
252 _operator=">="
253 _pv="-${KDE_MINIMAL}"
254 _pvn=${_pv}
255 fi
256 ;;
257
258 # NEED_KDE="${PV}"
259 scm|svn|live|9999*)
260 _kdedir="live"
261 _operator=">="
262 _pv="-${NEED_KDE}:live"
263 _pvn="-${NEED_KDE}"
264 export NEED_KDE="live"
265 ;;
266 4.3 | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
267 _kdedir="4.3"
268 _pv="-${NEED_KDE}:4.3"
269 _pvn="-${NEED_KDE}"
270 _operator=">="
271 ;;
272 4.2 | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*)
273 _kdedir="4.2"
274 _pv="-${NEED_KDE}:4.2"
275 _pvn="-${NEED_KDE}"
276 _operator=">="
277 ;;
278 4.1 | 4.0.9* | 4.0.8*)
279 _kdedir="4.1"
280 _pv="-${NEED_KDE}:4.1"
281 _pvn="-${NEED_KDE}"
282 _operator=">="
283 ;;
284 4.0* | 4)
285 _kdedir="4.0"
286 _operator=">="
287 _pv="-${NEED_KDE}:kde-4"
288 _pvn="-${NEED_KDE}"
289 ;;
290 3.9*)
291 _kdedir="3.9"
292 _operator=">="
293 _pv="-${NEED_KDE}:kde-4"
294 _pvn="-${NEED_KDE}"
295 ;;
296
297 # The ebuild handles dependencies, KDEDIR, SLOT.
298 none)
299 :
300 ;;
301
302 *)
303 die "NEED_KDE=${NEED_KDE} currently not supported."
304 ;;
305esac
306
307if [[ ${NEED_KDE} != none ]]; then
308 #Set the SLOT
309 if [[ -n ${KDEBASE} ]]; then
310 if [[ ${NEED_KDE} = live ]]; then
311 SLOT="live"
312 else
313 case ${KMNAME} in
314 koffice)
315 case ${PV} in
316 9999*) SLOT="live" ;;
317 *) SLOT="2" ;;
318 esac
319 ;;
320 kdevelop)
321 case ${PV} in
322 9999*) SLOT="live" ;;
323 4.0*|3.9*) SLOT="4" ;;
324 esac
325 ;;
326 kdevplatform)
327 case ${PV} in
328 9999*) SLOT="live" ;;
329 1.0*|0.9*) SLOT="1" ;;
330 esac
331 ;;
332 *)
333 case ${PV} in
334 9999*) SLOT="live" ;;
335 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;;
336 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;;
337 4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
338 *) SLOT="4.1" ;;
339 esac
340 ;;
341 esac
342 fi
343 fi
344
345 # Block installation of other SLOTS unless kdeprefix
346 for KDE_SLOT in ${KDE_SLOTS[@]}; do
347 # block non kdeprefix ${PN} on other slots
348 # we do this only if we do not depend on any version of kde
349 if [[ ${SLOT} != ${KDE_SLOT} ]]; then
350 RDEPEND="${RDEPEND}
351 !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )
352 "
353 fi
354 done
355
356 # Adding kdelibs and kdebase-data deps to all other packages.
357 if [[ ${PN} != kdelibs ]]; then
358 DEPEND="${DEPEND}
359 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
360 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )
361 "
362 RDEPEND="${RDEPEND}
363 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
364 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )
365 "
366 if [[ ${PN} != kdepimlibs && ${PN} != kdebase-data ]]; then
367 RDEPEND="${RDEPEND}
368 kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] )
369 !kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )
370 "
371 fi
372 fi
373 unset _operator _pv _pvn
374fi
375 260
376# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a 261# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
377# koffice ebuild, the URI should be set in the ebuild itself 262# koffice ebuild, the URI should be set in the ebuild itself
378case ${BUILD_TYPE} in 263case ${BUILD_TYPE} in
379 live) 264 live)
380 SRC_URI="" 265 SRC_URI=""
381 ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde} 266 ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
382 # Split ebuild, or extragear stuff 267 # Split ebuild, or extragear stuff
383 if [[ -n ${KMNAME} ]]; then 268 if [[ -n ${KMNAME} ]]; then
384 ESVN_PROJECT="${KMNAME}" 269 ESVN_PROJECT="${KMNAME}"
385 if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then 270 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
386 KMMODULE="${PN}" 271 KMMODULE="${PN}"
387 fi 272 fi
388 # Split kde-base/ ebuilds: (they reside in trunk/KDE) 273 # Split kde-base/ ebuilds: (they reside in trunk/KDE)
389 case ${KMNAME} in 274 case ${KMNAME} in
390 kdebase-*) 275 kdebase-*)
391 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}" 276 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}"
392 ;; 277 ;;
393 kdereview) 278 kdereview)
394 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" 279 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
395 ;; 280 ;;
281 kdesupport)
282 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
283 ESVN_PROJECT="${PN}"
284 ;;
396 kde*) 285 kde*)
397 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}" 286 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}"
398 ;; 287 ;;
399 extragear*|playground*) 288 extragear*|playground*)
289 # Unpack them in toplevel dir, so that they won't conflict with kde4-meta
290 # build packages from same svn location.
400 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" 291 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
292 ESVN_PROJECT="${PN}"
401 ;; 293 ;;
402 koffice) 294 koffice)
403 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 295 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
404 ;; 296 ;;
405 *) 297 *)
419 if [[ -n ${KMNAME} ]]; then 311 if [[ -n ${KMNAME} ]]; then
420 case ${KMNAME} in 312 case ${KMNAME} in
421 kdebase-apps) 313 kdebase-apps)
422 _kmname="kdebase" ;; 314 _kmname="kdebase" ;;
423 *) 315 *)
424 _kmname=${KMNAME} ;; 316 _kmname="${KMNAME}" ;;
425 esac 317 esac
426 else 318 else
427 _kmname=${PN} 319 _kmname=${PN}
428 fi 320 fi
429 _kmname_pv="${_kmname}-${PV}" 321 _kmname_pv="${_kmname}-${PV}"
450 342
451debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" 343debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
452 344
453# @ECLASS-VARIABLE: PREFIX 345# @ECLASS-VARIABLE: PREFIX
454# @DESCRIPTION: 346# @DESCRIPTION:
455# Set the installation PREFIX. All kde-base ebuilds go into the KDE4 installation directory. 347# Set the installation PREFIX for non kde-base applications. It defaults to /usr.
456# Applications installed by the other ebuilds go into ${KDEDIR} by default, this value 348# kde-base packages go into KDE4 installation directory (KDEDIR) by default.
457# can be superseded by defining PREFIX before inheriting kde4-base. 349# No matter the PREFIX, package will be built agains KDE installed in KDEDIR.
458# This value is set on pkg_setup
459PREFIX=""
460
461debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SLOT ${SLOT} - NEED_KDE ${NEED_KDE}"
462 350
463# @FUNCTION: kde4-base_pkg_setup 351# @FUNCTION: kde4-base_pkg_setup
464# @DESCRIPTION: 352# @DESCRIPTION:
465# Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses 353# Do the basic kdeprefix KDEDIR settings and determine with which kde should
466# kde4-functions_check_use from kde4-functions.eclass to print appropriate 354# optional applications link
467# errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or
468# $KDE4_BUILT_WITH_USE_CHECK are missing.
469kde4-base_pkg_setup() { 355kde4-base_pkg_setup() {
470 debug-print-function ${FUNCNAME} "$@" 356 debug-print-function ${FUNCNAME} "$@"
471 357
358 # QA ebuilds
359 case ${NEED_KDE} in
360 none) ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_REQUIRED=\"never\" or KDE_REQUIRED=\"optional\" instead. You may want to override KDE_MINIMAL as well (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
361 *) [[ -n ${NEED_KDE} ]] && ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_MINIMAL instead (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
362 esac
363 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
364
472 # Don't set KDEHOME during compile, it will cause access violations 365 # Don't set KDEHOME during compilation, it will cause access violations
473 unset KDEHOME 366 unset KDEHOME
474 367
475 # Search for best suitable kde installation for misc kde package. 368 if [[ ${KDEBASE} = kde-base ]]; then
476 # Computation based on NEED_KDE and KDE_MINIMAL
477 [[ ${KDEBASE} != kde-base ]] && [[ ${NEED_KDE} = latest || ${NEED_KDE} = none ]] && get_latest_kdedir
478
479 # Set PREFIX
480 if use kdeprefix; then 369 if use kdeprefix; then
481 KDEDIR="/usr/kde/${_kdedir}" 370 KDEDIR="/usr/kde/${_kdedir}"
482 KDEDIRS="/usr/local/:/usr:${KDEDIR}" 371 else
372 KDEDIR="/usr"
373 fi
374 PREFIX="${PREFIX:-${KDEDIR}}"
483 else 375 else
376 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
377 KDEDIR=
378 local kde_minimal_met
379 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
380 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
381 if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then
382 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
383 KDEDIR="/usr/kde/${slot}"
384 else
484 KDEDIR="/usr" 385 KDEDIR="/usr"
485 KDEDIRS="/usr/local/:/usr" 386 fi
387 break;
486 fi 388 fi
487 # Set the prefix based on KDEDIR 389 done
488 # Make it a consequence of kdeprefix 390 [[ -z KDEDIR ]] && die "Failed to determine KDEDIR!"
489 PREFIX=${KDEDIR} 391 PREFIX="${PREFIX:-/usr}"
392 fi
490 393
394 # Not needed anymore
491 unset _kdedir 395 unset _kdedir
492 396
493 # check if qt has correct deps
494 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \
495 die "built_with_use illegal in this EAPI!"
496
497 if [[ ${BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then 397 if [[ ${BUILD_TYPE} = live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
498 echo 398 echo
499 elog "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}" 399 elog "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}"
500 elog "Use it at your own risk." 400 elog "Use it at your own risk."
501 elog "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" 401 elog "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
502 echo 402 echo
552 # Handle common release builds 452 # Handle common release builds
553 if ! has debug ${IUSE//+} || ! use debug; then 453 if ! has debug ${IUSE//+} || ! use debug; then
554 append-cppflags -DQT_NO_DEBUG 454 append-cppflags -DQT_NO_DEBUG
555 fi 455 fi
556 456
557 # Enable generation of HTML handbook
558 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
559 ebegin "Enabling building of HTML handbook"
560 mycmakeargs="${mycmakeargs} -DKDE4_ENABLE_HTMLHANDBOOK=ON"
561 eend $?
562 fi
563
564 # Build tests in src_test only, where we override this value 457 # Build tests in src_test only, where we override this value
565 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF" 458 local cmakeargs="-DKDE4_BUILD_TESTS=OFF"
566 459
567 # Set distribution name 460 # Set distribution name
568 [[ ${PN} = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" 461 [[ ${PN} = kdelibs ]] && cmakeargs="${cmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
569
570 # runpath linking
571 mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
572 462
573 # Here we set the install prefix 463 # Here we set the install prefix
574 mycmakeargs="${mycmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}" 464 cmakeargs="${cmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}"
575
576 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
577 use kdeprefix || mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
578 465
579 # Set environment 466 # Set environment
580 QTEST_COLORED=1 467 QTEST_COLORED=1
581 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 468 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
582 469
583 # Hardcode path to *.pc KDE files 470 # Hardcode path to *.pc KDE files
584 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig" 471 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig"
585 472
586 # Override some environment variables 473 # Shadow existing /usr installations
474 unset KDEDIRS
475
476 # Override some environment variables - only when kdeprefix is different,
477 # to not break ccache/distcc
478 if [[ ${KDEDIR} != /usr ]]; then
587 PATH="${KDEDIR}/bin:${PATH}" 479 PATH="${KDEDIR}/bin:${PATH}"
588 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}" 480 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}"
481 fi
589 482
483 if has kdeprefix ${IUSE//+} && use kdeprefix; then
590 # Set cmake prefixes to allow buildsystem to localize valid KDE installation when more are present 484 # Set cmake prefixes to allow buildsystem to localize valid KDE installation
591 if use kdeprefix; then 485 # when more are present
486 cmakeargs="${cmakeargs} -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}"
487 else
488 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
489 cmakeargs="${cmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
490 fi
491
592 mycmakeargs="${mycmakeargs} 492 mycmakeargs="${cmakeargs} ${mycmakeargs}"
593 -DCMAKE_SYSTEM_INCLUDE_PATH=${KDEDIR}/include
594 -DCMAKE_SYSTEM_LIBRARY_PATH=${KDEDIR}/$(get_libdir)
595 -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}
596 -DCMAKE_SYSTEM_PROGRAM_PATH=${KDEDIR}/bin"
597 fi
598 493
599 [ -e CMakeLists.txt ] && cmake-utils_src_configure 494 cmake-utils_src_configure
600} 495}
601 496
602# @FUNCTION: kde4-base_src_compile 497# @FUNCTION: kde4-base_src_compile
603# @DESCRIPTION: 498# @DESCRIPTION:
604# General function for compiling KDE4 applications. 499# General function for compiling KDE4 applications.
655 newdoc "$doc_complete" "${doc%/*}.${doc##*/}" 550 newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
656 fi 551 fi
657 done 552 done
658 fi 553 fi
659 554
660 if [[ -n ${KDEBASE} && -d "${D}/usr/share/doc/${PF}" ]]; then 555 if [[ -n ${KDEBASE} ]] && [[ -d "${D}/usr/share/doc/${PF}" ]]; then
661 # work around bug #97196 556 # work around bug #97196
662 dodir /usr/share/doc/kde && \ 557 dodir /usr/share/doc/KDE4 && \
663 mv "${D}/usr/share/doc/${PF}" "${D}"/usr/share/doc/kde/ || \ 558 mv "${D}/usr/share/doc/${PF}" "${D}"/usr/share/doc/KDE4/ || \
664 die "Failed to move docs to kde/ failed." 559 die "Failed to move docs to KDE4/."
665 fi 560 fi
666} 561}
667 562
668# @FUNCTION: kde4-base_pkg_postinst 563# @FUNCTION: kde4-base_pkg_postinst
669# @DESCRIPTION: 564# @DESCRIPTION:

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

  ViewVC Help
Powered by ViewVC 1.1.20