diff options
author | Alexey Shvetsov <alexxy@gentoo.org> | 2009-10-06 18:02:12 +0000 |
---|---|---|
committer | Alexey Shvetsov <alexxy@gentoo.org> | 2009-10-06 18:02:12 +0000 |
commit | b60c45421a7bde458711e850ca6df35173f5a7db (patch) | |
tree | e466a326a0940c54819384d010d6ba549bfd7f72 /eclass | |
parent | Removed alternative dependency on Qt metapackage (diff) | |
download | gentoo-2-b60c45421a7bde458711e850ca6df35173f5a7db.tar.gz gentoo-2-b60c45421a7bde458711e850ca6df35173f5a7db.tar.bz2 gentoo-2-b60c45421a7bde458711e850ca6df35173f5a7db.zip |
[eclass] Update kde4 eclasses
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kde4-base.eclass | 44 | ||||
-rw-r--r-- | eclass/kde4-functions.eclass | 196 | ||||
-rw-r--r-- | eclass/kde4-meta.eclass | 34 |
3 files changed, 194 insertions, 80 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index f68b725113f5..a1842dc3baf6 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -1,6 +1,6 @@ # Copyright 2007-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.45 2009/09/01 09:32:08 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.46 2009/10/06 18:02:12 alexxy Exp $ # @ECLASS: kde4-base.eclass # @MAINTAINER: @@ -92,7 +92,7 @@ fi # One may override this variable to raise version requirements. # For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. # Note that it is fixed to ${SLOT} for kde-base packages. -KDE_MINIMAL="${KDE_MINIMAL:-4.2}" +KDE_MINIMAL="${KDE_MINIMAL:-4.3}" # Fallback behaviour (for now) # TODO Remove when tree is clean @@ -187,12 +187,20 @@ case ${KDEBASE} in # Determine SLOT from PVs case ${PV} in *.9999*) SLOT="${PV/.9999*/}" ;; # stable live - 4.4* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) SLOT="4.4" ;; - 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;; - 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;; + 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}" @@ -230,8 +238,9 @@ kdecommondepend=" ) " if [[ ${PN} != kdelibs ]]; then - [[ ${PN} != libknotificationitem ]] && slot_is_at_least 4.3 ${KDE_MINIMAL} && local libknotificationitem_required=1 if [[ ${KDEBASE} = kde-base ]]; then + # 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] ) @@ -245,10 +254,6 @@ if [[ ${PN} != kdelibs ]]; then kdecommondepend+=" >=kde-base/kdelibs${_pv} " - [[ -n ${libknotificationitem_required} ]] && \ - kdecommondepend+=" - >=kde-base/libknotificationitem${_pv} - " fi fi unset _pv _pvn @@ -372,29 +377,19 @@ case ${BUILD_TYPE} in case ${KDEBASE} in kde-base) case ${PV} in - 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96) - # block for normally packed unstable releases - SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; - 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) - SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;; - 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98) + 4.3.85 | 4.3.9[0568]) # block for normally packed unstable releases SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; - 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) + 4.3.[6-9]*) SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;; - 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*) - SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; esac ;; koffice) case ${PV} in - 1.9*) - SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" - ;; + 2.0.[6-9]*) SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; *) SRC_URI="mirror://kde/stable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" ;; esac - ;; esac fi unset _kmname _kmname_pv @@ -636,8 +631,9 @@ kde4-base_src_make_doc() { if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then # work around bug #97196 dodir /usr/share/doc/KDE4 && \ - mv -f "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \ + cp -r "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \ die "Failed to move docs to KDE4/." + rm -rf "${D}${EROOT}usr/share/doc/${PF}" fi } diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index 678e7a70d531..dbac21790fd8 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -1,6 +1,8 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.24 2009/09/01 09:32:08 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.25 2009/10/06 18:02:12 alexxy Exp $ + +inherit versionator # Prefix compat: : ${EROOT:=${ROOT}} @@ -82,26 +84,7 @@ buildsycoca() { eend $? fi - if [[ -z ${EROOT%%/} && -x "${KDEDIR}"/bin/kbuildsycoca4 ]]; then - # Make sure tha cache file exists, writable by root and readable by - # others. Otherwise kbuildsycoca4 will fail. - touch "${KDEDIR}/share/kde4/services/ksycoca4" - chmod 644 "${KDEDIR}/share/kde4/services/ksycoca4" - - # We have to unset DISPLAY and DBUS_SESSION_BUS_ADDRESS, the ones - # in the user's environment (through su [without '-']) may cause - # kbuildsycoca4 to hang. - - ebegin "Running kbuildsycoca4 to build global database" - # This is needed because we support multiple kde versions installed together. - # Lookup in order - local, KDEDIR, /usr, do not duplicate entries btw. - local KDEDIRS="${EROOT}usr/share" - [[ ${KDEDIR} != "${EROOT}usr" ]] && KDEDIRS="${KDEDIR}/share:${KDEDIRS}" - XDG_DATA_DIRS="${EROOT}usr/local/share:${KDEDIRS}" \ - DISPLAY="" DBUS_SESSION_BUS_ADDRESS="" \ - "${KDEDIR}"/bin/kbuildsycoca4 --global --noincremental &> /dev/null - eend $? - fi + # We no longer need to run kbuildsycoca4, as kded does that automatically, as needed # fix permission for some directories for x in share/{config,kde4}; do @@ -372,30 +355,171 @@ load_library_dependencies() { block_other_slots() { debug-print-function ${FUNCNAME} "$@" - local slot - for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do - # Block non kdeprefix ${PN} on other slots - if [[ ${SLOT} != ${slot} ]]; then - echo "!kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )" - fi - done + _do_blocker ${PN} 0:${SLOT} } # @FUNCTION: add_blocker # @DESCRIPTION: # Create correct RDEPEND value for blocking correct package. -# Usefull for file-collision blocks. -# Parameters are package and version to block. -# add_blocker kde-base/kdelibs 4.2.4 +# Useful for file-collision blocks. +# Parameters are package and version(s) to block. +# add_blocker kdelibs 4.2.4 +# If no version is specified, then all versions will be blocked +# If any arguments (from 2 on) contain a ":", then different versions +# are blocked in different slots. (Unlisted slots get the version without +# a ":", if none, then all versions are blocked). The parameter is then of +# the form VERSION:SLOT. Any VERSION of 0 means that no blocker will be +# added for that slot (or, if no slot, then for any unlisted slot). +# A parameter of the form :SLOT means to block all versions from that slot. +# If VERSION begins with "<", then "!<foo" will be used instead of "!<=foo". +# As a special case, if a parameter with slot "3.5" is passed, then that slot +# may also be blocked. +# +# Versions that match "4.x.50" are equivalent to all slots up to (and including) +# "4.x", but nothing following slot "4.x" +# +# As an example, if SLOT=live, then +# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live +# will add the following to RDEPEND: +# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] ) +# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] ) +# !kdeprefix? ( !<=kde-base/kdelibs-9999:live[-kdeprefix] ) +# kdeprefix? ( !<=kde-base/kdelibs-9999:live[kdeprefix] ) add_blocker() { debug-print-function ${FUNCNAME} "$@" - [[ ${1} = "" || ${2} = "" ]] && die "Missing parameter" - local slot + RDEPEND+=" $(_do_blocker "$@")" +} + +# _greater_max_in_slot ver slot +# slot must be 4.x or live +# returns true if ver is >= the maximum possibile version in slot +_greater_max_in_slot() { + local ver=$1 + local slot=$2 + # If slot is live, then return false + # (nothing is greater than the maximum live version) + [[ $slot == live ]] && return 1 + # Otherwise, for slot X.Y, test against X.Y.50 + local test=${slot}.50 + version_compare $1 ${test} + # 1 = '<', 2 = '=', 3 = '>' + [[ $? -ne 1 ]] +} + +# _less_min_in_slot ver slot +# slot must be 4.x or live +# returns true if ver is <= the minimum possibile version in slot +_less_min_in_slot() { + local ver=$1 + local slot=$2 + # If slot == live, then test with "9999_pre", so that 9999 tests false + local test=9999_pre + # If slot == X.Y, then test with X.(Y-1).50 + [[ $slot == live ]] || test=${slot%.*}.$((${slot#*.} - 1)).50 + version_compare $1 ${test} + # 1 = '<', 2 = '=', 3 = '>' + [[ $? -ne 3 ]] +} + +# Internal function used for add_blocker and block_other_slots +# This takes the same parameters as add_blocker, but echos to +# stdout instead of updating a variable. +_do_blocker() { + debug-print-function ${FUNCNAME} "$@" + + [[ -z ${1} ]] && die "Missing parameter" + local pkg=kde-base/$1 + shift + local param slot def="unset" var atom + # The following variables will hold parameters that contain ":" + # - block_3_5 + # - block_4_1 + # - block_4_2 + # - block_4_3 + # - block_4_4 + # - block_live + for slot in 3.5 ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do + local block_${slot//./_}="unset" + done + + # This construct goes through each parameter passed, and sets + # either def or block_* to the version passed + for param; do + # If the parameter does not have a ":" in it... + if [[ ${param/:} == ${param} ]]; then + def=${param} + else # the parameter *does* have a ":" in it + # so everythin after the : is the slot... + slot=${param#*:} + # ...and everything before the : is the version + local block_${slot//./_}=${param%:*} + fi + done + for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do + # ${var} contains the name of the variable we care about for this slot + # ${!var} is it's value + var=block_${slot//./_} + # 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 + atom=${pkg} + # If the version is "0" or less than the minimum possible version in + # this slot, do nothing + elif [[ ${!var} == "0" ]] || _less_min_in_slot ${!var#<} ${slot}; then + continue + # If the version passed begins with a "<", then use "<" instead of "<=" + elif [[ ${!var:0:1} == "<" ]]; then + # this also removes the first character of the version, which is a "<" + atom="<${pkg}-${!var:1}" + else + atom="<=${pkg}-${!var}" + fi # on -kdeprefix we block every slot - RDEPEND+=" !kdeprefix? ( !<=${1}-${2}:${slot}[-kdeprefix] )" + echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix] )" + # on kdeprefix we block only our slot + if [[ ${SLOT} == ${slot} ]]; then + echo " kdeprefix? ( !${atom}:${SLOT}[kdeprefix] )" + fi done - # on kdeprefix we block only our slot - RDEPEND+=" kdeprefix? ( !<=${1}-${2}:${SLOT}[kdeprefix] )" + + # This is a special case block for :3.5; it does not use the + # default version passed, and no blocker is output *unless* a version + # is passed, or ":3.5" is passed to explicitly request a block on all + # 3.5 versions. + if [[ ${block_3_5} != "unset" && ${block_3_5} != "0" ]]; then + if [[ -z ${block_3_5} ]]; then + atom=${pkg} + elif [[ ${block_3_5:0:1} == "<" ]]; then + atom="<${pkg}-${block_3_5:1}" + else + atom="<=${pkg}-${block_3_5}" + fi + echo " !${atom}:3.5" + fi +} + +# @FUNCTION: add_kdebase_dep +# @DESCRIPTION: +# Create proper dependency for kde-base/ dependencies, +# adding SLOT when needed (and *only* when needed). +# This takes 1 or 2 arguments. The first being the package +# 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. +add_kdebase_dep() { + debug-print-function ${FUNCNAME} "$@" + + [[ -z ${1} ]] && die "Missing parameter" + + local use=${2:+,${2}} + + echo "!kdeprefix? ( >=kde-base/${1}-${PV}[-kdeprefix${use}] )" + echo "kdeprefix? ( >=kde-base/${1}-${PV}:${SLOT}[kdeprefix${use}] )" } diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass index 99cec16dcb4c..c9500f64845b 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.25 2009/08/20 09:18:01 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.26 2009/10/06 18:02:12 alexxy Exp $ # # @ECLASS: kde4-meta.eclass # @MAINTAINER: @@ -41,7 +41,9 @@ case ${KMNAME} in case ${PN} in akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) IUSE+=" +kontact" - RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" + if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then + RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" + fi ;; esac ;; @@ -217,12 +219,12 @@ kde4-meta_src_extract() { else local abort tarball tarfile f extractlist moduleprefix postfix case ${PV} in - 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96 | 4.3.98 | 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98) + 4.3.85 | 4.3.9[0568]) # block for normally packed upstream unstable snapshots KMTARPARAMS+=" --bzip2" # bz2 postfix="bz2" ;; - 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) + 4.3.[6-9]*) KMTARPARAMS+=" --lzma" # lzma postfix="lzma" ;; @@ -358,8 +360,10 @@ kde4-meta_create_extractlists() { if has kontact ${IUSE//+} && use kontact; then KMEXTRA+=" kontact/plugins/${PLUGINNAME:-${PN}}/" - KMEXTRACTONLY+=" - kontactinterfaces/" + if ! slot_is_at_least 4.4 ${SLOT} || [[ ${SLOT} == 4.4 && ${PV} < 4.3.68 ]]; then + KMEXTRACTONLY+=" + kontactinterfaces/" + fi fi ;; kdeutils) @@ -392,11 +396,10 @@ kde4-meta_create_extractlists() { # No need for unpack since 4.2.86 # Remove when 4.2 is wiped out from the tree case ${PV} in - 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85) + 4.2.[0-4]) KMCOMPILEONLY+=" cmake/modules/" ;; - *) ;; esac ;; kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) @@ -608,18 +611,9 @@ kde4-meta_change_cmakelists() { sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ "${S}"/cmake/modules/CMakeLists.txt || \ die "${LINENO}: sed died in collision prevention section" - case ${PV} in - 2.0.*) - 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" - ;; - *) - sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ - "${S}"//CMakeLists.txt || \ - die "${LINENO}: sed died in collision prevention section" - ;; - esac + sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ + "${S}"//CMakeLists.txt || \ + die "${LINENO}: sed died in collision prevention section" fi esac |