/[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.76 Revision 1.84
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.76 2010/10/27 21:24:22 dilfridge Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.84 2011/01/28 05:05:13 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}"
190esac 215esac
191 216
192# @ECLASS-VARIABLE: QT_MINIMAL 217# @ECLASS-VARIABLE: QT_MINIMAL
193# @DESCRIPTION: 218# @DESCRIPTION:
194# 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...
195# 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}"
196if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then 223elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
197 QT_MINIMAL="${QT_MINIMAL:-4.6.3}" 224 QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
198else 225else
199 QT_MINIMAL="${QT_MINIMAL:-4.6.0}" 226 QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
200fi 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
201 259
202# OpenGL dependencies 260# OpenGL dependencies
203qtopengldepend=" 261qtopengldepend="
204 >=x11-libs/qt-opengl-${QT_MINIMAL}:4 262 >=x11-libs/qt-opengl-${QT_MINIMAL}:4
205" 263"
313fi 371fi
314kdedepend=" 372kdedepend="
315 dev-util/automoc 373 dev-util/automoc
316 dev-util/pkgconfig 374 dev-util/pkgconfig
317 !aqua? ( 375 !aqua? (
318 || ( >=x11-libs/libXtst-1.1.0 <x11-proto/xextproto-7.1.0 ) 376 >=x11-libs/libXtst-1.1.0
319 x11-proto/xf86vidmodeproto 377 x11-proto/xf86vidmodeproto
320 ) 378 )
321" 379"
322kderdepend="" 380kderdepend=""
381
382if [[ ${PN} != oxygen-icons ]]; then
383 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
384fi
323 385
324kdehandbookdepend=" 386kdehandbookdepend="
325 app-text/docbook-xml-dtd:4.2 387 app-text/docbook-xml-dtd:4.2
326 app-text/docbook-xsl-stylesheets 388 app-text/docbook-xsl-stylesheets
327" 389"
452 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then 514 if [[ -z ${KMNOMODULE} ]] && [[ -z ${KMMODULE} ]]; then
453 KMMODULE="${PN}" 515 KMMODULE="${PN}"
454 fi 516 fi
455 case ${KDEBASE} in 517 case ${KDEBASE} in
456 kdevelop) 518 kdevelop)
457 EGIT_REPO_URI="git://gitorious.org/${KMNAME}/${KMMODULE}.git" 519 EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
458 ;; 520 ;;
459 esac 521 esac
460 fi 522 fi
461 ;; 523 ;;
462 *) 524 *)
473 fi 535 fi
474 _kmname_pv="${_kmname}-${PV}" 536 _kmname_pv="${_kmname}-${PV}"
475 case ${KDEBASE} in 537 case ${KDEBASE} in
476 kde-base) 538 kde-base)
477 case ${PV} in 539 case ${PV} in
540 4.5.93)
541 # Only kdepim and kdepim-runtime 4.6beta here
542 SRC_URI="mirror://kde/unstable/kdepim/${PV}/${_kmname}-4.6beta3.tar.bz2"
543 ;;
478 4.[456].8[05] | 4.[456].9[023568]) 544 4.[456].8[05] | 4.[456].9[023568])
479 # Unstable KDE SC releases 545 # Unstable KDE SC releases
480 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" 546 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
481 ;; 547 ;;
482 4.4.6 | 4.4.7) 548 4.4.6 | 4.4.7 | 4.4.8 | 4.4.9 | 4.4.10)
483 # Only kdepim here 549 # Only kdepim here
484 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" 550 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
485 ;; 551 ;;
486 *) 552 *)
487 # Stable KDE SC releases 553 # Stable KDE SC releases
654 # Inject library dependencies 720 # Inject library dependencies
655 if [[ -n ${KMLOADLIBS} ]] ; then 721 if [[ -n ${KMLOADLIBS} ]] ; then
656 load_library_dependencies 722 load_library_dependencies
657 fi 723 fi
658 724
659 # Hack for manuals relying on outdated DTD 725 # Replace KDE4Workspace library targets
726 find "${S}" -name CMakeLists.txt \
727 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \
728 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \
729 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \
730 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \
731 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \
732 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \
733 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \
734 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \
735 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \
736 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \
737 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \
738 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \
739 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \
740 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \
741 -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \
742 || die 'failed to replace KDE4Workspace library targets'
743
744 # Hack for manuals relying on outdated DTD, only outside kde-base/koffice/...
745 if [[ -z ${KDEBASE} ]]; then
660 find "${S}" -name "*.docbook" \ 746 find "${S}" -name "*.docbook" \
661 -exec sed -i -r \ 747 -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' {} + \ 748 -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' 749 || die 'failed to fix DocBook variant version'
750 fi
664} 751}
665 752
666# @FUNCTION: kde4-base_src_configure 753# @FUNCTION: kde4-base_src_configure
667# @DESCRIPTION: 754# @DESCRIPTION:
668# Function for configuring the build of KDE4 applications. 755# Function for configuring the build of KDE4 applications.
751 # Override this value, set in kde4-base_src_configure() 838 # Override this value, set in kde4-base_src_configure()
752 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON) 839 mycmakeargs+=(-DKDE4_BUILD_TESTS=ON)
753 cmake-utils_src_configure 840 cmake-utils_src_configure
754 kde4-base_src_compile 841 kde4-base_src_compile
755 842
843 if [[ ${VIRTUALX_REQUIRED} == always ]] ||
844 ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then
845
846 if [[ ${maketype} ]]; then
847 # surprise- we are already INSIDE virtualmake!!!
848 ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
849 ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround."
850 cmake-utils_src_test
851 else
852 export maketype="cmake-utils_src_test"
853 virtualmake
854 fi
855 else
756 cmake-utils_src_test 856 cmake-utils_src_test
857 fi
757} 858}
758 859
759# @FUNCTION: kde4-base_src_install 860# @FUNCTION: kde4-base_src_install
760# @DESCRIPTION: 861# @DESCRIPTION:
761# Function for installing KDE4 applications. 862# Function for installing KDE4 applications.

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

  ViewVC Help
Powered by ViewVC 1.1.20