/[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.50 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.50 2011/06/06 21:38:18 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
108 for _lingua in ${KDE_LINGUAS}; do 108 for _lingua in ${KDE_LINGUAS}; do
109 IUSE="${IUSE} linguas_${_lingua}" 109 IUSE="${IUSE} linguas_${_lingua}"
110 done 110 done
111fi 111fi
112 112
113# @FUNCTION: slot_is_at_least
114# @USAGE: <want> <have>
115# @DESCRIPTION:
116# Version aware slot comparator.
117# Current implementation relies on the fact, that slots can be compared like
118# string literals (and let's keep it this way).
119slot_is_at_least() {
120 [[ "${2}" > "${1}" || "${2}" = "${1}" ]]
121}
122
123# @FUNCTION: buildsycoca 113# @FUNCTION: buildsycoca
124# @DESCRIPTION: 114# @DESCRIPTION:
125# Function to rebuild the KDE System Configuration Cache. 115# Function to rebuild the KDE System Configuration Cache.
126# 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.
127buildsycoca() { 117buildsycoca() {
308 298
309# @FUNCTION: save_library_dependencies 299# @FUNCTION: save_library_dependencies
310# @DESCRIPTION: 300# @DESCRIPTION:
311# Add exporting CMake dependencies for current package 301# Add exporting CMake dependencies for current package
312save_library_dependencies() { 302save_library_dependencies() {
313 local depsfile="${T}/${PN}:${SLOT}" 303 local depsfile="${T}/${PN}"
314 304
315 ebegin "Saving library dependencies in ${depsfile##*/}" 305 ebegin "Saving library dependencies in ${depsfile##*/}"
316 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \ 306 echo "EXPORT_LIBRARY_DEPENDENCIES(\"${depsfile}\")" >> "${S}/CMakeLists.txt" || \
317 die "Failed to save the library dependencies." 307 die "Failed to save the library dependencies."
318 eend $? 308 eend $?
320 310
321# @FUNCTION: install_library_dependencies 311# @FUNCTION: install_library_dependencies
322# @DESCRIPTION: 312# @DESCRIPTION:
323# Install generated CMake library dependencies to /var/lib/kde 313# Install generated CMake library dependencies to /var/lib/kde
324install_library_dependencies() { 314install_library_dependencies() {
325 local depsfile="${T}/${PN}:${SLOT}" 315 local depsfile="${T}/${PN}"
326 316
327 ebegin "Installing library dependencies as ${depsfile##*/}" 317 ebegin "Installing library dependencies as ${depsfile##*/}"
328 insinto /var/lib/kde 318 insinto /var/lib/kde
329 doins "${depsfile}" || die "Failed to install library dependencies." 319 doins "${depsfile}" || die "Failed to install library dependencies."
330 eend $? 320 eend $?
338 ebegin "Injecting library dependencies from '${KMLOADLIBS}'" 328 ebegin "Injecting library dependencies from '${KMLOADLIBS}'"
339 329
340 i=0 330 i=0
341 for pn in ${KMLOADLIBS} ; do 331 for pn in ${KMLOADLIBS} ; do
342 ((i++)) 332 ((i++))
343 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)"
344 [[ -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}."
345 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \ 336 sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \
346 die "Failed to include library dependencies for ${pn}" 337 die "Failed to include library dependencies for ${pn}"
347 done 338 done
348 eend $? 339 eend $?
409 elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then 400 elif [[ -n ${KDE_OVERRIDE_MINIMAL} ]]; then
410 ver=${KDE_OVERRIDE_MINIMAL} 401 ver=${KDE_OVERRIDE_MINIMAL}
411 elif [[ ${KDEBASE} != kde-base ]]; then 402 elif [[ ${KDEBASE} != kde-base ]]; then
412 ver=${KDE_MINIMAL} 403 ver=${KDE_MINIMAL}
413 # FIXME remove hack when kdepim-4.4.* is gone 404 # FIXME remove hack when kdepim-4.4.* is gone
414 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
415 ver=4.4.5 406 ver=4.4.5
416 # FIXME remove hack when kdepim-4.6beta is gone 407 # FIXME remove hack when kdepim-4.6beta is gone
417 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
418 ver=4.5.90 409 ver=4.5.90
419 # if building stable-live version depend just on slot 410 # if building stable-live version depend just on slot
420 # to allow merging packages against more stable basic stuff 411 # to allow merging packages against more stable basic stuff
421 elif [[ ${PV} == *.9999 ]]; then 412 elif [[ ${PV} == *.9999 ]]; then
422 ver=${SLOT} 413 ver=$(get_kde_version)
423 else 414 else
424 ver=${PV} 415 ver=${PV}
425 fi 416 fi
426 417
427 [[ -z ${1} ]] && die "Missing parameter" 418 [[ -z ${1} ]] && die "Missing parameter"
596 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}" 587 [[ -n ${linguas} ]] && echo ">>> Enabling languages: ${linguas}"
597 588
598 popd > /dev/null 589 popd > /dev/null
599} 590}
600 591
601_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() {
602 local ver=${1:-${PV}} 596 local ver=${1:-${PV}}
603 local major=$(get_major_version ${ver}) 597 local major=$(get_major_version ${ver})
604 local minor=$(get_version_component_range 2 ${ver}) 598 local minor=$(get_version_component_range 2 ${ver})
605 local micro=$(get_version_component_range 3 ${ver}) 599 local micro=$(get_version_component_range 3 ${ver})
606 [[ ${ver} == 9999 ]] && echo live 600 [[ ${ver} == 9999 ]] && echo live

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

  ViewVC Help
Powered by ViewVC 1.1.20