/[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.53
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.53 2009/11/25 19:51:11 tampakrap 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:-${CMAKE_REQUIRED:-always}}"
23if [[ ${CMAKE_REQUIRED} = false || ${CMAKE_REQUIRED} = 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 30
30inherit base ${cmake_eclass} eutils kde4-functions 31inherit kde4-functions
31 32
32get_build_type 33get_build_type
33if [[ ${BUILD_TYPE} = live ]]; then 34if [[ ${BUILD_TYPE} = live ]]; then
34 inherit subversion 35 subversion_eclass="subversion"
35fi 36fi
36 37
38inherit base ${buildsystem_eclass} eutils ${subversion_eclass}
37 39
38EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${exports} pkg_postinst pkg_postrm 40EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm
41
42unset buildsystem_eclass
43unset export_fns
44unset subversion_eclass
39 45
40case ${KDEBASE} in 46case ${KDEBASE} in
41 kde-base) 47 kde-base)
42 HOMEPAGE="http://www.kde.org/" 48 HOMEPAGE="http://www.kde.org/"
43 LICENSE="GPL-2" 49 LICENSE="GPL-2"
91# version for apps to work. Currently defaults to 4.3 97# version for apps to work. Currently defaults to 4.3
92# One may override this variable to raise version requirements. 98# One may override this variable to raise version requirements.
93# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. 99# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
94# Note that it is fixed to ${SLOT} for kde-base packages. 100# Note that it is fixed to ${SLOT} for kde-base packages.
95KDE_MINIMAL="${KDE_MINIMAL:-4.3}" 101KDE_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 102
175# Setup packages inheriting this eclass 103# Setup packages inheriting this eclass
176case ${KDEBASE} in 104case ${KDEBASE} in
177 kde-base) 105 kde-base)
178 if [[ $BUILD_TYPE = live ]]; then 106 if [[ $BUILD_TYPE = live ]]; then
201 RESTRICT+=" mirror" 129 RESTRICT+=" mirror"
202 ;; 130 ;;
203 esac 131 esac
204 KDE_MINIMAL="${SLOT}" 132 KDE_MINIMAL="${SLOT}"
205 _kdedir="${SLOT}" 133 _kdedir="${SLOT}"
206 _pv="-${PV}:${SLOT}"
207 _pvn="-${PV}"
208 134
209 # Block installation of other SLOTS unless kdeprefix 135 # Block installation of other SLOTS unless kdeprefix
210 RDEPEND+=" $(block_other_slots)" 136 RDEPEND+=" $(block_other_slots)"
211 ;; 137 ;;
212 koffice) 138 koffice)
213 SLOT="2" 139 SLOT="2"
214 _pv="-${KDE_MINIMAL}"
215 _pvn="${_pv}"
216 ;; 140 ;;
217 *)
218 _pv="-${KDE_MINIMAL}"
219 _pvn="${_pv}"
220 ;;
221
222esac 141esac
142
143# @ECLASS-VARIABLE: QT_MINIMAL
144# @DESCRIPTION:
145# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1..
146# Currently defaults to 4.5.1 for KDE 4.3 and earlier
147# or 4.6.0_beta for KDE 4.4 and later
148if slot_is_at_least 4.4 "${KDE_MINIMAL}"; then
149 QT_MINIMAL="${QT_MINIMAL:-4.6.0_beta}"
150fi
151
152QT_MINIMAL="${QT_MINIMAL:-4.5.1}"
153
154# OpenGL dependencies
155qtopengldepend="
156 >=x11-libs/qt-opengl-${QT_MINIMAL}:4
157"
158case ${OPENGL_REQUIRED} in
159 always)
160 COMMONDEPEND+=" ${qtopengldepend}"
161 ;;
162 optional)
163 IUSE+=" opengl"
164 COMMONDEPEND+=" opengl? ( ${qtopengldepend} )"
165 ;;
166 *) ;;
167esac
168unset qtopengldepend
169
170# WebKit dependencies
171case ${KDE_REQUIRED} in
172 always)
173 qtwebkitusedeps="[kde]"
174 ;;
175 optional)
176 qtwebkitusedeps="[kde?]"
177 ;;
178 *) ;;
179esac
180qtwebkitdepend="
181 >=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps}
182"
183unset qtwebkitusedeps
184case ${WEBKIT_REQUIRED} in
185 always)
186 COMMONDEPEND+=" ${qtwebkitdepend}"
187 ;;
188 optional)
189 IUSE+=" webkit"
190 COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
191 ;;
192 *) ;;
193esac
194unset qtwebkitdepend
195
196# CppUnit dependencies
197cppuintdepend="
198 dev-util/cppunit
199"
200case ${CPPUNIT_REQUIRED} in
201 always)
202 DEPEND+=" ${cppuintdepend}"
203 ;;
204 optional)
205 IUSE+=" test"
206 DEPEND+=" test? ( ${cppuintdepend} )"
207 ;;
208 *) ;;
209esac
210unset cppuintdepend
223 211
224# KDE dependencies 212# KDE dependencies
225kdecommondepend=" 213kdecommondepend="
226 dev-lang/perl 214 dev-lang/perl
227 >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl] 215 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
228 >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus] 216 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
229 >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility,kde] 217 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
230 >=x11-libs/qt-script-${QT_DEPEND}:4 218 >=x11-libs/qt-script-${QT_MINIMAL}:4
231 >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support] 219 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
232 >=x11-libs/qt-svg-${QT_DEPEND}:4 220 >=x11-libs/qt-svg-${QT_MINIMAL}:4
233 >=x11-libs/qt-test-${QT_DEPEND}:4 221 >=x11-libs/qt-test-${QT_MINIMAL}:4
234 !aqua? ( 222 !aqua? (
235 x11-libs/libXext 223 x11-libs/libXext
236 x11-libs/libXt 224 x11-libs/libXt
237 x11-libs/libXxf86vm 225 x11-libs/libXxf86vm
238 ) 226 )
239" 227"
240if [[ ${PN} != kdelibs ]]; then 228if [[ ${PN} != kdelibs ]]; then
241 if [[ ${KDEBASE} = kde-base ]]; then 229 if [[ ${KDEBASE} = kde-base ]]; then
230 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
242 # libknotificationitem only when SLOT is 4.3 231 # libknotificationitem only when SLOT is 4.3
243 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && local libknotificationitem_required=1 232 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && \
244 kdecommondepend+=" 233 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 234 else
254 kdecommondepend+=" 235 kdecommondepend+="
255 >=kde-base/kdelibs${_pv} 236 >=kde-base/kdelibs-${KDE_MINIMAL}
256 " 237 "
257 fi 238 fi
258fi 239fi
259unset _pv _pvn
260kdedepend=" 240kdedepend="
261 dev-util/pkgconfig 241 dev-util/pkgconfig
262" 242"
263case ${KDE_REQUIRED} in 243case ${KDE_REQUIRED} in
264 always) 244 always)
371 esac 351 esac
372 else 352 else
373 _kmname=${PN} 353 _kmname=${PN}
374 fi 354 fi
375 _kmname_pv="${_kmname}-${PV}" 355 _kmname_pv="${_kmname}-${PV}"
376 if [[ $NEED_KDE != live ]]; then
377 case ${KDEBASE} in 356 case ${KDEBASE} in
378 kde-base) 357 kde-base)
379 case ${PV} in 358 case ${PV} in
380 4.3.85 | 4.3.9[0568]) 359 4.3.85 | 4.3.9[0568])
381 # block for normally packed unstable releases 360 # block for normally packed unstable releases
386 esac 365 esac
387 ;; 366 ;;
388 koffice) 367 koffice)
389 case ${PV} in 368 case ${PV} in
390 2.0.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; 369 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" ;; 370 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
392 esac 371 esac
393 esac 372 esac
394 fi
395 unset _kmname _kmname_pv 373 unset _kmname _kmname_pv
396 fi 374 fi
397 ;; 375 ;;
398esac 376esac
399 377
410# Do the basic kdeprefix KDEDIR settings and determine with which kde should 388# Do the basic kdeprefix KDEDIR settings and determine with which kde should
411# optional applications link 389# optional applications link
412kde4-base_pkg_setup() { 390kde4-base_pkg_setup() {
413 debug-print-function ${FUNCNAME} "$@" 391 debug-print-function ${FUNCNAME} "$@"
414 392
393 # Prefix compat:
394 use prefix || EROOT=${ROOT}
395 # Append missing trailing slash character
396 [[ ${EROOT} = */ ]] || EROOT+="/"
397
415 # QA ebuilds 398 # 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})." 399 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
421 400
422 # Don't set KDEHOME during compilation, it will cause access violations 401 # Don't set KDEHOME during compilation, it will cause access violations
423 unset KDEHOME 402 unset KDEHOME
424 403
458 # Point pkg-config path to KDE *.pc files 437 # Point pkg-config path to KDE *.pc files
459 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" 438 export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
460 # Point to correct QT plugins path 439 # Point to correct QT plugins path
461 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 440 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
462 441
442 # Fix XDG collision with sandbox
443 export XDG_CONFIG_HOME="${T}"
463 # Not needed anymore 444 # Not needed anymore
464 unset _kdedir 445 unset _kdedir
465} 446}
466 447
467# @FUNCTION: kde4-base_src_unpack 448# @FUNCTION: kde4-base_src_unpack

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

  ViewVC Help
Powered by ViewVC 1.1.20