/[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.7 Revision 1.8
1# Copyright 2007-2008 Gentoo Foundation 1# Copyright 2007-2008 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.7 2008/04/03 18:12:48 philantrop Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.8 2008/04/04 22:15:24 zlin 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.0 ebuilds 8# @BLURB: This eclass provides functions for kde 4.0 ebuilds
348# Apply ${PN}-${SLOT}-*{diff,patch} 348# Apply ${PN}-${SLOT}-*{diff,patch}
349# - $CATEGORY!=kde-base: 349# - $CATEGORY!=kde-base:
350# Apply ${PN}-${PV}-*{diff,patch} 350# Apply ${PN}-${PV}-*{diff,patch}
351# @CODE 351# @CODE
352# 352#
353# If ${PATCHES} is non-zero all patches in it gets applied. 353# If ${PATCHES} is non-zero all patches in it get applied. If there is more
354# than one patch please make ${PATCHES} an array for proper quoting.
354kde4-base_apply_patches() { 355kde4-base_apply_patches() {
355 local _patchdir _packages _p 356 local _patchdir _packages _p
356 _patchdir="${WORKDIR}/patches/" 357 _patchdir="${WORKDIR}/patches/"
357 if [[ -d "${_patchdir}" ]]; then 358 if [[ -d "${_patchdir}" ]]; then
358 if is-parent-package ${CATEGORY}/${PN} ; then 359 if is-parent-package ${CATEGORY}/${PN} ; then
359 _packages="$(get-child-packages ${CATEGORY}/${PN})" 360 _packages="$(get-child-packages ${CATEGORY}/${PN})"
360 _packages="${_packages//${CATEGORY}\//} ${PN}" 361 _packages="${_packages//${CATEGORY}\//} ${PN}"
361 else 362 else
362 _packages="${PN}" 363 _packages="${PN}"
363 fi 364 fi
365 if [[ ${#PATCHES[@]} -gt 1 ]]; then
364 for _p in ${_packages}; do 366 for _p in ${_packages}; do
367 PATCHES=( "${PATCHES[@]}" $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null) )
368 if [[ -n "${KDEBASE}" ]]; then
369 PATCHES=( "${PATCHES[@]}" $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null) )
370 fi
371 done
372 else
373 for _p in ${_packages}; do
365 PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)" 374 PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${PV}-*{diff,patch} 2>/dev/null)"
366 if [[ -n "${KDEBASE}" ]]; then 375 if [[ -n "${KDEBASE}" ]]; then
367 PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)" 376 PATCHES="${PATCHES} $(ls ${_patchdir}/${_p}-${SLOT}-*{diff,patch} 2>/dev/null)"
368 fi 377 fi
369 done 378 done
370 fi 379 fi
380 fi
371 [[ -n ${PATCHES} ]] && base_src_unpack autopatch 381 [[ -n ${PATCHES[@]} ]] && base_src_unpack autopatch
372} 382}
373 383
374# @FUNCTION: kde4-base_src_unpack 384# @FUNCTION: kde4-base_src_unpack
375# @DESCRIPTION: 385# @DESCRIPTION:
376# This function unpacks the source tarballs for KDE4 applications. 386# This function unpacks the source tarballs for KDE4 applications.
378# If no argument is passed to this function, then standard src_unpack is 388# If no argument is passed to this function, then standard src_unpack is
379# executed. Otherwise options are passed to base_src_unpack. 389# executed. Otherwise options are passed to base_src_unpack.
380# 390#
381# In addition it calls kde4-base_apply_patches when no arguments are passed to 391# In addition it calls kde4-base_apply_patches when no arguments are passed to
382# this function. 392# this function.
393#
394# It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and
395# enable_selected_linguas() in kde4-functions.eclass(5) for further details.
383kde4-base_src_unpack() { 396kde4-base_src_unpack() {
384 debug-print-function $FUNCNAME "$@" 397 debug-print-function $FUNCNAME "$@"
385 398
386 [[ -z "${KDE_S}" ]] && KDE_S="${S}" 399 [[ -z "${KDE_S}" ]] && KDE_S="${S}"
387 400
402 ebegin "Updating cmake/ directory..." 415 ebegin "Updating cmake/ directory..."
403 rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory" 416 rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
404 ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory" 417 ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
405 eend 0 418 eend 0
406 fi 419 fi
420
421 # Only enable selected languages, used for KDE extragear apps.
422 if [[ -n ${KDE_LINGUAS} ]]; then
423 enable_selected_linguas
424 fi
407} 425}
408 426
409# @FUNCTION: kde4-base_src_compile 427# @FUNCTION: kde4-base_src_compile
410# @DESCRIPTION: 428# @DESCRIPTION:
411# General function for compiling KDE4 applications. 429# General function for compiling KDE4 applications.

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20