/[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.54 Revision 1.61
1# Copyright 1999-2011 Gentoo Foundation 1# Copyright 1999-2012 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.54 2011/06/15 22:03:13 abcd Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.61 2012/08/19 11:12:35 johu Exp $
4 4
5inherit versionator 5inherit versionator
6 6
7# @ECLASS: kde4-functions.eclass 7# @ECLASS: kde4-functions.eclass
8# @MAINTAINER: 8# @MAINTAINER:
30# Warning- may lead to general instability and kill your pet targh. 30# Warning- may lead to general instability and kill your pet targh.
31 31
32# @ECLASS-VARIABLE: KDEBASE 32# @ECLASS-VARIABLE: KDEBASE
33# @DESCRIPTION: 33# @DESCRIPTION:
34# This gets set to a non-zero value when a package is considered a kde or 34# This gets set to a non-zero value when a package is considered a kde or
35# koffice ebuild. 35# kdevelop ebuild.
36if [[ ${CATEGORY} = kde-base ]]; then 36if [[ ${CATEGORY} = kde-base ]]; then
37 debug-print "${ECLASS}: KDEBASE ebuild recognized" 37 debug-print "${ECLASS}: KDEBASE ebuild recognized"
38 KDEBASE=kde-base 38 KDEBASE=kde-base
39elif [[ ${KMNAME-${PN}} = koffice ]]; then
40 debug-print "${ECLASS}: KOFFICE ebuild recognized"
41 KDEBASE=koffice
42elif [[ ${KMNAME-${PN}} = kdevelop ]]; then 39elif [[ ${KMNAME-${PN}} = kdevelop ]]; then
43 debug-print "${ECLASS}: KDEVELOP ebuild recognized" 40 debug-print "${ECLASS}: KDEVELOP ebuild recognized"
44 KDEBASE=kdevelop 41 KDEBASE=kdevelop
45fi 42fi
46 43
47# determine the build type 44# determine the build type
48if [[ ${PV} = *9999* ]]; then 45if [[ ${PV} = *9999* ]]; then
49 BUILD_TYPE="live" 46 KDE_BUILD_TYPE="live"
50else 47else
51 BUILD_TYPE="release" 48 KDE_BUILD_TYPE="release"
52fi 49fi
53export BUILD_TYPE 50export KDE_BUILD_TYPE
54 51
55# Set reponame and SCM for moduleses that have fully migrated to git 52# Set reponame and SCM for modules that have fully migrated to git
56# (hack - it's here because it needs to be before SCM inherits from kde4-base) 53# (hack - it's here because it needs to be before SCM inherits from kde4-base)
57if [[ ${BUILD_TYPE} == live ]]; then 54if [[ ${KDE_BUILD_TYPE} == live ]]; then
58 case "${KMNAME}" in 55 case "${KMNAME}" in
59 kdebase-workspace) 56 kdebase-workspace)
60 KDE_SCM="git" 57 KDE_SCM="git"
61 EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace} 58 EGIT_REPONAME=${EGIT_REPONAME:=kde-workspace}
62 ;; 59 ;;
90# These translations are automatically added to IUSE. Therefore ebuilds must set 87# These translations are automatically added to IUSE. Therefore ebuilds must set
91# this variable before inheriting any eclasses. To enable only selected 88# this variable before inheriting any eclasses. To enable only selected
92# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does 89# translations, ebuilds must call enable_selected_linguas(). kde4-{base,meta}.eclass does
93# this for you. 90# this for you.
94# 91#
95# Example: KDE_LINGUAS="en_GB de nl" 92# Example: KDE_LINGUAS="de en_GB nl"
96if [[ ${BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then 93if [[ ${KDE_BUILD_TYPE} != live || -n ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
97 for _lingua in ${KDE_LINGUAS}; do 94 for _lingua in ${KDE_LINGUAS}; do
98 IUSE="${IUSE} linguas_${_lingua}" 95 IUSE="${IUSE} linguas_${_lingua}"
99 done 96 done
100fi 97fi
101 98
181# @DESCRIPTION: 178# @DESCRIPTION:
182# Enable only selected linguas enabled doc folders. 179# Enable only selected linguas enabled doc folders.
183enable_selected_doc_linguas() { 180enable_selected_doc_linguas() {
184 debug-print-function ${FUNCNAME} "$@" 181 debug-print-function ${FUNCNAME} "$@"
185 182
186 # if there is no linguas defined we enable everything
187 if ! $(env | grep -q "^LINGUAS="); then
188 return 0
189 fi
190
191 # @ECLASS-VARIABLE: KDE_DOC_DIRS 183 # @ECLASS-VARIABLE: KDE_DOC_DIRS
192 # @DESCRIPTION: 184 # @DESCRIPTION:
193 # Variable specifying whitespace separated patterns for documentation locations. 185 # Variable specifying whitespace separated patterns for documentation locations.
194 # Default is "doc/%lingua" 186 # Default is "doc/%lingua"
195 KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'} 187 KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'}
206 # Disable whole directory 198 # Disable whole directory
207 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 199 sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
208 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 200 -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \
209 -i CMakeLists.txt || die 'failed to comment out all handbooks' 201 -i CMakeLists.txt || die 'failed to comment out all handbooks'
210 else 202 else
203 # if there is no linguas defined we enable everything (i.e. comment out nothing)
204 if ! $(env | grep -q "^LINGUAS="); then
205 return 0
206 fi
207
211 # Disable subdirectories recursively 208 # Disable subdirectories recursively
212 comment_all_add_subdirectory "${handbookdir}" 209 comment_all_add_subdirectory "${handbookdir}"
213 # Add requested translations 210 # Add requested translations
214 local lingua 211 local lingua
215 for lingua in en ${KDE_LINGUAS}; do 212 for lingua in en ${KDE_LINGUAS}; do
260 mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'" 257 mv -f "${pkg}" "${ESVN_STORE_DIR}"/ || eerror "Failed to move '${pkg}'"
261 done 258 done
262 rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue." 259 rmdir "${cleandir}" || die "Could not move obsolete KDE store dir. Please move '${cleandir}' contents to appropriate location (possibly ${ESVN_STORE_DIR}) and manually remove '${cleandir}' in order to continue."
263 fi 260 fi
264 261
265 if ! hasq kde4-meta ${INHERITED}; then 262 if ! has kde4-meta ${INHERITED}; then
266 case ${KMNAME} in 263 case ${KMNAME} in
267 extragear*|playground*) 264 extragear*|playground*)
268 local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}" 265 local scmlocalpath="${ESVN_STORE_DIR}"/"${KMNAME}"/"${PN}"
269 if [[ -d "${scmlocalpath}" ]]; then 266 if [[ -d "${scmlocalpath}" ]]; then
270 local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`" 267 local destdir="${ESVN_STORE_DIR}"/"${ESVN_PROJECT}"/"`basename "${ESVN_REPO_URI}"`"
470 467
471 popd > /dev/null 468 popd > /dev/null
472} 469}
473 470
474# @FUNCTION: get_kde_version 471# @FUNCTION: get_kde_version
472# @DESCRIPTION:
475# Translates an ebuild version into a major.minor KDE SC 473# Translates an ebuild version into a major.minor KDE SC
476# release version. If no version is specified, ${PV} is used. 474# release version. If no version is specified, ${PV} is used.
477get_kde_version() { 475get_kde_version() {
478 local ver=${1:-${PV}} 476 local ver=${1:-${PV}}
479 local major=$(get_major_version ${ver}) 477 local major=$(get_major_version ${ver})

Legend:
Removed from v.1.54  
changed lines
  Added in v.1.61

  ViewVC Help
Powered by ViewVC 1.1.20