diff options
author | Tomas Chvatal <scarabeus@gentoo.org> | 2009-10-27 14:16:49 +0000 |
---|---|---|
committer | Tomas Chvatal <scarabeus@gentoo.org> | 2009-10-27 14:16:49 +0000 |
commit | 5caf61881af3c1e3c96b46f055b5dbcff83639aa (patch) | |
tree | c33f68bc7bf313b1ee3e22ef415a9f51cc6da0c3 /eclass | |
parent | If no -O flag is specified, append-flags -O2 (to gain -fomit-frame-pointer by... (diff) | |
download | historical-5caf61881af3c1e3c96b46f055b5dbcff83639aa.tar.gz historical-5caf61881af3c1e3c96b46f055b5dbcff83639aa.tar.bz2 historical-5caf61881af3c1e3c96b46f055b5dbcff83639aa.zip |
Sync cmake-utils and kde eclasses with kde-testing overlays.
Renamed WANT_CMAKE -> CMAKE_REQUIRED in kde eclasses
fixed koffice2.0 support in kde eclasses
Added WANT_CMAKE into cmake-utils eclass, where it brings possibility to depend on cmake only when some useflag is required.
Used with WANT_CMAKE="variable", where variable is the useflag (its autoadded to IUSE too.)
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/cmake-utils.eclass | 122 | ||||
-rw-r--r-- | eclass/kde4-base.eclass | 195 | ||||
-rw-r--r-- | eclass/kde4-functions.eclass | 20 | ||||
-rw-r--r-- | eclass/kde4-meta.eclass | 75 |
4 files changed, 219 insertions, 193 deletions
diff --git a/eclass/cmake-utils.eclass b/eclass/cmake-utils.eclass index 718ef64375a1..cf017e1aa6af 100644 --- a/eclass/cmake-utils.eclass +++ b/eclass/cmake-utils.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.31 2009/10/16 12:24:09 ssuominen Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-utils.eclass,v 1.32 2009/10/27 14:16:49 scarabeus Exp $ # @ECLASS: cmake-utils.eclass # @MAINTAINER: @@ -20,25 +20,44 @@ # builds and an implementation of the well-known use_enable and use_with # functions for CMake. +# @ECLASS-VARIABLE: WANT_CMAKE +# @DESCRIPTION: +# Specify if cmake-utils eclass should depend on cmake optionaly or not. +# This is usefull when only part of aplication is using cmake build system. +# Valid values are: always [default], optional (where the value is the useflag +# used for optionality) +WANT_CMAKE="${WANT_CMAKE:-always}" +CMAKEDEPEND="" +case ${WANT_CMAKE} in + always) + ;; + *) + IUSE+=" ${WANT_CMAKE}" + CMAKEDEPEND+="${WANT_CMAKE}? ( " + ;; +esac inherit toolchain-funcs multilib flag-o-matic base -EXPF="src_compile src_test src_install" +CMAKE_EXPF="src_compile src_test src_install" case ${EAPI:-0} in - 2) EXPF="${EXPF} src_configure" ;; + 2) CMAKE_EXPF+=" src_configure" ;; 1|0) ;; *) die "Unknown EAPI, Bug eclass maintainers." ;; esac -EXPORT_FUNCTIONS ${EXPF} +EXPORT_FUNCTIONS ${CMAKE_EXPF} : ${DESCRIPTION:="Based on the ${ECLASS} eclass"} if [[ ${PN} != cmake ]]; then - CMAKEDEPEND=">=dev-util/cmake-2.6.2-r1" + CMAKEDEPEND+=">=dev-util/cmake-2.6.2-r1" fi -DEPEND="${CMAKEDEPEND} - userland_GNU? ( >=sys-apps/findutils-4.4.0 ) -" +CMAKEDEPEND+="userland_GNU? ( >=sys-apps/findutils-4.4.0 )" + +[[ ${WANT_CMAKE} = always ]] || CMAKEDEPEND+=" )" + +DEPEND="${CMAKEDEPEND}" +unset CMAKEDEPEND # Internal functions used by cmake-utils_use_* _use_me_now() { @@ -206,11 +225,6 @@ cmake-utils_use_build() { _use_me_now BUILD_ "$@" ; } # and -DHAVE_FOO=OFF if it is disabled. cmake-utils_use_has() { _use_me_now HAVE_ "$@" ; } -# @FUNCTION: cmake-utils_has -# @DESCRIPTION: -# Deprecated, use cmake-utils_use_has, kept now for backcompat. -cmake-utils_has() { ewarn "QA notice: using deprecated ${FUNCNAME} call, use cmake-utils_use_has instead." ; _use_me_now HAVE_ "$@" ; } - # @FUNCTION: cmake-utils_use # @USAGE: <USE flag> [flag name] # @DESCRIPTION: @@ -239,13 +253,11 @@ Build type: ${CMAKE_BUILD_TYPE} Install path: ${CMAKE_INSTALL_PREFIX}\n")' >> CMakeLists.txt } -# @FUNCTION: cmake-utils_src_configure +# @FUNCTION: enable_cmake-utils_src_configure # @DESCRIPTION: # General function for configuring with cmake. Default behaviour is to start an # out-of-source build. -cmake-utils_src_configure() { - export XDG_CONFIG_HOME="${T}" - +enable_cmake-utils_src_configure() { debug-print-function ${FUNCNAME} "$@" _check_build_dir init @@ -261,6 +273,9 @@ cmake-utils_src_configure() { # Remove dangerous things. _modify-cmakelists + # Fix xdg collision with sandbox + export XDG_CONFIG_HOME="${T}" + # @SEE CMAKE_BUILD_TYPE if [[ ${CMAKE_BUILD_TYPE} = Gentoo ]]; then # Handle release builds @@ -306,33 +321,17 @@ _EOF_ popd > /dev/null } -# @FUNCTION: cmake-utils_src_compile +# @FUNCTION: enable_cmake-utils_src_compile # @DESCRIPTION: # General function for compiling with cmake. Default behaviour is to check for # EAPI and respectively to configure as well or just compile. -cmake-utils_src_compile() { +enable_cmake-utils_src_compile() { debug-print-function ${FUNCNAME} "$@" - has src_configure ${EXPF} || cmake-utils_src_configure + has src_configure ${CMAKE_EXPF} || cmake-utils_src_configure cmake-utils_src_make "$@" } -# @FUNCTION: cmake-utils_src_configurein -# @DESCRIPTION: -# Deprecated -cmake-utils_src_configurein() { - ewarn "QA notice: using deprecated ${FUNCNAME} call, set CMAKE_IN_SOURCE_BUILD=1 instead." - cmake-utils_src_configure -} - -# @FUNCTION: cmake-utils_src_configureout -# @DESCRIPTION: -# Deprecated -cmake-utils_src_configureout() { - ewarn "QA notice: using deprecated ${FUNCNAME} call, out of source build is enabled by default." - cmake-utils_src_configure -} - # @FUNCTION: cmake-utils_src_make # @DESCRIPTION: # Function for building the package. Automatically detects the build type. @@ -352,10 +351,10 @@ cmake-utils_src_make() { popd &> /dev/null } -# @FUNCTION: cmake-utils_src_install +# @FUNCTION: enable_cmake-utils_src_install # @DESCRIPTION: # Function for installing the package. Automatically detects the build type. -cmake-utils_src_install() { +enable_cmake-utils_src_install() { debug-print-function ${FUNCNAME} "$@" _check_build_dir @@ -368,10 +367,10 @@ cmake-utils_src_install() { [[ -n "${HTML_DOCS}" ]] && { dohtml -r ${HTML_DOCS} || die "dohtml failed" ; } } -# @FUNCTION: cmake-utils_src_test +# @FUNCTION: enable_cmake-utils_src_test # @DESCRIPTION: # Function for testing the package. Automatically detects the build type. -cmake-utils_src_test() { +enable_cmake-utils_src_test() { debug-print-function ${FUNCNAME} "$@" _check_build_dir @@ -392,3 +391,46 @@ cmake-utils_src_test() { fi popd &> /dev/null } + +## Wrappers for calls bellow this line +# @FUNCTION: cmake-utils_src_configure +# @DESCRIPTION: +# Wrapper for detection if we want to run enable_ prefixed function with same name +# unconditionaly or only when some useflag is enabled. +cmake-utils_src_configure() { + _inherit_optionaly "src_configure" +} + +# @FUNCTION: cmake-utils_src_compile +# @DESCRIPTION: +# Wrapper for detection if we want to run enable_ prefixed function with same name +# unconditionaly or only when some useflag is enabled. +cmake-utils_src_compile() { + _inherit_optionaly "src_compile" +} + +# @FUNCTION: cmake-utils_src_install +# @DESCRIPTION: +# Wrapper for detection if we want to run enable_ prefixed function with same name +# unconditionaly or only when some useflag is enabled. +cmake-utils_src_install() { + _inherit_optionaly "src_install" +} + +# @FUNCTION: cmake-utils_src_test +# @DESCRIPTION: +# Wrapper for detection if we want to run enable_ prefixed function with same name +# unconditionaly or only when some useflag is enabled. +cmake-utils_src_test() { + _inherit_optionaly "src_test" +} + + +_execute_optionaly() { + local phase="$1" + if [[ ${WANT_CMAKE} = always ]]; then + enable_cmake-utils_${phase} + else + use ${WANT_CMAKE} && enable_cmake-utils_${phase} + fi +} diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index a1842dc3baf6..671ab749835c 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -1,6 +1,6 @@ -# Copyright 2007-2009 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.46 2009/10/06 18:02:12 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.47 2009/10/27 14:16:49 scarabeus Exp $ # @ECLASS: kde4-base.eclass # @MAINTAINER: @@ -13,29 +13,33 @@ # NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but # eclass will fail with version older than 2. -# @ECLASS-VARIABLE: WANT_CMAKE +# @ECLASS-VARIABLE: CMAKE_REQUIRED # @DESCRIPTION: -# Specify if cmake-utils eclass is required. Defaults to true. Please note that -# if the variable is set otherwise src_configure/compile/install calls in ebuild -# must be overrided (can't use the eclass ones). -WANT_CMAKE="${WANT_CMAKE:-true}" -if [[ ${WANT_CMAKE} = true ]]; then - exports="src_configure src_compile src_test src_install" - cmake_eclass="cmake-utils" +# Specify if cmake buildsystem is being used. Possible values are 'always' and 'never'. +# Please note that if it's set to 'never' you need to explicitly override following phases: +# src_configure, src_compile, src_test and src_install. +# Defaults to 'always'. +CMAKE_REQUIRED="${CMAKE_REQUIRED:-always}" +if [[ ${WANT_CMAKE} = false || ${WANT_CMAKE} = never ]]; then + buildsystem_eclass="" + export_fns="" else - exports="" - cmake_eclass="" + buildsystem_eclass="cmake-utils" + export_fns="src_configure src_compile src_test src_install" fi -inherit base ${cmake_eclass} eutils kde4-functions - get_build_type if [[ ${BUILD_TYPE} = live ]]; then - inherit subversion + subversion_eclass="subversion" fi +inherit base ${cmake_utils} eutils kde4-functions ${subversion_eclass} + +EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg_postrm -EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${exports} pkg_postinst pkg_postrm +unset buildsystem_eclass +unset export_fns +unset subversion_eclass case ${KDEBASE} in kde-base) @@ -94,29 +98,60 @@ fi # Note that it is fixed to ${SLOT} for kde-base packages. KDE_MINIMAL="${KDE_MINIMAL:-4.3}" -# Fallback behaviour (for now) -# TODO Remove when tree is clean -if [[ -n ${NEED_KDE} ]]; then - case ${NEED_KDE} in - none) - KDE_REQUIRED="never" - ;; - *) - KDE_REQUIRED="always" - KDE_MINIMAL="${NEED_KDE}" - ;; - esac -fi +# Setup packages inheriting this eclass +case ${KDEBASE} in + kde-base) + if [[ $BUILD_TYPE = live ]]; then + # Disable tests for live ebuilds + RESTRICT+=" test" + # Live ebuilds in kde-base default to kdeprefix by default + IUSE+=" +kdeprefix" + else + # All other ebuild types default to -kdeprefix as before + IUSE+=" kdeprefix" + fi + # Determine SLOT from PVs + case ${PV} in + *.9999*) SLOT="${PV/.9999*/}" ;; # stable live + 4.4* | 4.3.[6-9]*) SLOT="4.4" ;; + 4.3*) SLOT="4.3" ;; + 4.2*) SLOT="4.2" ;; + 9999*) SLOT="live" ;; # regular live + *) die "Unsupported ${PV}" ;; + esac + # This code is to prevent portage from searching GENTOO_MIRRORS for + # packages that will never be mirrored. (As they only will ever be in + # the overlay). + case ${PV} in + *9999* | 4.?.[6-9]?) + RESTRICT+=" mirror" + ;; + esac + KDE_MINIMAL="${SLOT}" + _kdedir="${SLOT}" -# @ECLASS-VARIABLE: QT_DEPEND + # Block installation of other SLOTS unless kdeprefix + RDEPEND+=" $(block_other_slots)" + ;; + koffice) + SLOT="2" + ;; +esac + +# @ECLASS-VARIABLE: QT_MINIMAL # @DESCRIPTION: # Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1.. -# Currently defaults to 4.5.1 -QT_DEPEND="${QT_DEPEND:-4.5.1}" +# Currently defaults to 4.5.1 for KDE 4.3 and earlier +# or 4.6.0_beta for KDE 4.4 and later +if slot_is_at_least 4.4 "${KDE_MINIMAL}"; then + QT_MINIMAL="${QT_MINIMAL:-4.6.0_beta}" +fi + +QT_MINIMAL="${QT_MINIMAL:-4.5.1}" # OpenGL dependencies qtopengldepend=" - >=x11-libs/qt-opengl-${QT_DEPEND}:4 + >=x11-libs/qt-opengl-${QT_MINIMAL}:4 " case ${OPENGL_REQUIRED} in always) @@ -141,7 +176,7 @@ case ${KDE_REQUIRED} in *) ;; esac qtwebkitdepend=" - >=x11-libs/qt-webkit-${QT_DEPEND}:4${qtwebkitusedeps} + >=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps} " unset qtwebkitusedeps case ${WEBKIT_REQUIRED} in @@ -172,65 +207,16 @@ case ${CPPUNIT_REQUIRED} in esac unset cppuintdepend -# Setup packages inheriting this eclass -case ${KDEBASE} in - kde-base) - if [[ $BUILD_TYPE = live ]]; then - # Disable tests for live ebuilds - RESTRICT+=" test" - # Live ebuilds in kde-base default to kdeprefix by default - IUSE+=" +kdeprefix" - else - # All other ebuild types default to -kdeprefix as before - IUSE+=" kdeprefix" - fi - # Determine SLOT from PVs - case ${PV} in - *.9999*) SLOT="${PV/.9999*/}" ;; # stable live - 4.4* | 4.3.[6-9]*) SLOT="4.4" ;; - 4.3*) SLOT="4.3" ;; - 4.2*) SLOT="4.2" ;; - 9999*) SLOT="live" ;; # regular live - *) die "Unsupported ${PV}" ;; - esac - # This code is to prevent portage from searching GENTOO_MIRRORS for - # packages that will never be mirrored. (As they only will ever be in - # the overlay). - case ${PV} in - *9999* | 4.?.[6-9]?) - RESTRICT+=" mirror" - ;; - esac - KDE_MINIMAL="${SLOT}" - _kdedir="${SLOT}" - _pv="-${PV}:${SLOT}" - _pvn="-${PV}" - - # Block installation of other SLOTS unless kdeprefix - RDEPEND+=" $(block_other_slots)" - ;; - koffice) - SLOT="2" - _pv="-${KDE_MINIMAL}" - _pvn="${_pv}" - ;; - *) - _pv="-${KDE_MINIMAL}" - _pvn="${_pv}" - ;; - -esac - # KDE dependencies kdecommondepend=" dev-lang/perl - >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl] - >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus] - >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility,kde] - >=x11-libs/qt-script-${QT_DEPEND}:4 - >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support] - >=x11-libs/qt-svg-${QT_DEPEND}:4 - >=x11-libs/qt-test-${QT_DEPEND}:4 + >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl] + >=x11-libs/qt-gui-${QT_MINIMAL}:4[accessibility,dbus] + >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde] + >=x11-libs/qt-script-${QT_MINIMAL}:4 + >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support] + >=x11-libs/qt-svg-${QT_MINIMAL}:4 + >=x11-libs/qt-test-${QT_MINIMAL}:4 !aqua? ( x11-libs/libXext x11-libs/libXt @@ -239,24 +225,16 @@ kdecommondepend=" " if [[ ${PN} != kdelibs ]]; then if [[ ${KDEBASE} = kde-base ]]; then + kdecommondepend+=" $(add_kdebase_dep kdelibs)" # libknotificationitem only when SLOT is 4.3 - [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && local libknotificationitem_required=1 - kdecommondepend+=" - kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] ) - !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] ) - " - [[ -n ${libknotificationitem_required} ]] && \ - kdecommondepend+=" - kdeprefix? ( >=kde-base/libknotificationitem${_pv}[kdeprefix] ) - !kdeprefix? ( >=kde-base/libknotificationitem${_pvn}[-kdeprefix] ) - " + [[ ${PN} != libknotificationitem ]] && [[ ${SLOT} = 4.3 ]] && \ + kdecommondepend+=" $(add_kdebase_dep libknotificationitem)" else kdecommondepend+=" - >=kde-base/kdelibs${_pv} + >=kde-base/kdelibs-${KDE_MINIMAL} " fi fi -unset _pv _pvn kdedepend=" dev-util/pkgconfig " @@ -373,7 +351,6 @@ case ${BUILD_TYPE} in _kmname=${PN} fi _kmname_pv="${_kmname}-${PV}" - if [[ $NEED_KDE != live ]]; then case ${KDEBASE} in kde-base) case ${PV} in @@ -391,7 +368,6 @@ case ${BUILD_TYPE} in *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; esac esac - fi unset _kmname _kmname_pv fi ;; @@ -412,11 +388,12 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" kde4-base_pkg_setup() { debug-print-function ${FUNCNAME} "$@" + # Prefix compat: + use prefix || EROOT=${ROOT} + # Append missing trailing slash character + [[ ${EROOT} = */ ]] || EROOT+="/" + # QA ebuilds - case ${NEED_KDE} in - none) ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_REQUIRED=\"never\" or KDE_REQUIRED=\"optional\" instead. You may want to override KDE_MINIMAL as well (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;; - *) [[ -n ${NEED_KDE} ]] && ewarn "QA Notice: using deprecated NEED_KDE variable, use KDE_MINIMAL instead (default is KDE_MINIMAL=\"${KDE_MINIMAL}\")." ;; - esac [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." # Don't set KDEHOME during compilation, it will cause access violations @@ -460,6 +437,8 @@ kde4-base_pkg_setup() { # Point to correct QT plugins path QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" + # Fix XDG collision with sandbox + export XDG_CONFIG_HOME="${T}" # Not needed anymore unset _kdedir } diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index dbac21790fd8..acafcec6a96c 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -1,14 +1,9 @@ -# Copyright 1999-2008 Gentoo Foundation +# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.25 2009/10/06 18:02:12 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.26 2009/10/27 14:16:49 scarabeus Exp $ inherit versionator -# Prefix compat: -: ${EROOT:=${ROOT}} -# Append missing trailing slash character -[[ ${EROOT} = */ ]] || EROOT+="/" - # @ECLASS: kde4-functions.eclass # @MAINTAINER: # kde@gentoo.org @@ -450,7 +445,7 @@ _do_blocker() { if [[ ${param/:} == ${param} ]]; then def=${param} else # the parameter *does* have a ":" in it - # so everythin after the : is the slot... + # so everything after the : is the slot... slot=${param#*:} # ...and everything before the : is the version local block_${slot//./_}=${param%:*} @@ -464,10 +459,9 @@ _do_blocker() { # if we didn't pass *:${slot}, then use the unsloted value [[ ${!var} == "unset" ]] && var=def - # If the no version was passed, or the version is greater than the - # maximum possible version in this slot, block all versions in this - # slot - if [[ ${!var} == "unset" ]] || _greater_max_in_slot ${!var#<} ${slot}; then + # If no version was passed, or the version is greater than the maximum + # possible version in this slot, block all versions in this slot + if [[ ${!var} == "unset" ]] || [[ -z ${!var} ]] || _greater_max_in_slot ${!var#<} ${slot}; then atom=${pkg} # If the version is "0" or less than the minimum possible version in # this slot, do nothing @@ -512,7 +506,7 @@ _do_blocker() { # name, the optional second, is additional USE flags to append. # The output of this should be added directly to DEPEND/RDEPEND, and # may be wrapped in a USE conditional (but not an || conditional -# without an extra set of parentheses. +# without an extra set of parentheses). add_kdebase_dep() { debug-print-function ${FUNCNAME} "$@" diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass index c9500f64845b..feb9249f55ce 100644 --- a/eclass/kde4-meta.eclass +++ b/eclass/kde4-meta.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.26 2009/10/06 18:02:12 alexxy Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.27 2009/10/27 14:16:49 scarabeus Exp $ # # @ECLASS: kde4-meta.eclass # @MAINTAINER: @@ -22,7 +22,7 @@ fi # Add khelpcenter dependency when installing handbooks if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then - RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" + RDEPEND+=" handbook? ( $(add_kdebase_dep khelpcenter) )" fi # Add dependencies that all packages in a certain module share. @@ -30,26 +30,23 @@ case ${KMNAME} in kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" ;; - kdenetwork) - COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]" - ;; kdepim|kdepim-runtime) COMMONDEPEND+=" dev-libs/boost - >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] + $(add_kdebase_dep kdepimlibs) " case ${PN} in akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) IUSE+=" +kontact" if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then - RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" + RDEPEND+=" kontact? ( $(add_kdebase_dep kontactinterfaces) )" fi ;; esac ;; kdegames) if [[ ${PN} != libkdegames ]]; then - COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " + COMMONDEPEND+=" $(add_kdebase_dep libkdegames)" fi ;; koffice) @@ -508,16 +505,17 @@ kde4-meta_change_cmakelists() { comment_all_add_subdirectory ./ # Restore "add_subdirectory( cmake )" in ${S}/CMakeLists.txt - if [[ -f "${S}"/CMakeLists.txt ]]; then + if [[ -f CMakeLists.txt ]]; then sed -e '/add_subdirectory[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ -e '/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*cmake[[:space:]]*)/s/^#DONOTCOMPILE //' \ - -i "${S}"/CMakeLists.txt || die "${LINENO}: cmake sed died" + -i CMakeLists.txt || die "${LINENO}: cmake sed died" fi if [[ -z ${KMNOMODULE} ]]; then # Restore "add_subdirectory" in $KMMODULE subdirectories - find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ - die "${LINENO}: died in KMMODULE section" + find "${S}"/${KMMODULE} -name CMakeLists.txt -print0 | \ + xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ + die "${LINENO}: died in KMMODULE section" _change_cmakelists_parent_dirs ${KMMODULE} fi @@ -525,8 +523,9 @@ kde4-meta_change_cmakelists() { # KMEXTRACTONLY section - Some ebuilds need to comment out some subdirs in KMMODULE and they use KMEXTRACTONLY for i in ${KMEXTRACTONLY}; do - if [[ -d "${S}"/${i} && -f "${S}"/${i}/../CMakeLists.txt ]]; then - sed -i -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" "${S}"/${i}/../CMakeLists.txt || \ + if [[ -d ${i} && -f ${i}/../CMakeLists.txt ]]; then + sed -e "/([[:space:]]*$(basename $i)[[:space:]]*)/s/^/#DONOTCOMPILE /" \ + -i ${i}/../CMakeLists.txt || \ die "${LINENO}: sed died while working in the KMEXTRACTONLY section while processing ${i}" fi done @@ -558,7 +557,7 @@ kde4-meta_change_cmakelists() { if [[ -d "${S}"/${i} ]]; then find "${S}"/${i} -name CMakeLists.txt -print0 | \ xargs -0 sed -i -e 's/^#DONOTCOMPILE //g' || \ - die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" + die "${LINENO}: sed died uncommenting add_subdirectory instructions in KMEXTRA section while processing ${i}" _change_cmakelists_parent_dirs ${i} fi done @@ -568,31 +567,36 @@ kde4-meta_change_cmakelists() { # COLLISION PROTECT section # Install the startkde script just once, as a part of kde-base/kdebase-startkde, # not as a part of every package. - if [[ ${PN} != kdebase-startkde && -f "${S}"/CMakeLists.txt ]]; then + if [[ ${PN} != kdebase-startkde && -f CMakeLists.txt ]]; then # The startkde script moved to kdebase-workspace for KDE4 versions > 3.93.0. - sed -i -e '/startkde/s/^/#DONOTINSTALL /' "${S}"/CMakeLists.txt || \ - die "${LINENO}: sed died in the kdebase-startkde collision prevention section" + sed -e '/startkde/s/^/#DONOTINSTALL /' \ + -i CMakeLists.txt || die "${LINENO}: sed died in the kdebase-startkde collision prevention section" fi # Strip EXPORT feature section from workspace for KDE4 versions > 4.1.82 if [[ ${PN} != libkworkspace ]]; then - sed -i \ - -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ - CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" + sed -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ + -i CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" fi ;; kdebase-runtime) # COLLISION PROTECT section # Only install the kde4 script as part of kde-base/kdebase-data - if [[ ${PN} != kdebase-data && -f "${S}"/CMakeLists.txt ]]; then - sed -i -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ - "${S}"/CMakeLists.txt || die "Sed to exclude bin/kde4 failed" + if [[ ${PN} != kdebase-data && -f CMakeLists.txt ]]; then + sed -e '/^install(PROGRAMS[[:space:]]*[^[:space:]]*\/kde4[[:space:]]/s/^/#DONOTINSTALL /' \ + -i CMakeLists.txt || die "Sed to exclude bin/kde4 failed" fi ;; + kdenetwork) + # Disable hardcoded kdepimlibs check + sed -e 's/find_package(KdepimLibs REQUIRED)/macro_optional_find_package(KdepimLibs)/' \ + -i CMakeLists.txt || die "failed to disable hardcoded checks" + ;; kdepim) case ${PN} in kaddressbook|kalarm|kmailcvt|kontact|korganizer|korn) - sed -i -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ - -e '/add_custom_target(kmail_xml /,/)/p' "${S}"/kmail/CMakeLists.txt || die "uncommenting xml failed" + sed -n -e '/qt4_generate_dbus_interface(.*org\.kde\.kmail\.\(kmail\|mailcomposer\)\.xml/p' \ + -e '/add_custom_target(kmail_xml /,/)/p' \ + -i kmail/CMakeLists.txt || die "uncommenting xml failed" _change_cmakelists_parent_dirs kmail ;; esac @@ -608,13 +612,20 @@ kde4-meta_change_cmakelists() { koffice) # prevent collisions if [[ ${PN} != koffice-data ]]; then - sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ - "${S}"/cmake/modules/CMakeLists.txt || \ - die "${LINENO}: sed died in collision prevention section" - sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ - "${S}"//CMakeLists.txt || \ - die "${LINENO}: sed died in collision prevention section" + sed -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ + -i cmake/modules/CMakeLists.txt || die "${LINENO}: sed died in collision prevention section" + sed -e '/install(.\+config-openexr\.h.\+)/d' \ + -i CMakeLists.txt || die "${LINENO}: sed died in collision prevention section" fi + # koffice 2.0 + case ${PV} in + 2.0.[1-9]) + sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ + "${S}"/CMakeLists.txt || \ + die "${LINENO}: sed died in collision prevention section" + ;; + *) ;; + esac esac popd > /dev/null |