/[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.73 Revision 1.79
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.73 2010/09/13 21:47:37 reavertm Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.79 2010/12/06 10:17:04 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: VIRTUALX_REQUIRED
17# @DESCRIPTION:
18# Do we need an X server? Valid values are "always", "optional", and "manual".
19# "tests" is a synonym for "optional". While virtualx.eclass supports in principle
20# also the use of an X server during other ebuild phases, we only use it in
21# src_test here. Most likely you'll want to set "optional", which introduces the
22# use-flag "test" (if not already present), adds dependencies conditional on that
23# use-flag, and automatically runs (only) the ebuild test phase with a virtual X server
24# present. This makes things a lot more comfortable than the bare virtualx eclass.
25
26# In case the variable is not set in the ebuild, let virtualx eclass not do anything
27: ${VIRTUALX_REQUIRED:=manual}
28
16inherit kde4-functions base eutils 29inherit kde4-functions base virtualx eutils
17 30
18get_build_type 31get_build_type
19if [[ ${BUILD_TYPE} = live ]]; then 32if [[ ${BUILD_TYPE} = live ]]; then
20 if [[ ${KDEBASE} = kdevelop ]]; then 33 if [[ ${KDEBASE} = kdevelop ]]; then
21 inherit git 34 inherit git
111EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm 124EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm
112 125
113unset buildsystem_eclass 126unset buildsystem_eclass
114unset export_fns 127unset export_fns
115 128
129# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
130# @DESCRIPTION:
131# Is qt-declarative required? Possible values are 'always', 'optional' and 'never'.
132# This variable must be set before inheriting any eclasses. Defaults to 'never'.
133DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}"
134
135# @ECLASS-VARIABLE: QTHELP_REQUIRED
136# @DESCRIPTION:
137# Is qt-assistant required? Possible values are 'always', 'optional' and 'never'.
138# This variable must be set before inheriting any eclasses. Defaults to 'never'.
139QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}"
140
116# @ECLASS-VARIABLE: OPENGL_REQUIRED 141# @ECLASS-VARIABLE: OPENGL_REQUIRED
117# @DESCRIPTION: 142# @DESCRIPTION:
118# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'. 143# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
119# This variable must be set before inheriting any eclasses. Defaults to 'never'. 144# This variable must be set before inheriting any eclasses. Defaults to 'never'.
120OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}" 145OPENGL_REQUIRED="${OPENGL_REQUIRED:-never}"
139 164
140# @ECLASS-VARIABLE: KDE_REQUIRED 165# @ECLASS-VARIABLE: KDE_REQUIRED
141# @DESCRIPTION: 166# @DESCRIPTION:
142# Is kde required? Possible values are 'always', 'optional' and 'never'. 167# Is kde required? Possible values are 'always', 'optional' and 'never'.
143# This variable must be set before inheriting any eclasses. Defaults to 'always' 168# 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. 169# 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'. 170# Note that for kde-base packages this variable is fixed to 'always'.
146KDE_REQUIRED="${KDE_REQUIRED:-always}" 171KDE_REQUIRED="${KDE_REQUIRED:-always}"
147 172
148# @ECLASS-VARIABLE: KDE_HANDBOOK 173# @ECLASS-VARIABLE: KDE_HANDBOOK
149# @DESCRIPTION: 174# @DESCRIPTION:
150# Set to enable handbook in application. It adds +handbook to IUSE, handbook dirs 175# Set to enable handbook in application. Possible values are 'always', 'optional'
176# (handbook USE flag) and 'never'.
177# This variable must be set before inheriting any eclasses. Defaults to 'never'.
178# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
151# to KMEXTRA and ensures buildtime and runtime dependencies. 179# ensures buildtime and runtime dependencies.
152[[ -n ${KDE_HANDBOOK} ]] && IUSE+=" +handbook" 180KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
153 181
154# Setup packages inheriting this eclass 182# Setup packages inheriting this eclass
155case ${KDEBASE} in 183case ${KDEBASE} in
156 kde-base) 184 kde-base)
157 HOMEPAGE="http://www.kde.org/" 185 HOMEPAGE="http://www.kde.org/"
187esac 215esac
188 216
189# @ECLASS-VARIABLE: QT_MINIMAL 217# @ECLASS-VARIABLE: QT_MINIMAL
190# @DESCRIPTION: 218# @DESCRIPTION:
191# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1... 219# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1...
192# 4.6.0 for 4.4 and 4.6.3 for 4.5 and later 220# 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later
221if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
222 QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
193if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then 223elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
194 QT_MINIMAL="${QT_MINIMAL:-4.6.3}" 224 QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
195else 225else
196 QT_MINIMAL="${QT_MINIMAL:-4.6.0}" 226 QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
197fi 227fi
228
229# Declarative dependencies
230qtdeclarativedepend="
231 >=x11-libs/qt-declarative-${QT_MINIMAL}:4
232"
233case ${DECLARATIVE_REQUIRED} in
234 always)
235 COMMONDEPEND+=" ${qtdeclarativedepend}"
236 ;;
237 optional)
238 IUSE+=" declarative"
239 COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )"
240 ;;
241 *) ;;
242esac
243unset qtdeclarativedepend
244
245# QtHelp dependencies
246qthelpdepend="
247 >=x11-libs/qt-assistant-${QT_MINIMAL}:4
248"
249case ${QTHELP_REQUIRED} in
250 always)
251 COMMONDEPEND+=" ${qthelpdepend}"
252 ;;
253 optional)
254 IUSE+=" qthelp"
255 COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )"
256 ;;
257esac
258unset qthelpdepend
198 259
199# OpenGL dependencies 260# OpenGL dependencies
200qtopengldepend=" 261qtopengldepend="
201 >=x11-libs/qt-opengl-${QT_MINIMAL}:4 262 >=x11-libs/qt-opengl-${QT_MINIMAL}:4
202" 263"
316 x11-proto/xf86vidmodeproto 377 x11-proto/xf86vidmodeproto
317 ) 378 )
318" 379"
319kderdepend="" 380kderdepend=""
320 381
321# Handbook handling - dependencies 382kdehandbookdepend="
322if [[ -n ${KDE_HANDBOOK} ]]; then
323 kdedepend+="
324 handbook? (
325 app-text/docbook-xml-dtd:4.2 383 app-text/docbook-xml-dtd:4.2
326 app-text/docbook-xsl-stylesheets 384 app-text/docbook-xsl-stylesheets
327 ) 385"
328 " 386kdehandbookrdepend="
387 $(add_kdebase_dep kdelibs 'handbook')
388"
389case ${KDE_HANDBOOK} in
390 always)
391 kdedepend+=" ${kdehandbookdepend}"
392 [[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
393 ;;
394 optional)
395 IUSE+=" +handbook"
396 kdedepend+=" handbook? ( ${kdehandbookdepend} )"
329 [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( $(add_kdebase_dep khelpcenter) )" 397 [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
330fi 398 ;;
399 *) ;;
400esac
401unset kdehandbookdepend kdehandbookrdepend
331 402
332case ${KDE_REQUIRED} in 403case ${KDE_REQUIRED} in
333 always) 404 always)
334 IUSE+=" aqua" 405 IUSE+=" aqua"
335 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}" 406 [[ -n ${kdecommondepend} ]] && COMMONDEPEND+=" ${kdecommondepend}"
439 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then 510 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
440 KMMODULE="${PN}" 511 KMMODULE="${PN}"
441 fi 512 fi
442 case ${KDEBASE} in 513 case ${KDEBASE} in
443 kdevelop) 514 kdevelop)
444 EGIT_REPO_URI="git://gitorious.org/${KMNAME}/${KMMODULE}.git" 515 EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
445 ;; 516 ;;
446 esac 517 esac
447 fi 518 fi
448 ;; 519 ;;
449 *) 520 *)
464 case ${PV} in 535 case ${PV} in
465 4.[456].8[05] | 4.[456].9[023568]) 536 4.[456].8[05] | 4.[456].9[023568])
466 # Unstable KDE SC releases 537 # Unstable KDE SC releases
467 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" 538 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
468 ;; 539 ;;
469 4.4.6) 540 4.4.6 | 4.4.7 | 4.4.8)
470 # Only kdepim here 541 # Only kdepim here
471 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" 542 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
472 ;; 543 ;;
473 *) 544 *)
474 # Stable KDE SC releases 545 # Stable KDE SC releases
640 711
641 # Inject library dependencies 712 # Inject library dependencies
642 if [[ -n ${KMLOADLIBS} ]] ; then 713 if [[ -n ${KMLOADLIBS} ]] ; then
643 load_library_dependencies 714 load_library_dependencies
644 fi 715 fi
716
717 # Replace KDE4Workspace library targets
718 find "${S}" -name CMakeLists.txt \
719 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \
720 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \
721 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \
722 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \
723 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \
724 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \
725 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \
726 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \
727 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \
728 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \
729 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \
730 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \
731 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \
732 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \
733 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \
734 || die 'failed to replace KDE4Workspace library targets'
735
736 # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/...
737 if [[ -z ${KDEBASE} ]]; then
738 find "${S}" -name "*.docbook" \
739 -exec sed -i -r \
740 -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' {} + \
741 || die 'failed to fix DocBook variant version'
742 fi
645} 743}
646 744
647# @FUNCTION: kde4-base_src_configure 745# @FUNCTION: kde4-base_src_configure
648# @DESCRIPTION: 746# @DESCRIPTION:
649# Function for configuring the build of KDE4 applications. 747# Function for configuring the build of KDE4 applications.
732 # Override this value, set in kde4-base_src_configure() 830 # Override this value, set in kde4-base_src_configure()
733 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) 831 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
734 cmake-utils_src_configure 832 cmake-utils_src_configure
735 kde4-base_src_compile 833 kde4-base_src_compile
736 834
835 if [[ ${VIRTUALX_REQUIRED} == always ]] ||
836 ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then
837
838 if [[ ${maketype} ]]; then
839 # surprise- we are already INSIDE virtualmake!!!
840 ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
841 ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround."
842 cmake-utils_src_test
843 else
844 export maketype="cmake-utils_src_test"
845 virtualmake
846 fi
847 else
737 cmake-utils_src_test 848 cmake-utils_src_test
849 fi
738} 850}
739 851
740# @FUNCTION: kde4-base_src_install 852# @FUNCTION: kde4-base_src_install
741# @DESCRIPTION: 853# @DESCRIPTION:
742# Function for installing KDE4 applications. 854# Function for installing KDE4 applications.

Legend:
Removed from v.1.73  
changed lines
  Added in v.1.79

  ViewVC Help
Powered by ViewVC 1.1.20