/[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.30 Revision 1.33
1# Copyright 2007-2009 Gentoo Foundation 1# Copyright 2007-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.30 2009/03/01 11:44:09 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.33 2009/03/26 21:55:09 jmbsvicetto 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
16inherit base cmake-utils eutils multilib kde4-functions 16inherit base cmake-utils eutils kde4-functions
17 17
18get_build_type 18get_build_type
19if [[ ${BUILD_TYPE} = live ]]; then 19if [[ ${BUILD_TYPE} = live ]]; then
20 inherit subversion 20 inherit subversion
21fi 21fi
34 x11-libs/qt-qt3support:4[accessibility] 34 x11-libs/qt-qt3support:4[accessibility]
35 x11-libs/qt-script:4 35 x11-libs/qt-script:4
36 x11-libs/qt-sql:4[qt3support] 36 x11-libs/qt-sql:4[qt3support]
37 x11-libs/qt-svg:4 37 x11-libs/qt-svg:4
38 x11-libs/qt-test:4 38 x11-libs/qt-test:4
39 "
40 qtwebkitdepend="
39 x11-libs/qt-webkit:4" 41 x11-libs/qt-webkit:4
40 qtopengldepend="x11-libs/qt-opengl:4" 42 "
43 qtopengldepend="
44 x11-libs/qt-opengl:4
45 "
41 46
47 case ${WEBKIT_REQUIRED} in
48 always)
49 qtdepend="${qtdepend}
50 ${qtwebkitdepend}"
51 ;;
52 optional)
53 IUSE="${IUSE} webkit"
54 qtdepend="${qtdepend}
55 webkit? ( ${qtwebkitdepend} )
56 "
57 ;;
58 *) WEBKIT_REQUIRED="never" ;;
59 esac
42 # opengl dependencies 60 # opengl dependencies
43 case ${OPENGL_REQUIRED} in 61 case ${OPENGL_REQUIRED} in
44 always) 62 always)
45 qtdepend="${qtdepend} 63 qtdepend="${qtdepend}
46 ${qtopengldepend}" 64 ${qtopengldepend}
65 "
47 ;; 66 ;;
48 optional) 67 optional)
49 IUSE="${IUSE} opengl" 68 IUSE="${IUSE} opengl"
50 qtdepend="${qtdepend} 69 qtdepend="${qtdepend}
51 opengl? ( ${qtopengldepend} )" 70 opengl? ( ${qtopengldepend} )
71 "
52 ;; 72 ;;
53 *)
54 OPENGL_REQUIRED="never" 73 *) OPENGL_REQUIRED="never" ;;
55 ;;
56 esac 74 esac
57 75
58 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}" 76 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}"
59} 77}
78
79if [[ ${NEED_KDE} != "none" ]] ; then
80 # Qt
60kde4-base_set_qt_dependencies 81 kde4-base_set_qt_dependencies
61 82
62# Xorg 83 # X11 libs
63COMMONDEPEND="${COMMONDEPEND} 84 COMMONDEPEND="${COMMONDEPEND}
64 >=x11-base/xorg-server-1.5.2
65"
66
67# X11 libs
68COMMONDEPEND="${COMMONDEPEND}
69 x11-libs/libXext 85 x11-libs/libXext
70 x11-libs/libXt 86 x11-libs/libXt
71 x11-libs/libXxf86vm 87 x11-libs/libXxf86vm
72" 88 "
73 89
74# localization deps 90 # localization deps
75# DISABLED UNTIL PMS decide correct approach :( 91 # DISABLED UNTIL PMS decide correct approach :(
76if [[ -n ${KDE_LINGUAS} ]]; then 92 if [[ -n ${KDE_LINGUAS} ]]; then
77 LNG_DEP="" 93 LNG_DEP=""
78 for _lng in ${KDE_LINGUAS}; do 94 for _lng in ${KDE_LINGUAS}; do
79 # there must be or due to issue if lingua is not present in kde-l10n so 95 # there must be or due to issue if lingua is not present in kde-l10n so
80 # it wont die but pick kde-l10n as-is. 96 # it wont die but pick kde-l10n as-is.
81 LNG_DEP="${LNG_DEP} 97 LNG_DEP="${LNG_DEP}
82 || ( kde-base/kde-l10n[linguas_${_lng},kdeprefix=] kde-base/kde-l10n[kdeprefix=] )" 98 || ( kde-base/kde-l10n[linguas_${_lng},kdeprefix=] kde-base/kde-l10n[kdeprefix=] )"
83 done 99 done
84fi 100 fi
85 101
86# Set common dependencies for all ebuilds that inherit this eclass 102 # Set common dependencies for all ebuilds that inherit this eclass
87DEPEND="${DEPEND} ${COMMONDEPEND} 103 DEPEND="${DEPEND} ${COMMONDEPEND}
88 >=dev-util/cmake-2.6.2 104 >=dev-util/cmake-2.6.2
89 dev-util/pkgconfig 105 dev-util/pkgconfig
90 >=sys-apps/sandbox-1.3.2 106 >=sys-apps/sandbox-1.3.2
91" 107 "
92RDEPEND="${RDEPEND} ${COMMONDEPEND}" 108 RDEPEND="${RDEPEND} ${COMMONDEPEND}"
109fi # NEED_KDE != NONE block
93 110
94if [[ $BUILD_TYPE = live ]]; then 111if [[ $BUILD_TYPE = live ]]; then
95 # Disable tests for live ebuilds 112 # Disable tests for live ebuilds
96 RESTRICT="${RESTRICT} test" 113 RESTRICT="${RESTRICT} test"
97 # Live ebuilds in kde-base default to kdeprefix by default 114 # Live ebuilds in kde-base default to kdeprefix by default
105# @DESCRIPTION: 122# @DESCRIPTION:
106# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. 123# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
107# This variable must be set before inheriting any eclasses. Defaults to 'never'. 124# This variable must be set before inheriting any eclasses. Defaults to 'never'.
108OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" 125OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
109 126
127# @ECLASS-VARIABLE: WEBKIT_REQUIRED
128# @DESCRIPTION:
129# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
130# This variable must be set before inheriting any eclasses. Defaults to 'never'.
131WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
132
110# @ECLASS-VARIABLE: CPPUNIT_REQUIRED 133# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
111# @DESCRIPTION: 134# @DESCRIPTION:
112# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'. 135# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
113# This variable must be set before inheriting any eclasses. Defaults to 'never'. 136# This variable must be set before inheriting any eclasses. Defaults to 'never'.
114CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}" 137CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
115 138
116case ${CPPUNIT_REQUIRED} in 139case ${CPPUNIT_REQUIRED} in
117 always) 140 always)
118 DEPEND="${DEPEND} dev-util/cppunit" 141 DEPEND="${DEPEND}
142 dev-util/cppunit
143 "
119 ;; 144 ;;
120 optional) 145 optional)
121 IUSE="${IUSE} test" 146 IUSE="${IUSE} test"
122 DEPEND="${DEPEND} 147 DEPEND="${DEPEND}
123 test? ( dev-util/cppunit )" 148 test? ( dev-util/cppunit )
149 "
124 ;; 150 ;;
125 *) 151 *)
126 CPPUNIT_REQUIRED="never" 152 CPPUNIT_REQUIRED="never"
127 ;; 153 ;;
128esac 154esac
319 # Block installation of other SLOTS unless kdeprefix 345 # Block installation of other SLOTS unless kdeprefix
320 for KDE_SLOT in ${KDE_SLOTS[@]}; do 346 for KDE_SLOT in ${KDE_SLOTS[@]}; do
321 # block non kdeprefix ${PN} on other slots 347 # block non kdeprefix ${PN} on other slots
322 # we do this only if we do not depend on any version of kde 348 # we do this only if we do not depend on any version of kde
323 if [[ ${SLOT} != ${KDE_SLOT} ]]; then 349 if [[ ${SLOT} != ${KDE_SLOT} ]]; then
324 DEPEND="${DEPEND}
325 !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )"
326 RDEPEND="${RDEPEND} 350 RDEPEND="${RDEPEND}
327 !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )" 351 !kdeprefix? ( !kde-base/${PN}:${KDE_SLOT}[-kdeprefix] )
352 "
328 fi 353 fi
329 done 354 done
330 355
331 # Adding kdelibs, kdepimlibs and kdebase-data deps to all other packages. 356 # Adding kdelibs and kdebase-data deps to all other packages.
332 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
333 if [[ ${PN} != kdelibs ]]; then 357 if [[ ${PN} != kdelibs ]]; then
334 DEPEND="${DEPEND} 358 DEPEND="${DEPEND}
335 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] ) 359 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
336 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )" 360 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )
361 "
337 RDEPEND="${RDEPEND} 362 RDEPEND="${RDEPEND}
338 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] ) 363 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
339 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )" 364 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )
340 if [[ ${PN} != kdepimlibs ]]; then 365 "
341 DEPEND="${DEPEND} 366 if [[ ${PN} != kdepimlibs && ${PN} != kdebase-data ]]; then
342 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
343 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
344 RDEPEND="${RDEPEND} 367 RDEPEND="${RDEPEND}
345 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
346 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
347 if [[ ${PN} != kdebase-data ]]; then
348 RDEPEND="${RDEPEND}
349 kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] ) 368 kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] )
350 !kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )" 369 !kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )
351 fi 370 "
352 fi 371 fi
353 fi 372 fi
354 unset _operator _pv _pvn 373 unset _operator _pv _pvn
355fi 374fi
356 375
410 _kmname_pv="${_kmname}-${PV}" 429 _kmname_pv="${_kmname}-${PV}"
411 if [[ $NEED_KDE != live ]]; then 430 if [[ $NEED_KDE != live ]]; then
412 case ${KDEBASE} in 431 case ${KDEBASE} in
413 kde-base) 432 kde-base)
414 case ${PV} in 433 case ${PV} in
434 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
435 SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;;
415 4.2.6* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*) 436 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*)
416 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 437 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
417 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 438 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
418 esac 439 esac
419 ;; 440 ;;
420 koffice) 441 koffice)
507 # Only enable selected languages, used for KDE extragear apps. 528 # Only enable selected languages, used for KDE extragear apps.
508 if [[ -n ${KDE_LINGUAS} ]]; then 529 if [[ -n ${KDE_LINGUAS} ]]; then
509 enable_selected_linguas 530 enable_selected_linguas
510 fi 531 fi
511 532
512 # Autopatch
513 base_src_prepare 533 base_src_prepare
514 534
515 # Save library dependencies 535 # Save library dependencies
516 if [[ -n ${KMSAVELIBS} ]] ; then 536 if [[ -n ${KMSAVELIBS} ]] ; then
517 save_library_dependencies 537 save_library_dependencies
527# @DESCRIPTION: 547# @DESCRIPTION:
528# Function for configuring the build of KDE4 applications. 548# Function for configuring the build of KDE4 applications.
529kde4-base_src_configure() { 549kde4-base_src_configure() {
530 debug-print-function ${FUNCNAME} "$@" 550 debug-print-function ${FUNCNAME} "$@"
531 551
532 # We prefer KDE's own Debugfull mode over the standard Debug 552 # Handle common release builds
533 if has debug ${IUSE//+} && use debug ; then 553 if ! has debug ${IUSE//+} || ! use debug; then
534 ebegin "Enabling debug flag" 554 append-cppflags -DQT_NO_DEBUG
535 mycmakeargs="${mycmakeargs} -DCMAKE_BUILD_TYPE=Debugfull"
536 eend $?
537 fi 555 fi
538 556
539 # Enable generation of HTML handbook 557 # Enable generation of HTML handbook
540 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then 558 if has htmlhandbook ${IUSE//+} && use htmlhandbook; then
541 ebegin "Enabling building of HTML handbook" 559 ebegin "Enabling building of HTML handbook"
585# @DESCRIPTION: 603# @DESCRIPTION:
586# General function for compiling KDE4 applications. 604# General function for compiling KDE4 applications.
587kde4-base_src_compile() { 605kde4-base_src_compile() {
588 debug-print-function ${FUNCNAME} "$@" 606 debug-print-function ${FUNCNAME} "$@"
589 607
590 kde4-base_src_make 608 cmake-utils_src_compile
591}
592
593# @FUNCTION: kde4-base_src_make
594# @DESCRIPTION:
595# Function for building KDE4 applications.
596# Options are passed to cmake-utils_src_make.
597kde4-base_src_make() {
598 debug-print-function ${FUNCNAME} "$@"
599
600 if [[ -d "$WORKDIR/${PN}_build" ]]; then
601 pushd "${WORKDIR}/${PN}_build" > /dev/null
602 fi
603 [ -e [Mm]akefile ] && cmake-utils_src_make "$@"
604} 609}
605 610
606# @FUNCTION: kde4-base_src_test 611# @FUNCTION: kde4-base_src_test
607# @DESCRIPTION: 612# @DESCRIPTION:
608# Function for testing KDE4 applications. 613# Function for testing KDE4 applications.
626 if [[ -n ${KMSAVELIBS} ]] ; then 631 if [[ -n ${KMSAVELIBS} ]] ; then
627 install_library_dependencies 632 install_library_dependencies
628 fi 633 fi
629 634
630 kde4-base_src_make_doc 635 kde4-base_src_make_doc
631 if [[ -d "$WORKDIR/${PN}_build" ]]; then 636 cmake-utils_src_install
632 pushd "${WORKDIR}/${PN}_build" > /dev/null
633 fi
634 [ -e [Mm]akefile ] && cmake-utils_src_install
635} 637}
636 638
637# @FUNCTION: kde4-base_src_make_doc 639# @FUNCTION: kde4-base_src_make_doc
638# @DESCRIPTION: 640# @DESCRIPTION:
639# Function for installing the documentation of KDE4 applications. 641# Function for installing the documentation of KDE4 applications.

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.33

  ViewVC Help
Powered by ViewVC 1.1.20