/[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.45 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.45 2009/09/01 09:32:08 scarabeus 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"
90# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal 96# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal
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.2}" 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
185 IUSE+=" kdeprefix" 113 IUSE+=" kdeprefix"
186 fi 114 fi
187 # Determine SLOT from PVs 115 # Determine SLOT from PVs
188 case ${PV} in 116 case ${PV} in
189 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live 117 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live
190 4.4* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) SLOT="4.4" ;; 118 4.4* | 4.3.[6-9]*) SLOT="4.4" ;;
191 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;; 119 4.3*) SLOT="4.3" ;;
192 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;; 120 4.2*) SLOT="4.2" ;;
193 9999*) SLOT="live" ;; # regular live 121 9999*) SLOT="live" ;; # regular live
194 *) die "Unsupported ${PV}" ;; 122 *) die "Unsupported ${PV}" ;;
195 esac 123 esac
124 # This code is to prevent portage from searching GENTOO_MIRRORS for
125 # packages that will never be mirrored. (As they only will ever be in
126 # the overlay).
127 case ${PV} in
128 *9999* | 4.?.[6-9]?)
129 RESTRICT+=" mirror"
130 ;;
131 esac
196 KDE_MINIMAL="${SLOT}" 132 KDE_MINIMAL="${SLOT}"
197 _kdedir="${SLOT}" 133 _kdedir="${SLOT}"
198 _pv="-${PV}:${SLOT}"
199 _pvn="-${PV}"
200 134
201 # Block installation of other SLOTS unless kdeprefix 135 # Block installation of other SLOTS unless kdeprefix
202 RDEPEND+=" $(block_other_slots)" 136 RDEPEND+=" $(block_other_slots)"
203 ;; 137 ;;
204 koffice) 138 koffice)
205 SLOT="2" 139 SLOT="2"
206 _pv="-${KDE_MINIMAL}"
207 _pvn="${_pv}"
208 ;; 140 ;;
209 *)
210 _pv="-${KDE_MINIMAL}"
211 _pvn="${_pv}"
212 ;;
213
214esac 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
215 211
216# KDE dependencies 212# KDE dependencies
217kdecommondepend=" 213kdecommondepend="
218 dev-lang/perl 214 dev-lang/perl
219 >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl] 215 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
220 >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus] 216 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
221 >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility,kde] 217 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
222 >=x11-libs/qt-script-${QT_DEPEND}:4 218 >=x11-libs/qt-script-${QT_MINIMAL}:4
223 >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support] 219 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
224 >=x11-libs/qt-svg-${QT_DEPEND}:4 220 >=x11-libs/qt-svg-${QT_MINIMAL}:4
225 >=x11-libs/qt-test-${QT_DEPEND}:4 221 >=x11-libs/qt-test-${QT_MINIMAL}:4
226 !aqua? ( 222 !aqua? (
227 x11-libs/libXext 223 x11-libs/libXext
228 x11-libs/libXt 224 x11-libs/libXt
229 x11-libs/libXxf86vm 225 x11-libs/libXxf86vm
230 ) 226 )
231" 227"
232if [[ ${PN} != kdelibs ]]; then 228if [[ ${PN} != kdelibs ]]; then
233 [[ ${PN} != libknotificationitem ]] && slot_is_at_least 4.3 ${KDE_MINIMAL} && local libknotificationitem_required=1
234 if [[ ${KDEBASE} = kde-base ]]; then 229 if [[ ${KDEBASE} = kde-base ]]; then
235 kdecommondepend+=" 230 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
236 kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] ) 231 # libknotificationitem only when SLOT is 4.3
237 !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] ) 232 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && \
238 " 233 kdecommondepend+=" $(add_kdebase_dep libknotificationitem)"
239 [[ -n ${libknotificationitem_required} ]] && \
240 kdecommondepend+="
241 kdeprefix? ( >=kde-base/libknotificationitem${_pv}[kdeprefix] )
242 !kdeprefix? ( >=kde-base/libknotificationitem${_pvn}[-kdeprefix] )
243 "
244 else 234 else
245 kdecommondepend+=" 235 kdecommondepend+="
246 >=kde-base/kdelibs${_pv} 236 >=kde-base/kdelibs-${KDE_MINIMAL}
247 " 237 "
248 [[ -n ${libknotificationitem_required} ]] && \
249 kdecommondepend+="
250 >=kde-base/libknotificationitem${_pv}
251 "
252 fi 238 fi
253fi 239fi
254unset _pv _pvn
255kdedepend=" 240kdedepend="
256 dev-util/pkgconfig 241 dev-util/pkgconfig
257" 242"
258case ${KDE_REQUIRED} in 243case ${KDE_REQUIRED} in
259 always) 244 always)
366 esac 351 esac
367 else 352 else
368 _kmname=${PN} 353 _kmname=${PN}
369 fi 354 fi
370 _kmname_pv="${_kmname}-${PV}" 355 _kmname_pv="${_kmname}-${PV}"
371 if [[ $NEED_KDE != live ]]; then
372 case ${KDEBASE} in 356 case ${KDEBASE} in
373 kde-base) 357 kde-base)
374 case ${PV} in 358 case ${PV} in
375 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96) 359 4.3.85 | 4.3.9[0568])
376 # block for normally packed unstable releases
377 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
378 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*)
379 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;;
380 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98)
381 # block for normally packed unstable releases 360 # block for normally packed unstable releases
382 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 361 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
383 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) 362 4.3.[6-9]*)
384 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;; 363 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;;
385 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*)
386 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
387 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 364 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
388 esac 365 esac
389 ;; 366 ;;
390 koffice) 367 koffice)
391 case ${PV} in 368 case ${PV} in
392 1.9*)
393 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" ;;
394 ;;
395 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; 370 *) SRC_URI="mirror://kde/stable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
396 esac 371 esac
397 ;;
398 esac 372 esac
399 fi
400 unset _kmname _kmname_pv 373 unset _kmname _kmname_pv
401 fi 374 fi
402 ;; 375 ;;
403esac 376esac
404 377
415# 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
416# optional applications link 389# optional applications link
417kde4-base_pkg_setup() { 390kde4-base_pkg_setup() {
418 debug-print-function ${FUNCNAME} "$@" 391 debug-print-function ${FUNCNAME} "$@"
419 392
393 # Prefix compat:
394 use prefix || EROOT=${ROOT}
395 # Append missing trailing slash character
396 [[ ${EROOT} = */ ]] || EROOT+="/"
397
420 # QA ebuilds 398 # QA ebuilds
421 case ${NEED_KDE} in
422 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}\")." ;;
423 *) [[ -n ${NEED_KDE} ]] && ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_MINIMAL instead (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;;
424 esac
425 [[ -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})."
426 400
427 # Don't set KDEHOME during compilation, it will cause access violations 401 # Don't set KDEHOME during compilation, it will cause access violations
428 unset KDEHOME 402 unset KDEHOME
429 403
463 # Point pkg-config path to KDE *.pc files 437 # Point pkg-config path to KDE *.pc files
464 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}}"
465 # Point to correct QT plugins path 439 # Point to correct QT plugins path
466 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" 440 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
467 441
442 # Fix XDG collision with sandbox
443 export XDG_CONFIG_HOME="${T}"
468 # Not needed anymore 444 # Not needed anymore
469 unset _kdedir 445 unset _kdedir
470} 446}
471 447
472# @FUNCTION: kde4-base_src_unpack 448# @FUNCTION: kde4-base_src_unpack
634 fi 610 fi
635 611
636 if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then 612 if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then
637 # work around bug #97196 613 # work around bug #97196
638 dodir /usr/share/doc/KDE4 && \ 614 dodir /usr/share/doc/KDE4 && \
639 mv -f "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \ 615 cp -r "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \
640 die "Failed to move docs to KDE4/." 616 die "Failed to move docs to KDE4/."
617 rm -rf "${D}${EROOT}usr/share/doc/${PF}"
641 fi 618 fi
642} 619}
643 620
644# @FUNCTION: kde4-base_pkg_postinst 621# @FUNCTION: kde4-base_pkg_postinst
645# @DESCRIPTION: 622# @DESCRIPTION:

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

  ViewVC Help
Powered by ViewVC 1.1.20