/[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.46 Revision 1.47
1# Copyright 2007-2009 Gentoo Foundation 1# Copyright 1999-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.46 2009/10/06 18:02:12 alexxy Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.47 2009/10/27 14:16:49 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
11# and KDE4 applications. 11# and KDE4 applications.
12# 12#
13# NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but 13# NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but
14# eclass will fail with version older than 2. 14# eclass will fail with version older than 2.
15 15
16# @ECLASS-VARIABLE: WANT_CMAKE 16# @ECLASS-VARIABLE: CMAKE_REQUIRED
17# @DESCRIPTION: 17# @DESCRIPTION:
18# Specify if cmake-utils eclass is required. Defaults to true. Please note that 18# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'.
19# if the variable is set otherwise src_configure/compile/install calls in ebuild 19# Please note that if it's set to 'never' you need to explicitly override following phases:
20# must be overrided (can't use the eclass ones).
21WANT_CMAKE="${WANT_CMAKE:-true}"
22if [[ ${WANT_CMAKE} = true ]]; then
23 exports="src_configure src_compile src_test src_install" 20# src_configure, src_compile, src_test and src_install.
24 cmake_eclass="cmake-utils" 21# Defaults to 'always'.
22CMAKE_REQUIRED="${CMAKE_REQUIRED:-always}"
23if [[ ${WANT_CMAKE} = false || ${WANT_CMAKE} = never ]]; then
24 buildsystem_eclass=""
25 export_fns=""
25else 26else
26 exports="" 27 buildsystem_eclass="cmake-utils"
27 cmake_eclass="" 28 export_fns="src_configure src_compile src_test src_install"
28fi 29fi
29
30inherit base ${cmake_eclass} eutils kde4-functions
31 30
32get_build_type 31get_build_type
33if [[ ${BUILD_TYPE} = live ]]; then 32if [[ ${BUILD_TYPE} = live ]]; then
34 inherit subversion 33 subversion_eclass="subversion"
35fi 34fi
36 35
36inherit base ${cmake_utils} eutils kde4-functions ${subversion_eclass}
37 37
38EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${exports} pkg_postinst pkg_postrm 38EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm
39
40unset buildsystem_eclass
41unset export_fns
42unset subversion_eclass
39 43
40case ${KDEBASE} in 44case ${KDEBASE} in
41 kde-base) 45 kde-base)
42 HOMEPAGE="http://www.kde.org/" 46 HOMEPAGE="http://www.kde.org/"
43 LICENSE="GPL-2" 47 LICENSE="GPL-2"
91# version for apps to work. Currently defaults to 4.3 95# version for apps to work. Currently defaults to 4.3
92# One may override this variable to raise version requirements. 96# One may override this variable to raise version requirements.
93# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. 97# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
94# Note that it is fixed to ${SLOT} for kde-base packages. 98# Note that it is fixed to ${SLOT} for kde-base packages.
95KDE_MINIMAL="${KDE_MINIMAL:-4.3}" 99KDE_MINIMAL="${KDE_MINIMAL:-4.3}"
96
97# Fallback behaviour (for now)
98# TODO Remove when tree is clean
99if [[ -n ${NEED_KDE} ]]; then
100 case ${NEED_KDE} in
101 none)
102 KDE_REQUIRED="never"
103 ;;
104 *)
105 KDE_REQUIRED="always"
106 KDE_MINIMAL="${NEED_KDE}"
107 ;;
108 esac
109fi
110
111# @ECLASS-VARIABLE: QT_DEPEND
112# @DESCRIPTION:
113# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1..
114# Currently defaults to 4.5.1
115QT_DEPEND="${QT_DEPEND:-4.5.1}"
116
117# OpenGL dependencies
118qtopengldepend="
119 >=x11-libs/qt-opengl-${QT_DEPEND}:4
120"
121case ${OPENGL_REQUIRED} in
122 always)
123 COMMONDEPEND+=" ${qtopengldepend}"
124 ;;
125 optional)
126 IUSE+=" opengl"
127 COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
128 ;;
129 *) ;;
130esac
131unset qtopengldepend
132
133# WebKit dependencies
134case ${KDE_REQUIRED} in
135 always)
136 qtwebkitusedeps="[kde]"
137 ;;
138 optional)
139 qtwebkitusedeps="[kde?]"
140 ;;
141 *) ;;
142esac
143qtwebkitdepend="
144 >=x11-libs/qt-webkit-${QT_DEPEND}:4${qtwebkitusedeps}
145"
146unset qtwebkitusedeps
147case ${WEBKIT_REQUIRED} in
148 always)
149 COMMONDEPEND+=" ${qtwebkitdepend}"
150 ;;
151 optional)
152 IUSE+=" webkit"
153 COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
154 ;;
155 *) ;;
156esac
157unset qtwebkitdepend
158
159# CppUnit dependencies
160cppuintdepend="
161 dev-util/cppunit
162"
163case ${CPPUNIT_REQUIRED} in
164 always)
165 DEPEND+=" ${cppuintdepend}"
166 ;;
167 optional)
168 IUSE+=" test"
169 DEPEND+=" test? ( ${cppuintdepend} )"
170 ;;
171 *) ;;
172esac
173unset cppuintdepend
174 100
175# Setup packages inheriting this eclass 101# Setup packages inheriting this eclass
176case ${KDEBASE} in 102case ${KDEBASE} in
177 kde-base) 103 kde-base)
178 if [[ $BUILD_TYPE = live ]]; then 104 if [[ $BUILD_TYPE = live ]]; then
201 RESTRICT+=" mirror" 127 RESTRICT+=" mirror"
202 ;; 128 ;;
203 esac 129 esac
204 KDE_MINIMAL="${SLOT}" 130 KDE_MINIMAL="${SLOT}"
205 _kdedir="${SLOT}" 131 _kdedir="${SLOT}"
206 _pv="-${PV}:${SLOT}"
207 _pvn="-${PV}"
208 132
209 # Block installation of other SLOTS unless kdeprefix 133 # Block installation of other SLOTS unless kdeprefix
210 RDEPEND+=" $(block_other_slots)" 134 RDEPEND+=" $(block_other_slots)"
211 ;; 135 ;;
212 koffice) 136 koffice)
213 SLOT="2" 137 SLOT="2"
214 _pv="-${KDE_MINIMAL}"
215 _pvn="${_pv}"
216 ;; 138 ;;
217 *)
218 _pv="-${KDE_MINIMAL}"
219 _pvn="${_pv}"
220 ;;
221
222esac 139esac
140
141# @ECLASS-VARIABLE: QT_MINIMAL
142# @DESCRIPTION:
143# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1..
144# Currently defaults to 4.5.1 for KDE 4.3 and earlier
145# or 4.6.0_beta for KDE 4.4 and later
146if slot_is_at_least 4.4 "${KDE_MINIMAL}"; then
147 QT_MINIMAL="${QT_MINIMAL:-4.6.0_beta}"
148fi
149
150QT_MINIMAL="${QT_MINIMAL:-4.5.1}"
151
152# OpenGL dependencies
153qtopengldepend="
154 >=x11-libs/qt-opengl-${QT_MINIMAL}:4
155"
156case ${OPENGL_REQUIRED} in
157 always)
158 COMMONDEPEND+=" ${qtopengldepend}"
159 ;;
160 optional)
161 IUSE+=" opengl"
162 COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
163 ;;
164 *) ;;
165esac
166unset qtopengldepend
167
168# WebKit dependencies
169case ${KDE_REQUIRED} in
170 always)
171 qtwebkitusedeps="[kde]"
172 ;;
173 optional)
174 qtwebkitusedeps="[kde?]"
175 ;;
176 *) ;;
177esac
178qtwebkitdepend="
179 >=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps}
180"
181unset qtwebkitusedeps
182case ${WEBKIT_REQUIRED} in
183 always)
184 COMMONDEPEND+=" ${qtwebkitdepend}"
185 ;;
186 optional)
187 IUSE+=" webkit"
188 COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
189 ;;
190 *) ;;
191esac
192unset qtwebkitdepend
193
194# CppUnit dependencies
195cppuintdepend="
196 dev-util/cppunit
197"
198case ${CPPUNIT_REQUIRED} in
199 always)
200 DEPEND+=" ${cppuintdepend}"
201 ;;
202 optional)
203 IUSE+=" test"
204 DEPEND+=" test? ( ${cppuintdepend} )"
205 ;;
206 *) ;;
207esac
208unset cppuintdepend
223 209
224# KDE dependencies 210# KDE dependencies
225kdecommondepend=" 211kdecommondepend="
226 dev-lang/perl 212 dev-lang/perl
227 >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl] 213 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
228 >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus] 214 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
229 >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility,kde] 215 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
230 >=x11-libs/qt-script-${QT_DEPEND}:4 216 >=x11-libs/qt-script-${QT_MINIMAL}:4
231 >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support] 217 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
232 >=x11-libs/qt-svg-${QT_DEPEND}:4 218 >=x11-libs/qt-svg-${QT_MINIMAL}:4
233 >=x11-libs/qt-test-${QT_DEPEND}:4 219 >=x11-libs/qt-test-${QT_MINIMAL}:4
234 !aqua? ( 220 !aqua? (
235 x11-libs/libXext 221 x11-libs/libXext
236 x11-libs/libXt 222 x11-libs/libXt
237 x11-libs/libXxf86vm 223 x11-libs/libXxf86vm
238 ) 224 )
239" 225"
240if [[ ${PN} != kdelibs ]]; then 226if [[ ${PN} != kdelibs ]]; then
241 if [[ ${KDEBASE} = kde-base ]]; then 227 if [[ ${KDEBASE} = kde-base ]]; then
228 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
242 # libknotificationitem only when SLOT is 4.3 229 # libknotificationitem only when SLOT is 4.3
243 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && local libknotificationitem_required=1 230 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && \
244 kdecommondepend+=" 231 kdecommondepend+=" $(add_kdebase_dep libknotificationitem)"
245 kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] )
246 !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] )
247 "
248 [[ -n ${libknotificationitem_required} ]] && \
249 kdecommondepend+="
250 kdeprefix? ( >=kde-base/libknotificationitem${_pv}[kdeprefix] )
251 !kdeprefix? ( >=kde-base/libknotificationitem${_pvn}[-kdeprefix] )
252 "
253 else 232 else
254 kdecommondepend+=" 233 kdecommondepend+="
255 >=kde-base/kdelibs${_pv} 234 >=kde-base/kdelibs-${KDE_MINIMAL}
256 " 235 "
257 fi 236 fi
258fi 237fi
259unset _pv _pvn
260kdedepend=" 238kdedepend="
261 dev-util/pkgconfig 239 dev-util/pkgconfig
262" 240"
263case ${KDE_REQUIRED} in 241case ${KDE_REQUIRED} in
264 always) 242 always)
371 esac 349 esac
372 else 350 else
373 _kmname=${PN} 351 _kmname=${PN}
374 fi 352 fi
375 _kmname_pv="${_kmname}-${PV}" 353 _kmname_pv="${_kmname}-${PV}"
376 if [[ $NEED_KDE != live ]]; then
377 case ${KDEBASE} in 354 case ${KDEBASE} in
378 kde-base) 355 kde-base)
379 case ${PV} in 356 case ${PV} in
380 4.3.85 | 4.3.9[0568]) 357 4.3.85 | 4.3.9[0568])
381 # block for normally packed unstable releases 358 # block for normally packed unstable releases
389 case ${PV} in 366 case ${PV} in
390 2.0.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; 367 2.0.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;;
391 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; 368 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;;
392 esac 369 esac
393 esac 370 esac
394 fi
395 unset _kmname _kmname_pv 371 unset _kmname _kmname_pv
396 fi 372 fi
397 ;; 373 ;;
398esac 374esac
399 375
410# Do the basic kdeprefix KDEDIR settings and determine with which kde should 386# Do the basic kdeprefix KDEDIR settings and determine with which kde should
411# optional applications link 387# optional applications link
412kde4-base_pkg_setup() { 388kde4-base_pkg_setup() {
413 debug-print-function ${FUNCNAME} "$@" 389 debug-print-function ${FUNCNAME} "$@"
414 390
391 # Prefix compat:
392 use prefix || EROOT=${ROOT}
393 # Append missing trailing slash character
394 [[ ${EROOT} = */ ]] || EROOT+="/"
395
415 # QA ebuilds 396 # QA ebuilds
416 case ${NEED_KDE} in
417 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}\")." ;;
418 *) [[ -n ${NEED_KDE} ]] && ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_MINIMAL instead (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
419 esac
420 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." 397 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
421 398
422 # Don't set KDEHOME during compilation, it will cause access violations 399 # Don't set KDEHOME during compilation, it will cause access violations
423 unset KDEHOME 400 unset KDEHOME
424 401
458 # Point pkg-config path to KDE *.pc files 435 # Point pkg-config path to KDE *.pc files
459 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" 436 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
460 # Point to correct QT plugins path 437 # Point to correct QT plugins path
461 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 438 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
462 439
440 # Fix XDG collision with sandbox
441 export XDG_CONFIG_HOME="${T}"
463 # Not needed anymore 442 # Not needed anymore
464 unset _kdedir 443 unset _kdedir
465} 444}
466 445
467# @FUNCTION: kde4-base_src_unpack 446# @FUNCTION: kde4-base_src_unpack

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.47

  ViewVC Help
Powered by ViewVC 1.1.20