/[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.67 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.67 2010/08/12 19:32:23 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
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]*) SLOT="4.6" ;; 65 4.6* | 4.5.[6-9][0-9]*) SLOT="4.6" ;;
66 4.5* | 4.4.[6-9]*) SLOT="4.5" ;; 66 4.5* | 4.4.[6-9][0-9]*) SLOT="4.5" ;;
67 4.4* | 4.3.[6-9]*) SLOT="4.4" ;; 67 4.4* | 4.3.[6-9][0-9]*) SLOT="4.4" ;;
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 ;;
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...
270unset cppuintdepend 274unset cppuintdepend
271 275
272# KDE dependencies 276# KDE dependencies
273# Qt accessibility classes are needed in various places, bug 325461 277# Qt accessibility classes are needed in various places, bug 325461
274kdecommondepend=" 278kdecommondepend="
279 dev-lang/perl
275 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl] 280 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
276 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus] 281 >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus]
277 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde] 282 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
278 >=x11-libs/qt-script-${QT_MINIMAL}:4 283 >=x11-libs/qt-script-${QT_MINIMAL}:4
279 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support] 284 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
283 x11-libs/libXext 288 x11-libs/libXext
284 x11-libs/libXt 289 x11-libs/libXt
285 x11-libs/libXxf86vm 290 x11-libs/libXxf86vm
286 ) 291 )
287" 292"
288#perl is not needed on host (+ difficult crosscompilation)
289tc-is-cross-compiler || kdecommondepend+=" dev-lang/perl"
290 293
291if [[ ${PN} != kdelibs ]]; then 294if [[ ${PN} != kdelibs ]]; then
292 if [[ ${KDEBASE} = kde-base ]]; then
293 kdecommondepend+=" $(add_kdebase_dep kdelibs)" 295 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
294 else
295 kdecommondepend+="
296 >=kde-base/kdelibs-${KDE_MINIMAL}
297 "
298 if [[ ${KDEBASE} = kdevelop ]]; then 296 if [[ ${KDEBASE} = kdevelop ]]; then
299 if [[ ${PN} != kdevplatform ]]; then 297 if [[ ${PN} != kdevplatform ]]; then
300 # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED 298 # @ECLASS-VARIABLE: KDEVPLATFORM_REQUIRED
301 # @DESCRIPTION: 299 # @DESCRIPTION:
302 # 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'.
303 # Applies to KDEBASE=kdevelop only. 301 # Applies to KDEBASE=kdevelop only.
304 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}" 302 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
305 case ${KDEVPLATFORM_REQUIRED} in 303 case ${KDEVPLATFORM_REQUIRED} in
306 always) 304 always)
307 kdecommondepend+=" 305 kdecommondepend+="
308 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION} 306 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}
309 " 307 "
310 ;; 308 ;;
311 *) ;; 309 *) ;;
312 esac 310 esac
313 fi
314 fi 311 fi
315 fi 312 fi
316fi 313fi
317kdedepend=" 314kdedepend="
318 dev-util/automoc 315 dev-util/automoc
320 !aqua? ( 317 !aqua? (
321 || ( >=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 )
322 x11-proto/xf86vidmodeproto 319 x11-proto/xf86vidmodeproto
323 ) 320 )
324" 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
325case ${KDE_REQUIRED} in 345case ${KDE_REQUIRED} in
326 always) 346 always)
327 IUSE+=" aqua" 347 IUSE+=" aqua"
328 COMMONDEPEND+=" ${kdecommondepend}" 348 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
329 DEPEND+=" ${kdedepend}" 349 [[ -n ${kdedepend} ]] && DEPEND+=" ${kdedepend}"
350 [[ -n ${kderdepend} ]] && RDEPEND+=" ${kderdepend}"
330 ;; 351 ;;
331 optional) 352 optional)
332 IUSE+=" aqua kde" 353 IUSE+=" aqua kde"
333 COMMONDEPEND+=" kde? ( ${kdecommondepend} )" 354 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" kde? ( ${kdecommondepend} )"
334 DEPEND+=" kde? ( ${kdedepend} )" 355 [[ -n ${kdedepend} ]] && DEPEND+=" kde? ( ${kdedepend} )"
356 [[ -n ${kderdepend} ]] && RDEPEND+=" kde? ( ${kderdepend} )"
335 ;; 357 ;;
336 *) ;; 358 *) ;;
337esac 359esac
338 360
339unset kdecommondepend kdedepend 361unset kdecommondepend kdedepend kderdepend
340 362
341debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}" 363debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: COMMONDEPEND is ${COMMONDEPEND}"
342debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}" 364debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}"
343debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}" 365debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}"
344 366
451 fi 473 fi
452 _kmname_pv="${_kmname}-${PV}" 474 _kmname_pv="${_kmname}-${PV}"
453 case ${KDEBASE} in 475 case ${KDEBASE} in
454 kde-base) 476 kde-base)
455 case ${PV} in 477 case ${PV} in
456 4.[45].8[05] | 4.[45].9[02568]) 478 4.[456].8[05] | 4.[456].9[023568])
457 # Normally packed unstable releases 479 # Unstable KDE SC releases
458 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 480 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
459 4.[45].[6-9]*)
460 # Repacked tarballs: need to depend on xz-utils to ensure that they can be unpacked
461 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/src/${_kmname_pv}.tar.xz"
462 DEPEND+=" app-arch/xz-utils"
463 ;; 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
464 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 488 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2"
489 ;;
465 esac 490 esac
466 ;; 491 ;;
467 koffice) 492 koffice)
468 case ${PV} in 493 case ${PV} in
469 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" ;;
628 653
629 # Inject library dependencies 654 # Inject library dependencies
630 if [[ -n ${KMLOADLIBS} ]] ; then 655 if [[ -n ${KMLOADLIBS} ]] ; then
631 load_library_dependencies 656 load_library_dependencies
632 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'
633} 664}
634 665
635# @FUNCTION: kde4-base_src_configure 666# @FUNCTION: kde4-base_src_configure
636# @DESCRIPTION: 667# @DESCRIPTION:
637# Function for configuring the build of KDE4 applications. 668# Function for configuring the build of KDE4 applications.
643 674
644 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then 675 if has kdeenablefinal ${IUSE//+} && use kdeenablefinal; then
645 cmakeargs+=(-DKDE4_ENABLE_FINAL=ON) 676 cmakeargs+=(-DKDE4_ENABLE_FINAL=ON)
646 fi 677 fi
647 678
648 if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then
649 # Handle debug and release codepaths
650 if has debug ${IUSE//+} && use debug; then 679 if has debug ${IUSE//+} && use debug; then
651 append-cppflags -DDEBUG 680 # Set "real" debug mode
681 CMAKE_BUILD_TYPE="Debugfull"
652 else 682 else
653 append-cppflags -DNDEBUG -DQT_NO_DEBUG -DQT_NO_DEBUG_STREAM 683 # Handle common release builds
654 fi 684 append-cppflags -DQT_NO_DEBUG
655 fi 685 fi
656 686
657 # Set distribution name 687 # Set distribution name
658 [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo) 688 [[ ${PN} = kdelibs ]] && cmakeargs+=(-DKDE_DISTRIBUTION_TEXT=Gentoo)
659 689

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

  ViewVC Help
Powered by ViewVC 1.1.20