/[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.29 Revision 1.30
1# Copyright 2007-2008 Gentoo Foundation 1# Copyright 2007-2009 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.29 2009/02/10 20:07:24 scarabeus Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.30 2009/03/01 11:44:09 scarabeus 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.X ebuilds 8# @BLURB: This eclass provides functions for kde 4.X ebuilds
14# eclass will fail with version older than 2. 14# eclass will fail with version older than 2.
15 15
16inherit base cmake-utils eutils multilib kde4-functions 16inherit base cmake-utils eutils multilib kde4-functions
17 17
18get_build_type 18get_build_type
19if [[ $BUILD_TYPE = live ]]; then 19if [[ ${BUILD_TYPE} = live ]]; then
20 inherit subversion 20 inherit subversion
21fi 21fi
22 22
23EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm 23EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare src_configure src_compile src_test src_install pkg_postinst pkg_postrm
24 24
57 57
58 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}" 58 COMMONDEPEND="${COMMONDEPEND} ${qtdepend}"
59} 59}
60kde4-base_set_qt_dependencies 60kde4-base_set_qt_dependencies
61 61
62# Set the cmake dependencies 62# Xorg
63# Quite a few packages fail with cmake-2.4 even for KDE 4.1, so we just require 2.6.2 63COMMONDEPEND="${COMMONDEPEND}
64CMAKEDEPEND=">=dev-util/cmake-2.6.2" 64 >=x11-base/xorg-server-1.5.2
65"
65 66
66# Set the common dependencies 67# X11 libs
68COMMONDEPEND="${COMMONDEPEND}
69 x11-libs/libXext
70 x11-libs/libXt
71 x11-libs/libXxf86vm
72"
73
74# localization deps
75# DISABLED UNTIL PMS decide correct approach :(
76if [[ -n ${KDE_LINGUAS} ]]; then
77 LNG_DEP=""
78 for _lng in ${KDE_LINGUAS}; do
79 # there must be or due to issue if lingua is not present in kde-l10n so
80 # it wont die but pick kde-l10n as-is.
81 LNG_DEP="${LNG_DEP}
82 || ( kde-base/kde-l10n[linguas_${_lng},kdeprefix=] kde-base/kde-l10n[kdeprefix=] )"
83 done
84fi
85
86# Set common dependencies for all ebuilds that inherit this eclass
67DEPEND="${DEPEND} ${COMMONDEPEND} ${CMAKEDEPEND} 87DEPEND="${DEPEND} ${COMMONDEPEND}
88 >=dev-util/cmake-2.6.2
68 dev-util/pkgconfig 89 dev-util/pkgconfig
69 x11-libs/libXt 90 >=sys-apps/sandbox-1.3.2
70 x11-proto/xf86vidmodeproto" 91"
71RDEPEND="${RDEPEND} ${COMMONDEPEND}" 92RDEPEND="${RDEPEND} ${COMMONDEPEND}"
72 93
73if [[ $BUILD_TYPE = live ]]; then 94if [[ $BUILD_TYPE = live ]]; then
74 # Disable tests for live ebuilds 95 # Disable tests for live ebuilds
75 RESTRICT="${RESTRICT} test" 96 RESTRICT="${RESTRICT} test"
135# @CODE 156# @CODE
136# KDE_MINIMAL="-4.1" 157# KDE_MINIMAL="-4.1"
137# @CODE 158# @CODE
138# Note: default minimal version is kde-4.1, which means that the apps will work 159# Note: default minimal version is kde-4.1, which means that the apps will work
139# with any KDE version >=${KDE_MINIMAL} 160# with any KDE version >=${KDE_MINIMAL}
140KDE_MINIMAL="${KDE_MINIMAL:=4.1}" 161KDE_MINIMAL="${KDE_MINIMAL:=4.2}"
141export KDE_MINIMAL 162export KDE_MINIMAL
142 163
143# FIXME: the code section, explanation of live. The last sentence needs other 164# FIXME: the code section, explanation of live. The last sentence needs other
144# formulation too. 165# formulation too.
145# 166#
164 185
165case ${NEED_KDE} in 186case ${NEED_KDE} in
166 latest) 187 latest)
167 if [[ $KDEBASE = kde-base ]]; then 188 if [[ $KDEBASE = kde-base ]]; then
168 case ${PV} in 189 case ${PV} in
169 4.2.6*) 190 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
170 _kdedir="4.3" 191 _kdedir="4.3"
171 _pv="-${PV}:4.3" 192 _pv="-${PV}:4.3"
172 _pvn="-${PV}" 193 _pvn="-${PV}"
173 ;; 194 ;;
174 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) 195 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*)
196 _pv="-${PV}:live" 217 _pv="-${PV}:live"
197 _pvn="-${PV}" 218 _pvn="-${PV}"
198 ;; 219 ;;
199 *) 220 *)
200 die "NEED_KDE=latest not supported for PV=${PV}" ;; 221 die "NEED_KDE=latest not supported for PV=${PV}" ;;
201 esac 222 esac
202 _operator=">=" 223 _operator=">="
203 else 224 else
204 # this creates dependency on any version of kde4 225 # this creates dependency on any version of kde4
205 _operator=">=" 226 _operator=">="
206 _pv="-${KDE_MINIMAL}" 227 _pv="-${KDE_MINIMAL}"
214 _operator=">=" 235 _operator=">="
215 _pv="-${NEED_KDE}:live" 236 _pv="-${NEED_KDE}:live"
216 _pvn="-${NEED_KDE}" 237 _pvn="-${NEED_KDE}"
217 export NEED_KDE="live" 238 export NEED_KDE="live"
218 ;; 239 ;;
219 4.2.6*) 240 4.3 | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*)
220 _kdedir="4.3" 241 _kdedir="4.3"
221 _pv="-${NEED_KDE}:4.3" 242 _pv="-${NEED_KDE}:4.3"
222 _pvn="-${NEED_KDE}" 243 _pvn="-${NEED_KDE}"
223 _operator=">=" 244 _operator=">="
224 ;; 245 ;;
256 die "NEED_KDE=${NEED_KDE} currently not supported." 277 die "NEED_KDE=${NEED_KDE} currently not supported."
257 ;; 278 ;;
258esac 279esac
259 280
260if [[ ${NEED_KDE} != none ]]; then 281if [[ ${NEED_KDE} != none ]]; then
261
262 #Set the SLOT 282 #Set the SLOT
263 if [[ -n $KDEBASE ]]; then 283 if [[ -n ${KDEBASE} ]]; then
264 if [[ $NEED_KDE = live ]]; then 284 if [[ ${NEED_KDE} = live ]]; then
265 SLOT="live" 285 SLOT="live"
266 else 286 else
267 case ${KMNAME} in 287 case ${KMNAME} in
268 koffice) 288 koffice)
269 case ${PV} in 289 case ${PV} in
284 esac 304 esac
285 ;; 305 ;;
286 *) 306 *)
287 case ${PV} in 307 case ${PV} in
288 9999*) SLOT="live" ;; 308 9999*) SLOT="live" ;;
309 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;;
289 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;; 310 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;;
290 4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;; 311 4.1* | 4.0.9* | 4.0.8*) SLOT="4.1" ;;
291 *) SLOT="4.1" ;; 312 *) SLOT="4.1" ;;
292 esac 313 esac
293 ;; 314 ;;
294 esac 315 esac
295 fi 316 fi
296 fi 317 fi
297 318
298 # Block installation of other SLOTS unless kdeprefix 319 # Block installation of other SLOTS unless kdeprefix
299 for KDE_SLOT in ${KDE_SLOTS[@]}; do 320 for KDE_SLOT in ${KDE_SLOTS[@]}; do
307 fi 328 fi
308 done 329 done
309 330
310 # Adding kdelibs, kdepimlibs and kdebase-data deps to all other packages. 331 # Adding kdelibs, kdepimlibs and kdebase-data deps to all other packages.
311 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs" 332 # We only need to add the dependencies if ${PN} is not "kdelibs" or "kdepimlibs"
312 if [[ $PN != kdelibs ]]; then 333 if [[ ${PN} != kdelibs ]]; then
313 DEPEND="${DEPEND} 334 DEPEND="${DEPEND}
314 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] ) 335 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
315 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )" 336 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )"
316 RDEPEND="${RDEPEND} 337 RDEPEND="${RDEPEND}
317 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] ) 338 kdeprefix? ( ${_operator}kde-base/kdelibs${_pv}[kdeprefix] )
318 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )" 339 !kdeprefix? ( ${_operator}kde-base/kdelibs${_pvn}[-kdeprefix] )"
319 if [[ $PN != kdepimlibs ]]; then 340 if [[ ${PN} != kdepimlibs ]]; then
320 DEPEND="${DEPEND} 341 DEPEND="${DEPEND}
321 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] ) 342 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
322 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )" 343 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
323 RDEPEND="${RDEPEND} 344 RDEPEND="${RDEPEND}
324 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] ) 345 kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pv}[kdeprefix] )
325 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )" 346 !kdeprefix? ( ${_operator}kde-base/kdepimlibs${_pvn}[-kdeprefix] )"
326 if [[ $PN != kdebase-data ]]; then 347 if [[ ${PN} != kdebase-data ]]; then
327 RDEPEND="${RDEPEND} 348 RDEPEND="${RDEPEND}
328 kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] ) 349 kdeprefix? ( ${_operator}kde-base/kdebase-data${_pv}[kdeprefix] )
329 !kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )" 350 !kdeprefix? ( ${_operator}kde-base/kdebase-data${_pvn}[-kdeprefix] )"
330 fi 351 fi
331 fi 352 fi
333 unset _operator _pv _pvn 354 unset _operator _pv _pvn
334fi 355fi
335 356
336# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a 357# Fetch section - If the ebuild's category is not 'kde-base' and if it is not a
337# koffice ebuild, the URI should be set in the ebuild itself 358# koffice ebuild, the URI should be set in the ebuild itself
338case ${SLOT} in 359case ${BUILD_TYPE} in
339 live) 360 live)
361 SRC_URI=""
340 ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde} 362 ESVN_MIRROR=${ESVN_MIRROR:=svn://anonsvn.kde.org/home/kde}
341 # Split ebuild, or extragear stuff 363 # Split ebuild, or extragear stuff
342 if [[ -n $KMNAME ]]; then 364 if [[ -n ${KMNAME} ]]; then
343 ESVN_PROJECT="${KMNAME}" 365 ESVN_PROJECT="${KMNAME}"
344 if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then 366 if [[ -z ${KMNOMODULE} && -z ${KMMODULE} ]]; then
345 KMMODULE="${PN}" 367 KMMODULE="${PN}"
346 fi 368 fi
347 # Split kde-base/ ebuilds: (they reside in trunk/KDE) 369 # Split kde-base/ ebuilds: (they reside in trunk/KDE)
348 case ${KMNAME} in 370 case ${KMNAME} in
349 kdebase-*) 371 kdebase-*)
350 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}/" 372 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/kdebase/${KMNAME#kdebase-}"
351 ;; 373 ;;
352 kdereview) 374 kdereview)
353 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/" 375 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
354 ;; 376 ;;
355 kde*) 377 kde*)
356 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}" 378 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${KMNAME}"
357 ;; 379 ;;
358 extragear*|playground*) 380 extragear*|playground*)
359 case ${PN} in
360 *-plasma)
361 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/" 381 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
362 ESVN_PROJECT="${KMNAME}/${KMMODULE}/"
363 ;;
364 *)
365 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/"
366 ;;
367 esac
368 ;; 382 ;;
369 koffice) 383 koffice)
370 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}" 384 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}"
371 ;; 385 ;;
372 *) 386 *)
373 # Extragear material
374 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}/" 387 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}"
375 ;; 388 ;;
376 esac 389 esac
377 else 390 else
378 # kdelibs, kdepimlibs 391 # kdelibs, kdepimlibs
379 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${PN}" 392 ESVN_REPO_URI="${ESVN_MIRROR}/trunk/KDE/${PN}"
381 fi 394 fi
382 # limit syncing to 1 hour. 395 # limit syncing to 1 hour.
383 ESVN_UP_FREQ=${ESVN_UP_FREQ:-1} 396 ESVN_UP_FREQ=${ESVN_UP_FREQ:-1}
384 ;; 397 ;;
385 *) 398 *)
386 if [[ -n $KDEBASE ]]; then 399 if [[ -n ${KDEBASE} ]]; then
387 if [[ -n ${KMNAME} ]]; then 400 if [[ -n ${KMNAME} ]]; then
401 case ${KMNAME} in
402 kdebase-apps)
403 _kmname="kdebase" ;;
404 *)
388 _kmname=${KMNAME} 405 _kmname=${KMNAME} ;;
406 esac
389 else 407 else
390 _kmname=${PN} 408 _kmname=${PN}
391 fi 409 fi
392 _kmname_pv="${_kmname}-${PV}" 410 _kmname_pv="${_kmname}-${PV}"
393 if [[ $NEED_KDE != live ]]; then 411 if [[ $NEED_KDE != live ]]; then
394 case ${KDEBASE} in 412 case ${KDEBASE} in
395 kde-base) 413 kde-base)
396 case ${PV} in 414 case ${PV} in
397 4.2.60)
398 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.svn912032tar.bz2" ;;
399 4.2.61)
400 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.svn917530.tar.bz2" ;;
401 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*) 415 4.2.6* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6* | 4.0.9* | 4.0.8*)
402 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 416 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
403 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 417 *) SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
404 esac 418 esac
405 ;; 419 ;;
406 koffice) 420 koffice)
407 SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2" 421 SRC_URI="mirror://kde/unstable/${_kmname_pv}/src/${_kmname_pv}.tar.bz2"
408 ;; 422 ;;
409 esac 423 esac
410 fi 424 fi
411 unset _kmname _kmname_pv 425 unset _kmname _kmname_pv
412 fi 426 fi
413 ;; 427 ;;
414esac 428esac
415 429
416debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" 430debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}"
417 431
430# Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses 444# Adds flags needed by all of KDE 4 to $QT4_BUILT_WITH_USE_CHECK. Uses
431# kde4-functions_check_use from kde4-functions.eclass to print appropriate 445# kde4-functions_check_use from kde4-functions.eclass to print appropriate
432# errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or 446# errors and die if any required flags listed in $QT4_BUILT_WITH_USE_CHECK or
433# $KDE4_BUILT_WITH_USE_CHECK are missing. 447# $KDE4_BUILT_WITH_USE_CHECK are missing.
434kde4-base_pkg_setup() { 448kde4-base_pkg_setup() {
435 debug-print-function $FUNCNAME "$@" 449 debug-print-function ${FUNCNAME} "$@"
436 450
437 # Don't set KDEHOME during compile, it will cause access violations 451 # Don't set KDEHOME during compile, it will cause access violations
438 unset KDEHOME 452 unset KDEHOME
439 453
440 # Search for best suitable kde installation for misc kde package. 454 # Search for best suitable kde installation for misc kde package.
441 # Computation based on NEED_KDE and KDE_MINIMAL 455 # Computation based on NEED_KDE and KDE_MINIMAL
442 [[ ${NEED_KDE} = latest || ${NEED_KDE} = none ]] && get_latest_kdedir 456 [[ ${KDEBASE} != kde-base ]] && [[ ${NEED_KDE} = latest || ${NEED_KDE} = none ]] && get_latest_kdedir
443 457
444 # Set PREFIX 458 # Set PREFIX
445 if use kdeprefix; then 459 if use kdeprefix; then
446 KDEDIR="/usr/kde/${_kdedir}" 460 KDEDIR="/usr/kde/${_kdedir}"
447 KDEDIRS="/usr/local/:/usr:${KDEDIR}" 461 KDEDIRS="/usr/local/:/usr:${KDEDIR}"
449 KDEDIR="/usr" 463 KDEDIR="/usr"
450 KDEDIRS="/usr/local/:/usr" 464 KDEDIRS="/usr/local/:/usr"
451 fi 465 fi
452 # Set the prefix based on KDEDIR 466 # Set the prefix based on KDEDIR
453 # Make it a consequence of kdeprefix 467 # Make it a consequence of kdeprefix
454 PREFIX=$KDEDIR 468 PREFIX=${KDEDIR}
455 469
456 unset _kdedir 470 unset _kdedir
457 471
458 # check if qt has correct deps 472 # check if qt has correct deps
459 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \ 473 [[ -n ${QT4_BUILT_WITH_USE_CHECK} || -n ${KDE4_BUILT_WITH_USE_CHECK[@]} ]] && \
460 die "built_with_use illegal in this EAPI!" 474 die "built_with_use illegal in this EAPI!"
461 475
462 if [[ $BUILD_TYPE = live && -z $I_KNOW_WHAT_I_AM_DOING ]]; then 476 if [[ ${BUILD_TYPE} = live && -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then
463 echo 477 echo
464 elog "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}" 478 elog "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}"
465 elog "Use it at your own risk." 479 elog "Use it at your own risk."
466 elog "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" 480 elog "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
467 echo 481 echo
469} 483}
470 484
471# @FUNCTION: kde4-base_src_unpack 485# @FUNCTION: kde4-base_src_unpack
472# @DESCRIPTION: 486# @DESCRIPTION:
473# This function unpacks the source tarballs for KDE4 applications. 487# This function unpacks the source tarballs for KDE4 applications.
474#
475# If no argument is passed to this function, then standard src_unpack is
476# executed. Otherwise, options are passed to base_src_unpack.
477kde4-base_src_unpack() { 488kde4-base_src_unpack() {
478 debug-print-function $FUNCNAME "$@" 489 debug-print-function ${FUNCNAME} "$@"
479 490
480 if [[ $BUILD_TYPE = live ]]; then 491 if [[ ${BUILD_TYPE} = live ]]; then
481 migrate_store_dir 492 migrate_store_dir
482 subversion_src_unpack 493 subversion_src_unpack
483 else 494 else
484 [[ -z $KDE_S ]] && KDE_S="${S}" 495 base_src_unpack
485 if [[ -z $* ]]; then
486 # Unpack first and deal with KDE patches after examing possible patch sets.
487 # To be picked up, patches need to conform to the guidelines stated before.
488 # Monolithic ebuilds will use the split ebuild patches.
489 [[ -d "${KDE_S}" ]] || unpack ${A}
490 fi
491 # Updated cmake dir
492 if [[ -d "${WORKDIR}/cmake" && -d "${KDE_S}/cmake" ]]; then
493 ebegin "Updating cmake/ directory..."
494 rm -rf "${KDE_S}/cmake" || die "Unable to remove old cmake/ directory"
495 ln -s "${WORKDIR}/cmake" "${KDE_S}/cmake" || die "Unable to symlink the new cmake/ directory"
496 eend 0
497 fi
498 fi 496 fi
499} 497}
500 498
501# @FUNCTION: kde4-base_src_compile 499# @FUNCTION: kde4-base_src_compile
502# @DESCRIPTION: 500# @DESCRIPTION:
505# enable_selected_linguas() in kde4-functions.eclass(5) for further details. 503# enable_selected_linguas() in kde4-functions.eclass(5) for further details.
506kde4-base_src_prepare() { 504kde4-base_src_prepare() {
507 debug-print-function ${FUNCNAME} "$@" 505 debug-print-function ${FUNCNAME} "$@"
508 506
509 # Only enable selected languages, used for KDE extragear apps. 507 # Only enable selected languages, used for KDE extragear apps.
510 if [[ -n $KDE_LINGUAS ]]; then 508 if [[ -n ${KDE_LINGUAS} ]]; then
511 enable_selected_linguas 509 enable_selected_linguas
512 fi 510 fi
513 511
514 # Autopatch 512 # Autopatch
515 base_src_prepare 513 base_src_prepare
516 514
517 # Save library dependencies 515 # Save library dependencies
518 if [[ -n $KMSAVELIBS ]] ; then 516 if [[ -n ${KMSAVELIBS} ]] ; then
519 save_library_dependencies 517 save_library_dependencies
520 fi 518 fi
521 519
522 # Inject library dependencies 520 # Inject library dependencies
523 if [[ -n $KMLOADLIBS ]] ; then 521 if [[ -n ${KMLOADLIBS} ]] ; then
524 load_library_dependencies 522 load_library_dependencies
525 fi 523 fi
526} 524}
527 525
528# @FUNCTION: kde4-base_src_configure 526# @FUNCTION: kde4-base_src_configure
547 545
548 # Build tests in src_test only, where we override this value 546 # Build tests in src_test only, where we override this value
549 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF" 547 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=OFF"
550 548
551 # Set distribution name 549 # Set distribution name
552 [[ $PN = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" 550 [[ ${PN} = kdelibs ]] && mycmakeargs="${mycmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo"
553 551
554 # runpath linking 552 # runpath linking
555 mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON" 553 mycmakeargs="${mycmakeargs} -DKDE4_USE_ALWAYS_FULL_RPATH=ON"
556 554
557 # Here we set the install prefix 555 # Here we set the install prefix
560 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc 558 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc
561 use kdeprefix || mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc" 559 use kdeprefix || mycmakeargs="${mycmakeargs} -DSYSCONF_INSTALL_DIR=/etc"
562 560
563 # Set environment 561 # Set environment
564 QTEST_COLORED=1 562 QTEST_COLORED=1
565 QT_PLUGIN_PATH=${KDEDIR}/$(get_libdir)/kde4/plugins/ 563 QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/"
566 564
567 # hardcode path to *.cmake KDE files 565 # Hardcode path to *.pc KDE files
568 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig" 566 export PKG_CONFIG_PATH="${PKG_CONFIG_PATH:+${PKG_CONFIG_PATH}:}${KDEDIR}/$(get_libdir)/pkgconfig"
569 567
570 # additonal arguments for KOFFICE 568 # Override some environment variables
571 if [[ $KMNAME = koffice ]]; then 569 PATH="${KDEDIR}/bin:${PATH}"
572 case ${PN} in 570 LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}"
573 koffice-data) : ;; 571
574 *) 572 # Set cmake prefixes to allow buildsystem to localize valid KDE installation when more are present
573 if use kdeprefix; then
575 mycmakeargs="${mycmakeargs} 574 mycmakeargs="${mycmakeargs}
576 -DWITH_OpenEXR=ON 575 -DCMAKE_SYSTEM_INCLUDE_PATH=${KDEDIR}/include
577 $(cmake-utils_use_with crypt QCA2) 576 -DCMAKE_SYSTEM_LIBRARY_PATH=${KDEDIR}/$(get_libdir)
578 $(cmake-utils_use_with opengl OpenGL)" 577 -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}
579 if use crypt; then 578 -DCMAKE_SYSTEM_PROGRAM_PATH=${KDEDIR}/bin"
580 mycmakeargs="${mycmakeargs}
581 -DQCA2_LIBRARIES=/usr/$(get_libdir)/qca2/libqca.so.2"
582 fi
583 ;;
584 esac
585 fi 579 fi
586 580
587 [ -e CMakeLists.txt ] && cmake-utils_src_configure 581 [ -e CMakeLists.txt ] && cmake-utils_src_configure
588} 582}
589 583
602# Options are passed to cmake-utils_src_make. 596# Options are passed to cmake-utils_src_make.
603kde4-base_src_make() { 597kde4-base_src_make() {
604 debug-print-function ${FUNCNAME} "$@" 598 debug-print-function ${FUNCNAME} "$@"
605 599
606 if [[ -d "$WORKDIR/${PN}_build" ]]; then 600 if [[ -d "$WORKDIR/${PN}_build" ]]; then
607 pushd "${WORKDIR}"/${PN}_build > /dev/null 601 pushd "${WORKDIR}/${PN}_build" > /dev/null
608 fi 602 fi
609 [ -e [Mm]akefile ] && cmake-utils_src_make "$@" 603 [ -e [Mm]akefile ] && cmake-utils_src_make "$@"
610} 604}
611 605
612# @FUNCTION: kde4-base_src_test 606# @FUNCTION: kde4-base_src_test
615kde4-base_src_test() { 609kde4-base_src_test() {
616 debug-print-function ${FUNCNAME} "$@" 610 debug-print-function ${FUNCNAME} "$@"
617 611
618 # Override this value, set in kde4-base_src_configure() 612 # Override this value, set in kde4-base_src_configure()
619 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON" 613 mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON"
620 cmake-utils_src_compile 614 cmake-utils_src_configure
615 kde4-base_src_compile
621 616
622 cmake-utils_src_test 617 cmake-utils_src_test
623} 618}
624 619
625# @FUNCTION: kde4-base_src_install 620# @FUNCTION: kde4-base_src_install
626# @DESCRIPTION: 621# @DESCRIPTION:
627# Function for installing KDE4 applications. 622# Function for installing KDE4 applications.
628kde4-base_src_install() { 623kde4-base_src_install() {
629 debug-print-function ${FUNCNAME} "$@" 624 debug-print-function ${FUNCNAME} "$@"
630 625
631 if [[ -n $KMSAVELIBS ]] ; then 626 if [[ -n ${KMSAVELIBS} ]] ; then
632 install_library_dependencies 627 install_library_dependencies
633 fi 628 fi
634 629
635 kde4-base_src_make_doc 630 kde4-base_src_make_doc
636 if [[ -d "$WORKDIR/${PN}_build" ]]; then 631 if [[ -d "$WORKDIR/${PN}_build" ]]; then
637 pushd "${WORKDIR}"/${PN}_build > /dev/null 632 pushd "${WORKDIR}/${PN}_build" > /dev/null
638 fi 633 fi
639 [ -e [Mm]akefile ] && cmake-utils_src_install 634 [ -e [Mm]akefile ] && cmake-utils_src_install
640} 635}
641 636
642# @FUNCTION: kde4-base_src_make_doc 637# @FUNCTION: kde4-base_src_make_doc
645kde4-base_src_make_doc() { 640kde4-base_src_make_doc() {
646 debug-print-function ${FUNCNAME} "$@" 641 debug-print-function ${FUNCNAME} "$@"
647 642
648 local doc 643 local doc
649 for doc in AUTHORS ChangeLog* README* NEWS TODO; do 644 for doc in AUTHORS ChangeLog* README* NEWS TODO; do
650 [[ -s $doc ]] && dodoc ${doc} 645 [[ -s ${doc} ]] && dodoc ${doc}
651 done 646 done
652 647
653 if [[ -z $KMNAME ]]; then 648 if [[ -z ${KMNAME} ]]; then
654 for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do 649 for doc in {apps,runtime,workspace,.}/*/{AUTHORS,README*}; do
655 if [[ -s $doc ]]; then 650 if [[ -s ${doc} ]]; then
656 local doc_complete=${doc} 651 local doc_complete=${doc}
657 doc="${doc#*/}" 652 doc="${doc#*/}"
658 newdoc "$doc_complete" "${doc%/*}.${doc##*/}" 653 newdoc "$doc_complete" "${doc%/*}.${doc##*/}"
659 fi 654 fi
660 done 655 done
661 fi 656 fi
662 657
663 if [[ -n ${KDEBASE} && -d "${D}/usr/share/doc/${PF}" ]]; then 658 if [[ -n ${KDEBASE} && -d "${D}/usr/share/doc/${PF}" ]]; then
664 # work around bug #97196 659 # work around bug #97196
665 dodir /usr/share/doc/kde && \ 660 dodir /usr/share/doc/kde && \
666 mv "${D}"/usr/share/doc/${PF} "${D}"/usr/share/doc/kde/ || \ 661 mv "${D}/usr/share/doc/${PF}" "${D}"/usr/share/doc/kde/ || \
667 die "Failed to move docs to kde/ failed." 662 die "Failed to move docs to kde/ failed."
668 fi 663 fi
669} 664}
670 665
671# @FUNCTION: kde4-base_pkg_postinst 666# @FUNCTION: kde4-base_pkg_postinst
672# @DESCRIPTION: 667# @DESCRIPTION:
673# Function to rebuild the KDE System Configuration Cache after an application has been installed. 668# Function to rebuild the KDE System Configuration Cache after an application has been installed.
674kde4-base_pkg_postinst() { 669kde4-base_pkg_postinst() {
670 debug-print-function ${FUNCNAME} "$@"
671
675 buildsycoca 672 buildsycoca
676} 673}
677 674
678# @FUNCTION: kde4-base_pkg_postrm 675# @FUNCTION: kde4-base_pkg_postrm
679# @DESCRIPTION: 676# @DESCRIPTION:
680# Function to rebuild the KDE System Configuration Cache after an application has been removed. 677# Function to rebuild the KDE System Configuration Cache after an application has been removed.
681kde4-base_pkg_postrm() { 678kde4-base_pkg_postrm() {
679 debug-print-function ${FUNCNAME} "$@"
680
682 buildsycoca 681 buildsycoca
683} 682}

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.30

  ViewVC Help
Powered by ViewVC 1.1.20