/[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.126 Revision 1.140
1# Copyright 1999-2013 Gentoo Foundation 1# Copyright 1999-2014 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.126 2013/07/10 03:46:48 patrick Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.140 2014/08/10 22:40:21 johu 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
9# @DESCRIPTION: 9# @DESCRIPTION:
10# The kde4-base.eclass provides support for building KDE4 based ebuilds 10# The kde4-base.eclass provides support for building KDE4 based ebuilds
11# and KDE4 applications. 11# and KDE4 applications.
12# 12#
13# NOTE: KDE 4 ebuilds currently support EAPIs 3, 4, and 5. This will be 13# NOTE: KDE 4 ebuilds currently support EAPIs 4 and 5. This will be
14# reviewed over time as new EAPI versions are approved. 14# reviewed over time as new EAPI versions are approved.
15 15
16if [[ ${___ECLASS_ONCE_KDE4_BASE} != "recur -_+^+_- spank" ]] ; then 16if [[ -z ${_KDE4_BASE_ECLASS} ]]; then
17___ECLASS_ONCE_KDE4_BASE="recur -_+^+_- spank" 17_KDE4_BASE_ECLASS=1
18 18
19# @ECLASS-VARIABLE: KDE_SELINUX_MODULE 19# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
20# @DESCRIPTION: 20# @DESCRIPTION:
21# If set to "none", do nothing. 21# If set to "none", do nothing.
22# For any other value, add selinux to IUSE, and depending on that useflag 22# For any other value, add selinux to IUSE, and depending on that useflag
32# For proper description see virtualx.eclass manpage. 32# For proper description see virtualx.eclass manpage.
33# Here we redefine default value to be manual, if your package needs virtualx 33# Here we redefine default value to be manual, if your package needs virtualx
34# for tests you should proceed with setting VIRTUALX_REQUIRED=test. 34# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
35: ${VIRTUALX_REQUIRED:=manual} 35: ${VIRTUALX_REQUIRED:=manual}
36 36
37inherit kde4-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils base virtualx versionator eutils multilib 37inherit kde4-functions toolchain-funcs fdo-mime flag-o-matic gnome2-utils virtualx versionator eutils multilib
38 38
39if [[ ${KDE_BUILD_TYPE} = live ]]; then 39if [[ ${KDE_BUILD_TYPE} = live ]]; then
40 case ${KDE_SCM} in 40 case ${KDE_SCM} in
41 svn) inherit subversion ;; 41 svn) inherit subversion ;;
42 git) inherit git-2 ;; 42 git) inherit git-r3 ;;
43 esac 43 esac
44fi 44fi
45 45
46# @ECLASS-VARIABLE: CMAKE_REQUIRED 46# @ECLASS-VARIABLE: CMAKE_REQUIRED
47# @DESCRIPTION: 47# @DESCRIPTION:
64KDE_MINIMAL="${KDE_MINIMAL:-4.4}" 64KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
65 65
66# Set slot for KDEBASE known packages 66# Set slot for KDEBASE known packages
67case ${KDEBASE} in 67case ${KDEBASE} in
68 kde-base) 68 kde-base)
69 case ${EAPI} in
70 5)
71 SLOT=4/$(get_version_component_range 1-2)
72 ;;
73 *)
69 SLOT=4 74 SLOT=4
75 ;;
76 esac
70 KDE_MINIMAL="${PV}" 77 KDE_MINIMAL="${PV}"
71 ;; 78 ;;
72 kdevelop) 79 kdevelop)
73 if [[ ${KDE_BUILD_TYPE} = live ]]; then 80 if [[ ${KDE_BUILD_TYPE} = live ]]; then
74 # @ECLASS-VARIABLE: KDEVELOP_VERSION 81 # @ECLASS-VARIABLE: KDEVELOP_VERSION
75 # @DESCRIPTION: 82 # @DESCRIPTION:
76 # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages. 83 # Specifies KDevelop version. Default is 4.0.0 for tagged packages and 9999 for live packages.
77 # Applies to KDEBASE=kdevelop only. 84 # Applies to KDEBASE=kdevelop only.
78 KDEVELOP_VERSION="${KDEVELOP_VERSION:-9999}" 85 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.9999}"
79 # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION 86 # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION
80 # @DESCRIPTION: 87 # @DESCRIPTION:
81 # Specifies KDevplatform version. Default is 1.0.0 for tagged packages and 9999 for live packages. 88 # Specifies KDevplatform version. Default is 1.0.0 for tagged packages and 9999 for live packages.
82 # Applies to KDEBASE=kdevelop only. 89 # Applies to KDEBASE=kdevelop only.
83 KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-9999}" 90 KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-4.9999}"
84 else 91 else
85 case ${PN} in 92 case ${PN} in
86 kdevelop|quanta) 93 kdevelop)
87 KDEVELOP_VERSION=${PV} 94 KDEVELOP_VERSION=${PV}
88 KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)" 95 KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)"
89 ;; 96 ;;
90 kdevplatform|kdevelop-php*) 97 kdevplatform|kdevelop-php*|kdevelop-python)
91 KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)" 98 KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)"
92 KDEVPLATFORM_VERSION=${PV} 99 KDEVPLATFORM_VERSION=${PV}
93 ;; 100 ;;
94 *) 101 *)
95 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}" 102 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}"
191esac 198esac
192 199
193# @ECLASS-VARIABLE: QT_MINIMAL 200# @ECLASS-VARIABLE: QT_MINIMAL
194# @DESCRIPTION: 201# @DESCRIPTION:
195# Determine version of qt we enforce as minimal for the package. 202# Determine version of qt we enforce as minimal for the package.
196QT_MINIMAL="${QT_MINIMAL:-4.8.0}" 203QT_MINIMAL="${QT_MINIMAL:-4.8.5}"
197 204
198# Declarative dependencies 205# Declarative dependencies
199qtdeclarativedepend=" 206qtdeclarativedepend="
200 >=dev-qt/qtdeclarative-${QT_MINIMAL}:4 207 >=dev-qt/qtdeclarative-${QT_MINIMAL}:4
201" 208"
279kdecommondepend=" 286kdecommondepend="
280 dev-lang/perl 287 dev-lang/perl
281 >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility] 288 >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility]
282 >=dev-qt/qtcore-${QT_MINIMAL}:4[qt3support,ssl] 289 >=dev-qt/qtcore-${QT_MINIMAL}:4[qt3support,ssl]
283 >=dev-qt/qtdbus-${QT_MINIMAL}:4 290 >=dev-qt/qtdbus-${QT_MINIMAL}:4
291 >=dev-qt/designer-${QT_MINIMAL}:4[-phonon]
284 >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)] 292 >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)]
285 >=dev-qt/qtscript-${QT_MINIMAL}:4 293 >=dev-qt/qtscript-${QT_MINIMAL}:4
286 >=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support] 294 >=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support]
287 >=dev-qt/qtsvg-${QT_MINIMAL}:4 295 >=dev-qt/qtsvg-${QT_MINIMAL}:4
288 >=dev-qt/qttest-${QT_MINIMAL}:4 296 >=dev-qt/qttest-${QT_MINIMAL}:4
289 >=dev-qt/qtwebkit-${QT_MINIMAL}:4 297 >=dev-qt/qtwebkit-${QT_MINIMAL}:4
290 !aqua? (
291 x11-libs/libXext
292 x11-libs/libXt
293 x11-libs/libXxf86vm
294 x11-libs/libXcomposite
295 x11-libs/libxkbfile
296 )
297" 298"
298 299
299if [[ ${PN} != kdelibs ]]; then 300if [[ ${PN} != kdelibs ]]; then
300 kdecommondepend+=" $(add_kdebase_dep kdelibs)" 301 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
301 if [[ ${KDEBASE} = kdevelop ]]; then 302 if [[ ${KDEBASE} = kdevelop ]]; then
306 # Applies to KDEBASE=kdevelop only. 307 # Applies to KDEBASE=kdevelop only.
307 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}" 308 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
308 case ${KDEVPLATFORM_REQUIRED} in 309 case ${KDEVPLATFORM_REQUIRED} in
309 always) 310 always)
310 kdecommondepend+=" 311 kdecommondepend+="
311 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION} 312 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}:4
312 " 313 "
313 ;; 314 ;;
314 *) ;; 315 *) ;;
315 esac 316 esac
316 fi 317 fi
331# all packages needs oxygen icons for basic iconset 332# all packages needs oxygen icons for basic iconset
332if [[ ${PN} != oxygen-icons ]]; then 333if [[ ${PN} != oxygen-icons ]]; then
333 kderdepend+=" $(add_kdebase_dep oxygen-icons)" 334 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
334fi 335fi
335 336
336# add a dependency over kde-l10n if EAPI4 or better is around 337# add a dependency over kde-l10n
337if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} && ${EAPI:-0} != 3 ]]; then 338if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
338 for _lingua in ${KDE_LINGUAS}; do 339 for _lingua in ${KDE_LINGUAS}; do
339 # if our package has lignuas, pull in kde-l10n with selected lingua enabled, 340 # if our package has lignuas, pull in kde-l10n with selected lingua enabled,
340 # but only for selected ones. 341 # but only for selected ones.
341 # this can't be done on one line because if user doesn't use any localisation 342 # this can't be done on one line because if user doesn't use any localisation
342 # then he is probably not interested in kde-l10n at all. 343 # then he is probably not interested in kde-l10n at all.
374 IUSE+=" selinux" 375 IUSE+=" selinux"
375 kdecommondepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )" 376 kdecommondepend+=" selinux? ( sec-policy/selinux-${KDE_SELINUX_MODULE} )"
376 ;; 377 ;;
377esac 378esac
378 379
379# These dependencies are added as they are unconditionally required by kde-workspace.
380# They are not necessarily required by individual applications but are pulled in to prevent
381# bugs like bug #444438. This list is subject to change in the future so do not rely on it
382# in ebuilds - always set correct dependencies.
383case ${KMNAME} in
384 kde-workspace)
385 kdedepend+="
386 x11-libs/xcb-util
387 x11-libs/libX11
388 x11-libs/libXcomposite
389 x11-libs/libXcursor
390 x11-libs/libXdamage
391 x11-libs/libXfixes
392 x11-libs/libxkbfile
393 x11-libs/libXrandr
394 x11-libs/libXrender
395 "
396 ;;
397 *)
398 ;;
399esac
400
401# We always need the aqua useflag because otherwise we cannot = refer to it inside 380# We always need the aqua useflag because otherwise we cannot = refer to it inside
402# add_kdebase_dep. This was always kind of a bug, but came to light with EAPI=5 381# add_kdebase_dep. This was always kind of a bug, but came to light with EAPI=5
403# (where referring to a use flag not in IUSE masks the ebuild). 382# (where referring to a use flag not in IUSE masks the ebuild).
404# The only alternative would be to prohibit using add_kdebase_dep if KDE_REQUIRED=never 383# The only alternative would be to prohibit using add_kdebase_dep if KDE_REQUIRED=never
405IUSE+=" aqua" 384IUSE+=" aqua"
440 # we calculate URI only for known KDEBASE modules 419 # we calculate URI only for known KDEBASE modules
441 [[ -n ${KDEBASE} ]] || return 420 [[ -n ${KDEBASE} ]] || return
442 421
443 # calculate tarball module name 422 # calculate tarball module name
444 if [[ -n ${KMNAME} ]]; then 423 if [[ -n ${KMNAME} ]]; then
445 # fixup kdebase-apps name
446 case ${KMNAME} in
447 kdebase-apps)
448 _kmname="kdebase" ;;
449 *)
450 _kmname="${KMNAME}" ;; 424 _kmname="${KMNAME}"
451 esac
452 else 425 else
453 _kmname=${PN} 426 _kmname=${PN}
454 fi 427 fi
455 _kmname_pv="${_kmname}-${PV}" 428 _kmname_pv="${_kmname}-${PV}"
456 case ${KDEBASE} in 429 case ${KDEBASE} in
464 # Unstable KDE SC releases 437 # Unstable KDE SC releases
465 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;; 438 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
466 4.[1-7].[12345]) 439 4.[1-7].[12345])
467 # Stable KDE SC with old .bz2 support 440 # Stable KDE SC with old .bz2 support
468 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 441 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.bz2" ;;
442 4.11.9)
443 # Part of 4.12 actually, sigh. Not stable for next release!
444 SRC_URI="mirror://kde/stable/4.12.5/src/${_kmname_pv}.tar.xz" ;;
445 4.11.10)
446 # Part of 4.13 actually, sigh. Not stable for next release!
447 SRC_URI="mirror://kde/stable/4.13.2/src/${_kmname_pv}.tar.xz" ;;
448 4.11.11)
449 # Part of 4.13 actually, sigh. Not stable for next release!
450 SRC_URI="mirror://kde/stable/4.13.3/src/${_kmname_pv}.tar.xz" ;;
469 *) 451 *)
470 # Stable KDE SC releases 452 # Stable KDE SC releases
471 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;; 453 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
472 esac 454 esac
473 ;; 455 ;;
487 case ${KDE_SCM} in 469 case ${KDE_SCM} in
488 svn) 470 svn)
489 # Determine branch URL based on live type 471 # Determine branch URL based on live type
490 local branch_prefix 472 local branch_prefix
491 case ${PV} in 473 case ${PV} in
492 9999*) 474 4.9999*)
493 # trunk 475 # trunk
494 branch_prefix="trunk/KDE" 476 branch_prefix="trunk/KDE"
495 ;; 477 ;;
496 *) 478 *)
497 # branch 479 # branch
574 else 556 else
575 _kmname=${PN} 557 _kmname=${PN}
576 fi 558 fi
577 559
578 # default branching 560 # default branching
579 [[ ${PV} != 9999* && ${KDEBASE} == kde-base ]] && \ 561 [[ ${PV} != 4.9999* && ${KDEBASE} == kde-base ]] && \
580 EGIT_BRANCH="KDE/$(get_kde_version)" 562 EGIT_BRANCH="KDE/$(get_kde_version)"
581 563
582 # default repo uri 564 # default repo uri
583 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}" 565 EGIT_REPO_URI+=( "${EGIT_MIRROR}/${_kmname}" )
584 566
585 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}" 567 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
586 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" 568 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
587 ;; 569 ;;
588 esac 570 esac
617 599
618 # Check if gcc compiler is fresh enough. 600 # Check if gcc compiler is fresh enough.
619 # In theory should be in pkg_pretend but we check it only for kdelibs there 601 # In theory should be in pkg_pretend but we check it only for kdelibs there
620 # and for others we do just quick scan in pkg_setup because pkg_pretend 602 # and for others we do just quick scan in pkg_setup because pkg_pretend
621 # executions consume quite some time. 603 # executions consume quite some time.
622 # We can only do this for EAPI 4 or later because the MERGE_TYPE variable
623 # is otherwise undefined.
624 if [[ ${EAPI:-0} != 3 ]]; then
625 if [[ ${MERGE_TYPE} != binary ]]; then 604 if [[ ${MERGE_TYPE} != binary ]]; then
626 [[ $(gcc-major-version) -lt 4 ]] || \ 605 [[ $(gcc-major-version) -lt 4 ]] || \
627 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ 606 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 6 ]] ) \
628 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)." 607 && die "Sorry, but gcc-4.6 and earlier wont work for some KDE packages."
629 fi
630 fi 608 fi
631 609
632 KDEDIR=/usr 610 KDEDIR=/usr
633 : ${PREFIX:=/usr} 611 : ${PREFIX:=/usr}
634 EKDEDIR=${EPREFIX}/usr 612 EKDEDIR=${EPREFIX}/usr
647 debug-print-function ${FUNCNAME} "$@" 625 debug-print-function ${FUNCNAME} "$@"
648 626
649 if [[ ${KDE_BUILD_TYPE} = live ]]; then 627 if [[ ${KDE_BUILD_TYPE} = live ]]; then
650 case ${KDE_SCM} in 628 case ${KDE_SCM} in
651 svn) 629 svn)
652 migrate_store_dir
653 subversion_src_unpack 630 subversion_src_unpack
654 ;; 631 ;;
655 git) 632 git)
656 git-2_src_unpack 633 git-r3_src_unpack
657 ;; 634 ;;
658 esac 635 esac
659 else 636 else
660 unpack ${A} 637 unpack ${A}
661 fi 638 fi
704 case ${KDE_SCM} in 681 case ${KDE_SCM} in
705 svn) subversion_src_prepare ;; 682 svn) subversion_src_prepare ;;
706 esac 683 esac
707 fi 684 fi
708 685
709 # Apply patches 686 # Apply patches, cmake-utils does the job already
710 base_src_prepare 687 cmake-utils_src_prepare
711 688
712 # Save library dependencies 689 # Save library dependencies
713 if [[ -n ${KMSAVELIBS} ]] ; then 690 if [[ -n ${KMSAVELIBS} ]] ; then
714 save_library_dependencies 691 save_library_dependencies
715 fi 692 fi
800 kded4 2>&1 > /dev/null & 777 kded4 2>&1 > /dev/null &
801 kded4_pid=$! 778 kded4_pid=$!
802 fi 779 fi
803 780
804 cmake-utils_src_test 781 cmake-utils_src_test
805 } 782 }
806 783
807 # When run as normal user during ebuild development with the ebuild command, the 784 # When run as normal user during ebuild development with the ebuild command, the
808 # kde tests tend to access the session DBUS. This however is not possible in a real 785 # kde tests tend to access the session DBUS. This however is not possible in a real
809 # emerge or on the tinderbox. 786 # emerge or on the tinderbox.
810 # > make sure it does not happen, so bad tests can be recognized and disabled 787 # > make sure it does not happen, so bad tests can be recognized and disabled
861 done 838 done
862 fi 839 fi
863 840
864 cmake-utils_src_install 841 cmake-utils_src_install
865 842
866 # In EAPI 4+, we don't want ${PREFIX}/share/doc/HTML to be compressed, 843 # We don't want ${PREFIX}/share/doc/HTML to be compressed,
867 # because then khelpcenter can't find the docs 844 # because then khelpcenter can't find the docs
868 [[ ${EAPI:-0} != 3 && -d ${ED}/${PREFIX}/share/doc/HTML ]] && 845 [[ -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
869 docompress -x ${PREFIX}/share/doc/HTML 846 docompress -x ${PREFIX}/share/doc/HTML
870} 847}
871 848
872# @FUNCTION: kde4-base_pkg_preinst 849# @FUNCTION: kde4-base_pkg_preinst
873# @DESCRIPTION: 850# @DESCRIPTION:

Legend:
Removed from v.1.126  
changed lines
  Added in v.1.140

  ViewVC Help
Powered by ViewVC 1.1.20