/[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.65 Revision 1.76
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.65 2010/06/26 16:02:18 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.76 2010/10/27 21:24:22 dilfridge 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
48fi 48fi
49 49
50# @ECLASS-VARIABLE: KDE_MINIMAL 50# @ECLASS-VARIABLE: KDE_MINIMAL
51# @DESCRIPTION: 51# @DESCRIPTION:
52# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal 52# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal
53# version for apps to work. Currently defaults to 4.3 53# version for apps to work. Currently defaults to 4.4
54# One may override this variable to raise version requirements. 54# One may override this variable to raise version requirements.
55# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. 55# For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables.
56# Note that it is fixed to ${SLOT} for kde-base packages. 56# Note that it is fixed to ${SLOT} for kde-base packages.
57KDE_MINIMAL="${KDE_MINIMAL:-4.3}" 57KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
58 58
59# Set slot for packages in kde-base, koffice and kdevelop 59# Set slot for packages in kde-base, koffice and kdevelop
60case ${KDEBASE} in 60case ${KDEBASE} in
61 kde-base) 61 kde-base)
62 # Determine SLOT from PVs 62 # Determine SLOT from PVs
63 case ${PV} in 63 case ${PV} in
64 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live 64 *.9999*) SLOT="${PV/.9999*/}" ;; # stable live
65 4.6* | 4.5.[6-9][0-9]*) SLOT="4.6" ;;
65 4.5* | 4.4.[6-9]*) SLOT="4.5" ;; 66 4.5* | 4.4.[6-9][0-9]*) SLOT="4.5" ;;
66 4.4* | 4.3.[6-9]*) SLOT="4.4" ;; 67 4.4* | 4.3.[6-9][0-9]*) SLOT="4.4" ;;
67 4.3*) SLOT="4.3" ;;
68 9999*) SLOT="live" ;; # regular live 68 9999*) SLOT="live" ;; # regular live
69 *) die "Unsupported ${PV}" ;; 69 *) die "Unsupported ${PV}" ;;
70 esac 70 esac
71 KDE_MINIMAL="${SLOT}" 71 KDE_MINIMAL="${SLOT}"
72 ;; 72 ;;
102 fi 102 fi
103 SLOT="4" 103 SLOT="4"
104 ;; 104 ;;
105esac 105esac
106 106
107slot_is_at_least 4.5 ${KDE_MINIMAL} && CMAKE_MIN_VERSION="2.6.4" 107slot_is_at_least 4.5 ${KDE_MINIMAL} && CMAKE_MIN_VERSION="2.8.1"
108 108
109inherit ${buildsystem_eclass} 109inherit ${buildsystem_eclass}
110 110
111EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm 111EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm
112 112
113unset buildsystem_eclass 113unset buildsystem_eclass
114unset export_fns 114unset export_fns
115 115
116# @ECLASS-VARIABLE: OPENGL_REQUIRED
117# @DESCRIPTION:
118# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
119# This variable must be set before inheriting any eclasses. Defaults to 'never'.
120OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
121
122# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
123# @DESCRIPTION:
124# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'.
125# This variable must be set before inheriting any eclasses. Defaults to 'never'.
126MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
127
128# @ECLASS-VARIABLE: WEBKIT_REQUIRED
129# @DESCRIPTION:
130# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
131# This variable must be set before inheriting any eclasses. Defaults to 'never'.
132WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
133
134# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
135# @DESCRIPTION:
136# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
137# This variable must be set before inheriting any eclasses. Defaults to 'never'.
138CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
139
140# @ECLASS-VARIABLE: KDE_REQUIRED
141# @DESCRIPTION:
142# Is kde required? Possible values are 'always', 'optional' and 'never'.
143# This variable must be set before inheriting any eclasses. Defaults to 'always'
144# If set to 'always' or 'optional', KDE_MINIMAL may be overriden as well.
145# Note that for kde-base packages this variable is fixed to 'always'.
146KDE_REQUIRED="${KDE_REQUIRED:-always}"
147
148# @ECLASS-VARIABLE: KDE_HANDBOOK
149# @DESCRIPTION:
150# Set to enable handbook in application. Possible values are 'always', 'optional'
151# (handbook USE flag) and 'never'.
152# This variable must be set before inheriting any eclasses. Defaults to 'never'.
153# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
154# ensures buildtime and runtime dependencies.
155KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
156
157# Setup packages inheriting this eclass
116case ${KDEBASE} in 158case ${KDEBASE} in
117 kde-base) 159 kde-base)
118 HOMEPAGE="http://www.kde.org/" 160 HOMEPAGE="http://www.kde.org/"
119 LICENSE="GPL-2" 161 LICENSE="GPL-2"
120 ;;
121 koffice)
122 HOMEPAGE="http://www.koffice.org/"
123 LICENSE="GPL-2"
124 ;;
125 kdevelop)
126 HOMEPAGE="http://www.kdevelop.org/"
127 LICENSE="GPL-2"
128 ;;
129esac
130
131# @ECLASS-VARIABLE: OPENGL_REQUIRED
132# @DESCRIPTION:
133# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
134# This variable must be set before inheriting any eclasses. Defaults to 'never'.
135OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
136
137# @ECLASS-VARIABLE: MULTIMEDIA_REQUIRED
138# @DESCRIPTION:
139# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'.
140# This variable must be set before inheriting any eclasses. Defaults to 'never'.
141MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
142
143# @ECLASS-VARIABLE: WEBKIT_REQUIRED
144# @DESCRIPTION:
145# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
146# This variable must be set before inheriting any eclasses. Defaults to 'never'.
147WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
148
149# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
150# @DESCRIPTION:
151# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
152# This variable must be set before inheriting any eclasses. Defaults to 'never'.
153CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
154
155# @ECLASS-VARIABLE: KDE_REQUIRED
156# @DESCRIPTION:
157# Is kde required? Possible values are 'always', 'optional' and 'never'.
158# This variable must be set before inheriting any eclasses. Defaults to 'always'
159# If set to always or optional, KDE_MINIMAL may be overriden as well.
160# Note that for kde-base packages this variable is fixed to 'always'.
161KDE_REQUIRED="${KDE_REQUIRED:-always}"
162
163# Setup packages inheriting this eclass
164case ${KDEBASE} in
165 kde-base)
166 if [[ $BUILD_TYPE = live ]]; then 162 if [[ $BUILD_TYPE = live ]]; then
167 # Disable tests for live ebuilds 163 # Disable tests for live ebuilds
168 RESTRICT+=" test" 164 RESTRICT+=" test"
169 # Live ebuilds in kde-base default to kdeprefix by default 165 # Live ebuilds in kde-base default to kdeprefix by default
170 IUSE+=" +kdeprefix" 166 IUSE+=" +kdeprefix"
181 ;; 177 ;;
182 esac 178 esac
183 # Block installation of other SLOTS unless kdeprefix 179 # Block installation of other SLOTS unless kdeprefix
184 RDEPEND+=" $(block_other_slots)" 180 RDEPEND+=" $(block_other_slots)"
185 ;; 181 ;;
182 koffice)
183 HOMEPAGE="http://www.koffice.org/"
184 LICENSE="GPL-2"
185 ;;
186 kdevelop)
187 HOMEPAGE="http://www.kdevelop.org/"
188 LICENSE="GPL-2"
189 ;;
186esac 190esac
187 191
188# @ECLASS-VARIABLE: QT_MINIMAL 192# @ECLASS-VARIABLE: QT_MINIMAL
189# @DESCRIPTION: 193# @DESCRIPTION:
190# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1.. 194# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1...
191# Currently defaults to 4.5.1 for KDE 4.3 and earlier 195# 4.6.0 for 4.4 and 4.6.3 for 4.5 and later
192# or 4.6.0 for KDE 4.4 and later
193if slot_is_at_least 4.4 "${KDE_MINIMAL}"; then 196if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
197 QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
198else
194 QT_MINIMAL="${QT_MINIMAL:-4.6.0}" 199 QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
195fi 200fi
196
197QT_MINIMAL="${QT_MINIMAL:-4.5.1}"
198 201
199# OpenGL dependencies 202# OpenGL dependencies
200qtopengldepend=" 203qtopengldepend="
201 >=x11-libs/qt-opengl-${QT_MINIMAL}:4 204 >=x11-libs/qt-opengl-${QT_MINIMAL}:4
202" 205"
271unset cppuintdepend 274unset cppuintdepend
272 275
273# KDE dependencies 276# KDE dependencies
274# Qt accessibility classes are needed in various places, bug 325461 277# Qt accessibility classes are needed in various places, bug 325461
275kdecommondepend=" 278kdecommondepend="
279 dev-lang/perl
276 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl] 280 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
277 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus] 281 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
278 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde] 282 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
279 >=x11-libs/qt-script-${QT_MINIMAL}:4 283 >=x11-libs/qt-script-${QT_MINIMAL}:4
280 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support] 284 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
284 x11-libs/libXext 288 x11-libs/libXext
285 x11-libs/libXt 289 x11-libs/libXt
286 x11-libs/libXxf86vm 290 x11-libs/libXxf86vm
287 ) 291 )
288" 292"
289#perl is not needed on host (+ difficult crosscompilation)
290tc-is-cross-compiler || kdecommondepend="$kdecommondepend dev-lang/perl"
291 293
292if [[ ${PN} != kdelibs ]]; then 294if [[ ${PN} != kdelibs ]]; then
293 if [[ ${KDEBASE} = kde-base ]]; then
294 kdecommondepend+=" $(add_kdebase_dep kdelibs)" 295 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
295 # libknotificationitem only when SLOT is 4.3
296 [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && \
297 kdecommondepend+=" $(add_kdebase_dep libknotificationitem)"
298 else
299 kdecommondepend+="
300 >=kde-base/kdelibs-${KDE_MINIMAL}
301 "
302 if [[ ${KDEBASE} = kdevelop ]]; then 296 if [[ ${KDEBASE} = kdevelop ]]; then
303 if [[ ${PN} != kdevplatform ]]; then 297 if [[ ${PN} != kdevplatform ]]; then
304 # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED 298 # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED
305 # @DESCRIPTION: 299 # @DESCRIPTION:
306 # Specifies whether kdevplatform is required. Possible values are 'always' (default) and 'never'. 300 # Specifies whether kdevplatform is required. Possible values are 'always' (default) and 'never'.
307 # Applies to KDEBASE=kdevelop only. 301 # Applies to KDEBASE=kdevelop only.
308 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}" 302 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
309 case ${KDEVPLATFORM_REQUIRED} in 303 case ${KDEVPLATFORM_REQUIRED} in
310 always) 304 always)
311 kdecommondepend+=" 305 kdecommondepend+="
312 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION} 306 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}
313 " 307 "
314 ;; 308 ;;
315 *) ;; 309 *) ;;
316 esac 310 esac
317 fi
318 fi 311 fi
319 fi 312 fi
320fi 313fi
321kdedepend=" 314kdedepend="
322 dev-util/automoc 315 dev-util/automoc
324 !aqua? ( 317 !aqua? (
325 || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1.0 ) 318 || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1.0 )
326 x11-proto/xf86vidmodeproto 319 x11-proto/xf86vidmodeproto
327 ) 320 )
328" 321"
322kderdepend=""
323
324kdehandbookdepend="
325 app-text/docbook-xml-dtd:4.2
326 app-text/docbook-xsl-stylesheets
327"
328kdehandbookrdepend="
329 $(add_kdebase_dep kdelibs 'handbook')
330"
331case ${KDE_HANDBOOK} in
332 always)
333 kdedepend+=" ${kdehandbookdepend}"
334 [[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
335 ;;
336 optional)
337 IUSE+=" +handbook"
338 kdedepend+=" handbook? ( ${kdehandbookdepend} )"
339 [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
340 ;;
341 *) ;;
342esac
343unset kdehandbookdepend kdehandbookrdepend
344
329case ${KDE_REQUIRED} in 345case ${KDE_REQUIRED} in
330 always) 346 always)
331 IUSE+=" aqua" 347 IUSE+=" aqua"
332 COMMONDEPEND+=" ${kdecommondepend}" 348 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
333 DEPEND+=" ${kdedepend}" 349 [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
350 [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
334 ;; 351 ;;
335 optional) 352 optional)
336 IUSE+=" aqua kde" 353 IUSE+=" aqua kde"
337 COMMONDEPEND+=" kde? ( ${kdecommondepend} )" 354 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
338 DEPEND+=" kde? ( ${kdedepend} )" 355 [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )"
356 [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )"
339 ;; 357 ;;
340 *) ;; 358 *) ;;
341esac 359esac
342 360
343unset kdecommondepend kdedepend 361unset kdecommondepend kdedepend kderdepend
344 362
345debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}" 363debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
346debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}" 364debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
347debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}" 365debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
348 366
455 fi 473 fi
456 _kmname_pv="${_kmname}-${PV}" 474 _kmname_pv="${_kmname}-${PV}"
457 case ${KDEBASE} in 475 case ${KDEBASE} in
458 kde-base) 476 kde-base)
459 case ${PV} in 477 case ${PV} in
460 4.[34].8[05] | 4.[34].9[0568]) 478 4.[456].8[05] | 4.[456].9[023568])
461 # block for normally packed unstable releases 479 # Unstable KDE SC releases
462 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 480 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
463 4.[34].[6-9]*)
464 # Repacked tarballs: need to depend on xz-utils to ensure that they can be unpacked
465 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/src/${_kmname_pv}.tar.xz"
466 DEPEND+=" app-arch/xz-utils"
467 ;; 481 ;;
482 4.4.6 | 4.4.7)
483 # Only kdepim here
484 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
485 ;;
486 *)
487 # Stable KDE SC releases
468 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 488 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
489 ;;
469 esac 490 esac
470 ;; 491 ;;
471 koffice) 492 koffice)
472 case ${PV} in 493 case ${PV} in
473 2.1.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;; 494 2.1.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/${_kmname_pv}.tar.bz2" ;;
622 fi 643 fi
623 fi 644 fi
624 645
625 # Apply patches 646 # Apply patches
626 base_src_prepare 647 base_src_prepare
627 epatch_user
628 648
629 # Save library dependencies 649 # Save library dependencies
630 if [[ -n ${KMSAVELIBS} ]] ; then 650 if [[ -n ${KMSAVELIBS} ]] ; then
631 save_library_dependencies 651 save_library_dependencies
632 fi 652 fi
633 653
634 # Inject library dependencies 654 # Inject library dependencies
635 if [[ -n ${KMLOADLIBS} ]] ; then 655 if [[ -n ${KMLOADLIBS} ]] ; then
636 load_library_dependencies 656 load_library_dependencies
637 fi 657 fi
658
659 # Hack for manuals relying on outdated DTD
660 find "${S}" -name "*.docbook" \
661 -exec sed -i -r \
662 -e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \
663 || die 'failed to fix DocBook variant version'
638} 664}
639 665
640# @FUNCTION: kde4-base_src_configure 666# @FUNCTION: kde4-base_src_configure
641# @DESCRIPTION: 667# @DESCRIPTION:
642# Function for configuring the build of KDE4 applications. 668# Function for configuring the build of KDE4 applications.

Legend:
Removed from v.1.65  
changed lines
  Added in v.1.76

  ViewVC Help
Powered by ViewVC 1.1.20