/[gentoo-x86]/eclass/kde4-functions.eclass
Gentoo

Diff of /eclass/kde4-functions.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.48 Revision 1.51
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2011 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-functions.eclass,v 1.48 2011/05/24 20:54:58 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.51 2011/06/07 20:11:04 abcd Exp $
4 4
5inherit versionator 5inherit versionator
6 6
7# @ECLASS: kde4-functions.eclass 7# @ECLASS: kde4-functions.eclass
8# @MAINTAINER: 8# @MAINTAINER:
54# @DESCRIPTION: 54# @DESCRIPTION:
55# The slots used by KDE live versions. Values should be ordered. 55# The slots used by KDE live versions. Values should be ordered.
56KDE_LIVE_SLOTS=( "live" ) 56KDE_LIVE_SLOTS=( "live" )
57 57
58# determine the build type 58# determine the build type
59if [[ ${SLOT} = live || ${PV} = *9999* ]]; then 59if [[ ${PV} = *9999* ]]; then
60 BUILD_TYPE="live" 60 BUILD_TYPE="live"
61else 61else
62 BUILD_TYPE="release" 62 BUILD_TYPE="release"
63fi 63fi
64export BUILD_TYPE 64export BUILD_TYPE
77 ;; 77 ;;
78 kdebase-apps) 78 kdebase-apps)
79 KDE_SCM="git" 79 KDE_SCM="git"
80 EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps} 80 EGIT_REPONAME=${EGIT_REPONAME:=kde-baseapps}
81 ;; 81 ;;
82 kde-workspace|kde-runtime|kde-baseapps)
83 KDE_SCM="git"
84 ;;
82 esac 85 esac
83fi 86fi
84 87
85# @ECLASS-VARIABLE: KDE_SCM 88# @ECLASS-VARIABLE: KDE_SCM
86# @DESCRIPTION: 89# @DESCRIPTION:
104if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then 107if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
105 for _lingua in ${KDE_LINGUAS}; do 108 for _lingua in ${KDE_LINGUAS}; do
106 IUSE="${IUSE} linguas_${_lingua}" 109 IUSE="${IUSE} linguas_${_lingua}"
107 done 110 done
108fi 111fi
109
110# @FUNCTION: slot_is_at_least
111# @USAGE: <want> <have>
112# @DESCRIPTION:
113# Version aware slot comparator.
114# Current implementation relies on the fact, that slots can be compared like
115# string literals (and let's keep it this way).
116slot_is_at_least() {
117 [[ "${2}" > "${1}" || "${2}" = "${1}" ]]
118}
119 112
120# @FUNCTION: buildsycoca 113# @FUNCTION: buildsycoca
121# @DESCRIPTION: 114# @DESCRIPTION:
122# Function to rebuild the KDE System Configuration Cache. 115# Function to rebuild the KDE System Configuration Cache.
123# All KDE ebuilds should run this in pkg_postinst and pkg_postrm. 116# All KDE ebuilds should run this in pkg_postinst and pkg_postrm.
305 298
306# @FUNCTION: save_library_dependencies 299# @FUNCTION: save_library_dependencies
307# @DESCRIPTION: 300# @DESCRIPTION:
308# Add exporting CMake dependencies for current package 301# Add exporting CMake dependencies for current package
309save_library_dependencies() { 302save_library_dependencies() {
310 local depsfile="${T}/${PN}:${SLOT}" 303 local depsfile="${T}/${PN}"
311 304
312 ebegin "Saving library dependencies in ${depsfile##*/}" 305 ebegin "Saving library dependencies in ${depsfile##*/}"
313 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \ 306 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
314 die "Failed to save the library dependencies." 307 die "Failed to save the library dependencies."
315 eend $? 308 eend $?
317 310
318# @FUNCTION: install_library_dependencies 311# @FUNCTION: install_library_dependencies
319# @DESCRIPTION: 312# @DESCRIPTION:
320# Install generated CMake library dependencies to /var/lib/kde 313# Install generated CMake library dependencies to /var/lib/kde
321install_library_dependencies() { 314install_library_dependencies() {
322 local depsfile="${T}/${PN}:${SLOT}" 315 local depsfile="${T}/${PN}"
323 316
324 ebegin "Installing library dependencies as ${depsfile##*/}" 317 ebegin "Installing library dependencies as ${depsfile##*/}"
325 insinto /var/lib/kde 318 insinto /var/lib/kde
326 doins "${depsfile}" || die "Failed to install library dependencies." 319 doins "${depsfile}" || die "Failed to install library dependencies."
327 eend $? 320 eend $?
335 ebegin "Injecting library dependencies from '${KMLOADLIBS}'" 328 ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
336 329
337 i=0 330 i=0
338 for pn in ${KMLOADLIBS} ; do 331 for pn in ${KMLOADLIBS} ; do
339 ((i++)) 332 ((i++))
340 depsfile="${EPREFIX}/var/lib/kde/${pn}:${SLOT}" 333 depsfile="${EPREFIX}/var/lib/kde/${pn}"
334 [[ -r ${depsfile} ]] || depsfile="${EPREFIX}/var/lib/kde/${pn}:$(get_kde_version)"
341 [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}." 335 [[ -r ${depsfile} ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}."
342 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \ 336 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
343 die "Failed to include library dependencies for ${pn}" 337 die "Failed to include library dependencies for ${pn}"
344 done 338 done
345 eend $? 339 eend $?
346} 340}
347 341
348# @FUNCTION: block_other_slots 342# @FUNCTION: block_other_slots
349# @DESCRIPTION: 343# @DESCRIPTION:
350# Create blocks for the current package in other slots when 344# Create blocks for the current package in other slots
351# installed with USE=-kdeprefix
352block_other_slots() { 345block_other_slots() {
353 debug-print-function ${FUNCNAME} "$@" 346 debug-print-function ${FUNCNAME} "$@"
354 347
355 _do_blocker ${PN} 0:${SLOT} 348 _do_blocker ${PN} 0:${SLOT}
356} 349}
376# "4.x", but nothing following slot "4.x" 369# "4.x", but nothing following slot "4.x"
377# 370#
378# As an example, if SLOT=live, then 371# As an example, if SLOT=live, then
379# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live 372# add_blocker kdelibs 0 :4.3 '<4.3.96:4.4' 9999:live
380# will add the following to RDEPEND: 373# will add the following to RDEPEND:
381# !kdeprefix? ( !kde-base/kdelibs:4.3[-kdeprefix] ) 374# !kde-base/kdelibs:4.3
382# !kdeprefix? ( !<kde-base/kdelibs-4.3.96:4.4[-kdeprefix] ) 375# !<kde-base/kdelibs-4.3.96:4.4
383# !<=kde-base/kdelibs-9999:live 376# !<=kde-base/kdelibs-9999:live
384add_blocker() { 377add_blocker() {
385 debug-print-function ${FUNCNAME} "$@" 378 debug-print-function ${FUNCNAME} "$@"
386 379
387 RDEPEND+=" $(_do_blocker "$@")" 380 RDEPEND+=" $(_do_blocker "$@")"
407 elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then 400 elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
408 ver=${KDE_OVERRIDE_MINIMAL} 401 ver=${KDE_OVERRIDE_MINIMAL}
409 elif [[ ${KDEBASE} != kde-base ]]; then 402 elif [[ ${KDEBASE} != kde-base ]]; then
410 ver=${KDE_MINIMAL} 403 ver=${KDE_MINIMAL}
411 # FIXME remove hack when kdepim-4.4.* is gone 404 # FIXME remove hack when kdepim-4.4.* is gone
412 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${SLOT} == 4.4 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then 405 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && $(get_kde_version) == 4.4 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
413 ver=4.4.5 406 ver=4.4.5
414 # FIXME remove hack when kdepim-4.6beta is gone 407 # FIXME remove hack when kdepim-4.6beta is gone
415 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then 408 elif [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${PV} == 4.5.98 && ${1} =~ ^(kde(pim)?libs|oxygen-icons)$ ]]; then
416 ver=4.5.90 409 ver=4.5.90
417 # if building stable-live version depend just on slot 410 # if building stable-live version depend just on slot
418 # to allow merging packages against more stable basic stuff 411 # to allow merging packages against more stable basic stuff
419 elif [[ ${PV} == *.9999 ]]; then 412 elif [[ ${PV} == *.9999 ]]; then
420 ver=${SLOT} 413 ver=$(get_kde_version)
421 else 414 else
422 ver=${PV} 415 ver=${PV}
423 fi 416 fi
424 417
425 [[ -z ${1} ]] && die "Missing parameter" 418 [[ -z ${1} ]] && die "Missing parameter"
426 419
427 local use=${2:+,${2}} 420 local use=${2:+,${2}}
428 421
429 if [[ ${KDEBASE} = kde-base ]]; then
430 echo " !kdeprefix? ( >=kde-base/${1}-${ver}[aqua=,-kdeprefix${use}] )"
431 # kdeprefix is no-go for kdepim 4.4
432 [[ ( ${KMNAME} == kdepim || ${PN} == kdepim-runtime ) && ${SLOT} == 4.4 ]] || \
433 echo " kdeprefix? ( >=kde-base/${1}-${ver}:${SLOT}[aqua=,kdeprefix${use}] )"
434 elif [[ ${ver} == live ]]; then 422 if [[ ${ver} == live ]]; then
435 echo " kde-base/${1}:live[aqua=${use}]" 423 echo " kde-base/${1}:live[aqua=${use}]"
436 else 424 else
437 echo " >=kde-base/${1}-${ver}[aqua=${use}]" 425 echo " >=kde-base/${1}-${ver}[aqua=${use}]"
438 fi 426 fi
439} 427}
530 # this also removes the first character of the version, which is a "<" 518 # this also removes the first character of the version, which is a "<"
531 atom="<${pkg}-${!var:1}" 519 atom="<${pkg}-${!var:1}"
532 else 520 else
533 atom="<=${pkg}-${!var}" 521 atom="<=${pkg}-${!var}"
534 fi 522 fi
535 # we always block our own slot, ignoring kdeprefix
536 if [[ ${SLOT} == ${slot} ]]; then
537 echo " !${atom}:${slot}${use:+[${use}]}" 523 echo " !${atom}:${slot}${use:+[${use}]}"
538 else
539 # we only block other slots on -kdeprefix
540 echo " !kdeprefix? ( !${atom}:${slot}[-kdeprefix${use:+,${use}}] )"
541 fi
542 done 524 done
543 525
544 # This is a special case block for :3.5; it does not use the 526 # This is a special case block for :3.5; it does not use the
545 # default version passed, and no blocker is output *unless* a version 527 # default version passed, and no blocker is output *unless* a version
546 # is passed, or ":3.5" is passed to explicitly request a block on all 528 # is passed, or ":3.5" is passed to explicitly request a block on all
605 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}" 587 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
606 588
607 popd > /dev/null 589 popd > /dev/null
608} 590}
609 591
610_calculate_kde_slot() { 592# @FUNCTION: get_kde_version
593# Translates an ebuild version into a major.minor KDE SC
594# release version. If no version is specified, ${PV} is used.
595get_kde_version() {
611 local ver=${1:-${PV}} 596 local ver=${1:-${PV}}
612 local major=$(get_major_version ${ver}) 597 local major=$(get_major_version ${ver})
613 local minor=$(get_version_component_range 2 ${ver}) 598 local minor=$(get_version_component_range 2 ${ver})
614 local micro=$(get_version_component_range 3 ${ver}) 599 local micro=$(get_version_component_range 3 ${ver})
615 [[ ${ver} == 9999 ]] && echo live 600 [[ ${ver} == 9999 ]] && echo live

Legend:
Removed from v.1.48  
changed lines
  Added in v.1.51

  ViewVC Help
Powered by ViewVC 1.1.20