/[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.124 Revision 1.143
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.124 2013/03/03 00:22:56 pesa Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.143 2014/11/13 04:19:51 kensington 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
16if [[ -z ${_KDE4_BASE_ECLASS} ]]; then
17_KDE4_BASE_ECLASS=1
15 18
16# @ECLASS-VARIABLE: KDE_SELINUX_MODULE 19# @ECLASS-VARIABLE: KDE_SELINUX_MODULE
17# @DESCRIPTION: 20# @DESCRIPTION:
18# If set to "none", do nothing. 21# If set to "none", do nothing.
19# 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
29# For proper description see virtualx.eclass manpage. 32# For proper description see virtualx.eclass manpage.
30# 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
31# for tests you should proceed with setting VIRTUALX_REQUIRED=test. 34# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
32: ${VIRTUALX_REQUIRED:=manual} 35: ${VIRTUALX_REQUIRED:=manual}
33 36
34inherit 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
35 38
36if [[ ${KDE_BUILD_TYPE} = live ]]; then 39if [[ ${KDE_BUILD_TYPE} = live ]]; then
37 case ${KDE_SCM} in 40 case ${KDE_SCM} in
38 svn) inherit subversion ;; 41 svn) inherit subversion ;;
39 git) inherit git-2 ;; 42 git) inherit git-r3 ;;
40 esac 43 esac
41fi 44fi
42 45
43# @ECLASS-VARIABLE: CMAKE_REQUIRED 46# @ECLASS-VARIABLE: CMAKE_REQUIRED
44# @DESCRIPTION: 47# @DESCRIPTION:
61KDE_MINIMAL="${KDE_MINIMAL:-4.4}" 64KDE_MINIMAL="${KDE_MINIMAL:-4.4}"
62 65
63# Set slot for KDEBASE known packages 66# Set slot for KDEBASE known packages
64case ${KDEBASE} in 67case ${KDEBASE} in
65 kde-base) 68 kde-base)
69 case ${EAPI} in
70 5)
71 SLOT=4/$(get_version_component_range 1-2)
72 ;;
73 *)
66 SLOT=4 74 SLOT=4
75 ;;
76 esac
67 KDE_MINIMAL="${PV}" 77 KDE_MINIMAL="${PV}"
68 ;; 78 ;;
69 kdevelop) 79 kdevelop)
70 if [[ ${KDE_BUILD_TYPE} = live ]]; then 80 if [[ ${KDE_BUILD_TYPE} = live ]]; then
71 # @ECLASS-VARIABLE: KDEVELOP_VERSION 81 # @ECLASS-VARIABLE: KDEVELOP_VERSION
72 # @DESCRIPTION: 82 # @DESCRIPTION:
73 # 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.
74 # Applies to KDEBASE=kdevelop only. 84 # Applies to KDEBASE=kdevelop only.
75 KDEVELOP_VERSION="${KDEVELOP_VERSION:-9999}" 85 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.9999}"
76 # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION 86 # @ECLASS-VARIABLE: KDEVPLATFORM_VERSION
77 # @DESCRIPTION: 87 # @DESCRIPTION:
78 # 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.
79 # Applies to KDEBASE=kdevelop only. 89 # Applies to KDEBASE=kdevelop only.
80 KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-9999}" 90 KDEVPLATFORM_VERSION="${KDEVPLATFORM_VERSION:-4.9999}"
81 else 91 else
82 case ${PN} in 92 case ${PN} in
83 kdevelop|quanta) 93 kdevelop)
84 KDEVELOP_VERSION=${PV} 94 KDEVELOP_VERSION=${PV}
85 KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)" 95 KDEVPLATFORM_VERSION="$(($(get_major_version)-3)).$(get_after_major_version)"
86 ;; 96 ;;
87 kdevplatform|kdevelop-php*) 97 kdevplatform|kdevelop-php*|kdevelop-python)
88 KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)" 98 KDEVELOP_VERSION="$(($(get_major_version)+3)).$(get_after_major_version)"
89 KDEVPLATFORM_VERSION=${PV} 99 KDEVPLATFORM_VERSION=${PV}
90 ;; 100 ;;
91 *) 101 *)
92 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}" 102 KDEVELOP_VERSION="${KDEVELOP_VERSION:-4.0.0}"
174 184
175 # This code is to prevent portage from searching GENTOO_MIRRORS for 185 # This code is to prevent portage from searching GENTOO_MIRRORS for
176 # packages that will never be mirrored. (As they only will ever be in 186 # packages that will never be mirrored. (As they only will ever be in
177 # the overlay). 187 # the overlay).
178 case ${PV} in 188 case ${PV} in
179 *9999* | 4.?.[6-9]?) 189 *9999* | 4.?.[6-9]? | 4.??.[6-9]?)
180 RESTRICT+=" mirror" 190 RESTRICT+=" mirror"
181 ;; 191 ;;
182 esac 192 esac
183 ;; 193 ;;
184 kdevelop) 194 kdevelop)
188esac 198esac
189 199
190# @ECLASS-VARIABLE: QT_MINIMAL 200# @ECLASS-VARIABLE: QT_MINIMAL
191# @DESCRIPTION: 201# @DESCRIPTION:
192# Determine version of qt we enforce as minimal for the package. 202# Determine version of qt we enforce as minimal for the package.
193if version_is_at_least 4.8.50 "${KDE_MINIMAL}"; then
194 # Upstream has added an *undeclared* dependency on Qt 4.8...
195 QT_MINIMAL="${QT_MINIMAL:-4.8.0}" 203QT_MINIMAL="${QT_MINIMAL:-4.8.5}"
196else
197 QT_MINIMAL="${QT_MINIMAL:-4.7.4}"
198fi
199 204
200# Declarative dependencies 205# Declarative dependencies
201qtdeclarativedepend=" 206qtdeclarativedepend="
202 >=dev-qt/qtdeclarative-${QT_MINIMAL}:4 207 >=dev-qt/qtdeclarative-${QT_MINIMAL}:4
203" 208"
281kdecommondepend=" 286kdecommondepend="
282 dev-lang/perl 287 dev-lang/perl
283 >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility] 288 >=dev-qt/qt3support-${QT_MINIMAL}:4[accessibility]
284 >=dev-qt/qtcore-${QT_MINIMAL}:4[qt3support,ssl] 289 >=dev-qt/qtcore-${QT_MINIMAL}:4[qt3support,ssl]
285 >=dev-qt/qtdbus-${QT_MINIMAL}:4 290 >=dev-qt/qtdbus-${QT_MINIMAL}:4
291 >=dev-qt/designer-${QT_MINIMAL}:4[-phonon]
286 >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus] 292 >=dev-qt/qtgui-${QT_MINIMAL}:4[accessibility,dbus(+)]
287 >=dev-qt/qtscript-${QT_MINIMAL}:4 293 >=dev-qt/qtscript-${QT_MINIMAL}:4
288 >=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support] 294 >=dev-qt/qtsql-${QT_MINIMAL}:4[qt3support]
289 >=dev-qt/qtsvg-${QT_MINIMAL}:4 295 >=dev-qt/qtsvg-${QT_MINIMAL}:4
290 >=dev-qt/qttest-${QT_MINIMAL}:4 296 >=dev-qt/qttest-${QT_MINIMAL}:4
291 >=dev-qt/qtwebkit-${QT_MINIMAL}:4 297 >=dev-qt/qtwebkit-${QT_MINIMAL}:4
292 !aqua? (
293 x11-libs/libXext
294 x11-libs/libXt
295 x11-libs/libXxf86vm
296 x11-libs/libXcomposite
297 x11-libs/libxkbfile
298 )
299" 298"
300 299
301if [[ ${PN} != kdelibs ]]; then 300if [[ ${PN} != kdelibs ]]; then
302 kdecommondepend+=" $(add_kdebase_dep kdelibs)" 301 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
303 if [[ ${KDEBASE} = kdevelop ]]; then 302 if [[ ${KDEBASE} = kdevelop ]]; then
308 # Applies to KDEBASE=kdevelop only. 307 # Applies to KDEBASE=kdevelop only.
309 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}" 308 KDEVPLATFORM_REQUIRED="${KDEVPLATFORM_REQUIRED:-always}"
310 case ${KDEVPLATFORM_REQUIRED} in 309 case ${KDEVPLATFORM_REQUIRED} in
311 always) 310 always)
312 kdecommondepend+=" 311 kdecommondepend+="
313 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION} 312 >=dev-util/kdevplatform-${KDEVPLATFORM_VERSION}:4
314 " 313 "
315 ;; 314 ;;
316 *) ;; 315 *) ;;
317 esac 316 esac
318 fi 317 fi
333# all packages needs oxygen icons for basic iconset 332# all packages needs oxygen icons for basic iconset
334if [[ ${PN} != oxygen-icons ]]; then 333if [[ ${PN} != oxygen-icons ]]; then
335 kderdepend+=" $(add_kdebase_dep oxygen-icons)" 334 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
336fi 335fi
337 336
338# add a dependency over kde-l10n if EAPI4 or better is around 337# add a dependency over kde-l10n
339if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} && ${EAPI:-0} != 3 ]]; then 338if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} ]]; then
340 for _lingua in ${KDE_LINGUAS}; do 339 for _lingua in ${KDE_LINGUAS}; do
341 # 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,
342 # but only for selected ones. 341 # but only for selected ones.
343 # 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
344 # then he is probably not interested in kde-l10n at all. 343 # then he is probably not interested in kde-l10n at all.
420 # we calculate URI only for known KDEBASE modules 419 # we calculate URI only for known KDEBASE modules
421 [[ -n ${KDEBASE} ]] || return 420 [[ -n ${KDEBASE} ]] || return
422 421
423 # calculate tarball module name 422 # calculate tarball module name
424 if [[ -n ${KMNAME} ]]; then 423 if [[ -n ${KMNAME} ]]; then
425 # fixup kdebase-apps name
426 case ${KMNAME} in
427 kdebase-apps)
428 _kmname="kdebase" ;;
429 *)
430 _kmname="${KMNAME}" ;; 424 _kmname="${KMNAME}"
431 esac
432 else 425 else
433 _kmname=${PN} 426 _kmname=${PN}
434 fi 427 fi
435 _kmname_pv="${_kmname}-${PV}" 428 _kmname_pv="${_kmname}-${PV}"
436 case ${KDEBASE} in 429 case ${KDEBASE} in
444 # Unstable KDE SC releases 437 # Unstable KDE SC releases
445 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;; 438 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.xz" ;;
446 4.[1-7].[12345]) 439 4.[1-7].[12345])
447 # Stable KDE SC with old .bz2 support 440 # Stable KDE SC with old .bz2 support
448 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.11)
446 # Part of 4.13 actually, sigh. Not stable for next release!
447 SRC_URI="mirror://kde/stable/4.13.3/src/${_kmname_pv}.tar.xz" ;;
448 4.11.12)
449 # Part of 4.14 actually, sigh. Not stable for next release!
450 SRC_URI="mirror://kde/stable/4.14.1/src/${_kmname_pv}.tar.xz" ;;
451 4.11.13)
452 # Part of 4.14 actually, sigh. Not stable for next release!
453 SRC_URI="mirror://kde/stable/4.14.2/src/${_kmname_pv}.tar.xz" ;;
454 4.11.14)
455 # Part of 4.14 actually, sigh. Not stable for next release!
456 SRC_URI="mirror://kde/stable/4.14.3/src/${_kmname_pv}.tar.xz" ;;
449 *) 457 *)
450 # Stable KDE SC releases 458 # Stable KDE SC releases
451 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;; 459 SRC_URI="mirror://kde/stable/${PV}/src/${_kmname_pv}.tar.xz" ;;
452 esac 460 esac
453 ;; 461 ;;
467 case ${KDE_SCM} in 475 case ${KDE_SCM} in
468 svn) 476 svn)
469 # Determine branch URL based on live type 477 # Determine branch URL based on live type
470 local branch_prefix 478 local branch_prefix
471 case ${PV} in 479 case ${PV} in
472 9999*) 480 4.9999*)
473 # trunk 481 # trunk
474 branch_prefix="trunk/KDE" 482 branch_prefix="trunk/KDE"
475 ;; 483 ;;
476 *) 484 *)
477 # branch 485 # branch
554 else 562 else
555 _kmname=${PN} 563 _kmname=${PN}
556 fi 564 fi
557 565
558 # default branching 566 # default branching
559 [[ ${PV} != 9999* && ${KDEBASE} == kde-base ]] && \ 567 [[ ${PV} != 4.9999* && ${KDEBASE} == kde-base ]] && \
560 EGIT_BRANCH="KDE/$(get_kde_version)" 568 EGIT_BRANCH="KDE/$(get_kde_version)"
561 569
562 # default repo uri 570 # default repo uri
563 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}" 571 EGIT_REPO_URI+=( "${EGIT_MIRROR}/${_kmname}" )
564 572
565 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}" 573 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
566 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" 574 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
567 ;; 575 ;;
568 esac 576 esac
596 unset KDEHOME 604 unset KDEHOME
597 605
598 # Check if gcc compiler is fresh enough. 606 # Check if gcc compiler is fresh enough.
599 # In theory should be in pkg_pretend but we check it only for kdelibs there 607 # In theory should be in pkg_pretend but we check it only for kdelibs there
600 # and for others we do just quick scan in pkg_setup because pkg_pretend 608 # and for others we do just quick scan in pkg_setup because pkg_pretend
601 # executions consume quite some time. 609 # executions consume quite some time (ie. when merging 300 packages at once will cause 300 checks)
602 # We can only do this for EAPI 4 or later because the MERGE_TYPE variable
603 # is otherwise undefined.
604 if [[ ${EAPI:-0} != 3 ]]; then
605 if [[ ${MERGE_TYPE} != binary ]]; then 610 if [[ ${MERGE_TYPE} != binary ]]; then
606 [[ $(gcc-major-version) -lt 4 ]] || \ 611 [[ $(gcc-major-version) -lt 4 ]] || \
607 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ 612 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 6 ]] ) \
608 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)." 613 && die "Sorry, but gcc-4.6 and earlier wont work for some KDE packages."
609 fi
610 fi 614 fi
611 615
612 KDEDIR=/usr 616 KDEDIR=/usr
613 : ${PREFIX:=/usr} 617 : ${PREFIX:=/usr}
614 EKDEDIR=${EPREFIX}/usr 618 EKDEDIR=${EPREFIX}/usr
627 debug-print-function ${FUNCNAME} "$@" 631 debug-print-function ${FUNCNAME} "$@"
628 632
629 if [[ ${KDE_BUILD_TYPE} = live ]]; then 633 if [[ ${KDE_BUILD_TYPE} = live ]]; then
630 case ${KDE_SCM} in 634 case ${KDE_SCM} in
631 svn) 635 svn)
632 migrate_store_dir
633 subversion_src_unpack 636 subversion_src_unpack
634 ;; 637 ;;
635 git) 638 git)
636 git-2_src_unpack 639 git-r3_src_unpack
637 ;; 640 ;;
638 esac 641 esac
639 else 642 else
640 unpack ${A} 643 unpack ${A}
641 fi 644 fi
684 case ${KDE_SCM} in 687 case ${KDE_SCM} in
685 svn) subversion_src_prepare ;; 688 svn) subversion_src_prepare ;;
686 esac 689 esac
687 fi 690 fi
688 691
689 # Apply patches 692 # Apply patches, cmake-utils does the job already
690 base_src_prepare 693 cmake-utils_src_prepare
691 694
692 # Save library dependencies 695 # Save library dependencies
693 if [[ -n ${KMSAVELIBS} ]] ; then 696 if [[ -n ${KMSAVELIBS} ]] ; then
694 save_library_dependencies 697 save_library_dependencies
695 fi 698 fi
780 kded4 2>&1 > /dev/null & 783 kded4 2>&1 > /dev/null &
781 kded4_pid=$! 784 kded4_pid=$!
782 fi 785 fi
783 786
784 cmake-utils_src_test 787 cmake-utils_src_test
785 } 788 }
786 789
787 # When run as normal user during ebuild development with the ebuild command, the 790 # When run as normal user during ebuild development with the ebuild command, the
788 # kde tests tend to access the session DBUS. This however is not possible in a real 791 # kde tests tend to access the session DBUS. This however is not possible in a real
789 # emerge or on the tinderbox. 792 # emerge or on the tinderbox.
790 # > make sure it does not happen, so bad tests can be recognized and disabled 793 # > make sure it does not happen, so bad tests can be recognized and disabled
841 done 844 done
842 fi 845 fi
843 846
844 cmake-utils_src_install 847 cmake-utils_src_install
845 848
846 # In EAPI 4+, we don't want ${PREFIX}/share/doc/HTML to be compressed, 849 # We don't want ${PREFIX}/share/doc/HTML to be compressed,
847 # because then khelpcenter can't find the docs 850 # because then khelpcenter can't find the docs
848 [[ ${EAPI:-0} != 3 && -d ${ED}/${PREFIX}/share/doc/HTML ]] && 851 [[ -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
849 docompress -x ${PREFIX}/share/doc/HTML 852 docompress -x ${PREFIX}/share/doc/HTML
850} 853}
851 854
852# @FUNCTION: kde4-base_pkg_preinst 855# @FUNCTION: kde4-base_pkg_preinst
853# @DESCRIPTION: 856# @DESCRIPTION:
904 gnome2_icon_cache_update 907 gnome2_icon_cache_update
905 fdo-mime_desktop_database_update 908 fdo-mime_desktop_database_update
906 fdo-mime_mime_database_update 909 fdo-mime_mime_database_update
907 buildsycoca 910 buildsycoca
908} 911}
912
913fi

Legend:
Removed from v.1.124  
changed lines
  Added in v.1.143

  ViewVC Help
Powered by ViewVC 1.1.20