/[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.88 Revision 1.93
1# Copyright 1999-2010 Gentoo Foundation 1# Copyright 1999-2010 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.88 2011/04/21 20:01:23 dilfridge Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.93 2011/05/23 22:56:36 abcd 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
18# For proper description see virtualx.eclass manpage. 18# For proper description see virtualx.eclass manpage.
19# Here we redefine default value to be manual, if your package needs virtualx 19# Here we redefine default value to be manual, if your package needs virtualx
20# for tests you should proceed with setting VIRTUALX_REQUIRED=test. 20# for tests you should proceed with setting VIRTUALX_REQUIRED=test.
21: ${VIRTUALX_REQUIRED:=manual} 21: ${VIRTUALX_REQUIRED:=manual}
22 22
23inherit kde4-functions fdo-mime gnome2-utils base virtualx versionator eutils 23inherit kde4-functions toolchain-funcs fdo-mime gnome2-utils base virtualx versionator eutils
24 24
25if [[ ${BUILD_TYPE} = live ]]; then 25if [[ ${BUILD_TYPE} = live ]]; then
26 case ${KDE_SCM} in 26 case ${KDE_SCM} in
27 svn) inherit subversion ;; 27 svn) inherit subversion ;;
28 git) inherit git ;; 28 git) inherit git-2 ;;
29 esac 29 esac
30fi 30fi
31 31
32# @ECLASS-VARIABLE: CMAKE_REQUIRED 32# @ECLASS-VARIABLE: CMAKE_REQUIRED
33# @DESCRIPTION: 33# @DESCRIPTION:
165# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE 165# @ECLASS-VARIABLE: KDE_LINGUAS_LIVE_OVERRIDE
166# @DESCRIPTION: 166# @DESCRIPTION:
167# Set this varible if you want your live package to manage its 167# Set this varible if you want your live package to manage its
168# translations. (Mostly all kde ebuilds does not ship documentation 168# translations. (Mostly all kde ebuilds does not ship documentation
169# and translations in live ebuilds) 169# and translations in live ebuilds)
170if [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} && ${KDEBASE} != "kde-base" ]]; then 170if [[ ${BUILD_TYPE} == live && -z ${KDE_LINGUAS_LIVE_OVERRIDE} ]]; then
171 KDE_HANDBOOK=never 171 # Kdebase actualy provides the handbooks even for live stuff
172 [[ ${KDEBASE} == kde-base ]] || KDE_HANDBOOK=never
172 KDE_LINGUAS="" 173 KDE_LINGUAS=""
173fi 174fi
174 175
175# Setup packages inheriting this eclass 176# Setup packages inheriting this eclass
176case ${KDEBASE} in 177case ${KDEBASE} in
334 >=x11-libs/qt-test-${QT_MINIMAL}:4 335 >=x11-libs/qt-test-${QT_MINIMAL}:4
335 !aqua? ( 336 !aqua? (
336 x11-libs/libXext 337 x11-libs/libXext
337 x11-libs/libXt 338 x11-libs/libXt
338 x11-libs/libXxf86vm 339 x11-libs/libXxf86vm
340 x11-libs/libXcomposite
339 ) 341 )
340" 342"
341 343
342if [[ ${PN} != kdelibs ]]; then 344if [[ ${PN} != kdelibs ]]; then
343 kdecommondepend+=" $(add_kdebase_dep kdelibs)" 345 kdecommondepend+=" $(add_kdebase_dep kdelibs)"
374# all packages needs oxygen icons for basic iconset 376# all packages needs oxygen icons for basic iconset
375if [[ ${PN} != oxygen-icons ]]; then 377if [[ ${PN} != oxygen-icons ]]; then
376 kderdepend+=" $(add_kdebase_dep oxygen-icons)" 378 kderdepend+=" $(add_kdebase_dep oxygen-icons)"
377fi 379fi
378 380
379# add a dependency over kde-l10n if EAPI4 is around 381# add a dependency over kde-l10n if EAPI4 or better is around
380if [[ ${KDEBASE} != "kde-base" ]] && [[ -n ${KDE_LINGUAS} ]] && has "${EAPI:-0}" 4; then 382if [[ ${KDEBASE} != "kde-base" && -n ${KDE_LINGUAS} && ${EAPI:-0} != 3 ]]; then
381 usedep=''
382 for _lingua in ${KDE_LINGUAS}; do 383 for _lingua in ${KDE_LINGUAS}; do
383 [[ -n ${usedep} ]] && usedep+="," 384 # if our package has lignuas, pull in kde-l10n with selected lingua enabled,
384 usedep+="linguas_${_lingua}(+)?" 385 # but only for selected ones.
386 # this can't be done on one line because if user doesn't use any localisation
387 # then he is probably not interested in kde-l10n at all.
388 kderdepend+="
389 linguas_${_lingua}? ( $(add_kdebase_dep kde-l10n "linguas_${_lingua}(+)") )
390 "
385 done 391 done
386 # if our package has lignuas pull in kde-l10n with selected lingua
387 kderdepend+=" $(add_kdebase_dep kde-l10n ${usedep})"
388 unset usedep _lingua 392 unset _lingua
389fi 393fi
390 394
391kdehandbookdepend=" 395kdehandbookdepend="
392 app-text/docbook-xml-dtd:4.2 396 app-text/docbook-xml-dtd:4.2
393 app-text/docbook-xsl-stylesheets 397 app-text/docbook-xsl-stylesheets
463 fi 467 fi
464 _kmname_pv="${_kmname}-${PV}" 468 _kmname_pv="${_kmname}-${PV}"
465 case ${KDEBASE} in 469 case ${KDEBASE} in
466 kde-base) 470 kde-base)
467 case ${PV} in 471 case ${PV} in
468 4.[456].8[05] | 4.[456].9[023568] | 4.5.94.1) 472 4.[456].8[05] | 4.[456].9[023568])
469 # Unstable KDE SC releases 473 # Unstable KDE SC releases
470 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" 474 SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2"
471 # KDEPIM IS SPECIAL 475 # KDEPIM IS SPECIAL
472 [[ ${KMNAME} == "kdepim" || ${KMNAME} == "kdepim-runtime" ]] && SRC_URI="mirror://kde/unstable/kdepim/${PV}/src/${_kmname_pv}.tar.bz2" 476 [[ ${KMNAME} == "kdepim" || ${KMNAME} == "kdepim-runtime" ]] && SRC_URI="mirror://kde/unstable/kdepim/${PV}/${_kmname_pv}.tar.bz2"
473 ;; 477 ;;
474 4.4.[6789] | 4.4.1?*) 478 4.4.[6789] | 4.4.1?*)
475 # Stable kdepim releases 479 # Stable kdepim releases
476 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2" 480 SRC_URI="mirror://kde/stable/kdepim-${PV}/src/${_kmname_pv}.tar.bz2"
477 ;; 481 ;;
603 *) EGIT_BRANCH="KDE/${SLOT}" ;; 607 *) EGIT_BRANCH="KDE/${SLOT}" ;;
604 esac 608 esac
605 ;; 609 ;;
606 esac 610 esac
607 611
608 case $_kmname in
609 kdepim|kdepim-runtime)
610 case ${PV} in
611 # kdepim still did not branch
612 4.6.9999)
613 EGIT_BRANCH="master"
614 ;;
615 esac
616 ;;
617 esac
618 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}" 612 EGIT_REPO_URI="${EGIT_MIRROR}/${_kmname}"
619 EGIT_PROJECT="${_kmname}"
620 613
621 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}" 614 debug-print "${FUNCNAME}: Repository: ${EGIT_REPO_URI}"
622 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}" 615 debug-print "${FUNCNAME}: Branch: ${EGIT_BRANCH}"
623 ;; 616 ;;
624 esac 617 esac
647 # QA ebuilds 640 # QA ebuilds
648 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." 641 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
649 642
650 # Don't set KDEHOME during compilation, it will cause access violations 643 # Don't set KDEHOME during compilation, it will cause access violations
651 unset KDEHOME 644 unset KDEHOME
645
646 # Check if gcc compiler is fresh enough.
647 # In theory should be in pkg_pretend but we check it only for kdelibs there
648 # and for others we do just quick scan in pkg_setup because pkg_pretend
649 # executions consume quite some time.
650 [[ $(gcc-major-version) -lt 4 ]] || \
651 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \
652 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)."
652 653
653 if [[ ${KDEBASE} = kde-base ]]; then 654 if [[ ${KDEBASE} = kde-base ]]; then
654 if use kdeprefix; then 655 if use kdeprefix; then
655 KDEDIR=/usr/kde/${SLOT} 656 KDEDIR=/usr/kde/${SLOT}
656 else 657 else
705 svn) 706 svn)
706 migrate_store_dir 707 migrate_store_dir
707 subversion_src_unpack 708 subversion_src_unpack
708 ;; 709 ;;
709 git) 710 git)
710 git_src_unpack 711 git-2_src_unpack
711 ;; 712 ;;
712 esac 713 esac
713 else 714 else
714 unpack ${A} 715 unpack ${A}
715 fi 716 fi
739 if [[ ${PN} != kde-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then 740 if [[ ${PN} != kde-l10n && ${PN} != kdepim-l10n && ${PN} != kdelibs ]] && use !handbook; then
740 # documentation in kde4-functions 741 # documentation in kde4-functions
741 : ${KDE_DOC_DIRS:=doc} 742 : ${KDE_DOC_DIRS:=doc}
742 local dir 743 local dir
743 for dir in ${KDE_DOC_DIRS}; do 744 for dir in ${KDE_DOC_DIRS}; do
744 sed -e "/^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 745 sed -e "\!^[[:space:]]*add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
745 -e "/^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 746 -e "\!^[[:space:]]*ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
746 -e "/^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 747 -e "\!^[[:space:]]*macro_optional_add_subdirectory[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
747 -e "/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ 748 -e "\!^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${dir}[[:space:]]*)!s/^/#DONOTCOMPILE /" \
748 -i CMakeLists.txt || die "failed to comment out handbook" 749 -i CMakeLists.txt || die "failed to comment out handbook"
749 done 750 done
750 fi 751 fi
751 else 752 else
752 enable_selected_doc_linguas 753 enable_selected_doc_linguas
934 [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})" 935 [[ -f ${doc} && -s ${doc} ]] && newdoc "${doc}" "$(basename $(dirname ${doc})).$(basename ${doc})"
935 done 936 done
936 fi 937 fi
937 938
938 cmake-utils_src_install 939 cmake-utils_src_install
940
941 # In EAPI 4+, we don't want ${PREFIX}/share/doc/HTML to be compressed,
942 # because then khelpcenter can't find the docs
943 [[ ${EAPI:-0} != 3 && -d ${ED}/${PREFIX}/share/doc/HTML ]] &&
944 docompress -x ${PREFIX}/share/doc/HTML
939} 945}
940 946
941# @FUNCTION: kde4-base_pkg_preinst 947# @FUNCTION: kde4-base_pkg_preinst
942# @DESCRIPTION: 948# @DESCRIPTION:
943# Function storing icon caches 949# Function storing icon caches
972 echo 978 echo
973 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}" 979 einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}"
974 einfo "Use it at your own risk." 980 einfo "Use it at your own risk."
975 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" 981 einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!"
976 echo 982 echo
977 elif [[ ${BUILD_TYPE} != live ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then
978 # warning about kdeprefix for non-live users
979 echo
980 ewarn "WARNING! You have the kdeprefix useflag enabled."
981 ewarn "This setting is strongly discouraged and might lead to potential trouble"
982 ewarn "with KDE update strategies."
983 ewarn "You are using this setup at your own risk and the kde team does not"
984 ewarn "take responsibilities for dead kittens."
985 echo
986 fi 983 fi
987 # for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta 984 # for all 3rd party soft tell user that he SHOULD install kdebase-startkde or kdebase-runtime-meta
988 if [[ ${KDEBASE} != kde-base ]] && \ 985 if [[ ${KDEBASE} != kde-base ]] && \
989 ! has_version 'kde-base/kdebase-runtime-meta' && \ 986 ! has_version 'kde-base/kdebase-runtime-meta' && \
990 ! has_version 'kde-base/kdebase-startkde'; then 987 ! has_version 'kde-base/kdebase-startkde'; then
995 ewarn "With this setting you are unsupported by KDE team." 992 ewarn "With this setting you are unsupported by KDE team."
996 ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID." 993 ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID."
997 fi 994 fi
998 fi 995 fi
999 fi 996 fi
997 if has kdeprefix ${IUSE//+} && use kdeprefix; then
998 # warning about kdeprefix
999 echo
1000 ewarn "WARNING! You have the kdeprefix useflag enabled."
1001 eerror "This setting will be removed on or about 2011-06-06."
1002 ewarn "You are using this setup at your own risk and the kde team does not"
1003 ewarn "take responsibilities for dead kittens."
1004 echo
1005 fi
1000} 1006}
1001 1007
1002# @FUNCTION: kde4-base_pkg_postrm 1008# @FUNCTION: kde4-base_pkg_postrm
1003# @DESCRIPTION: 1009# @DESCRIPTION:
1004# Function to rebuild the KDE System Configuration Cache after an application has been removed. 1010# Function to rebuild the KDE System Configuration Cache after an application has been removed.

Legend:
Removed from v.1.88  
changed lines
  Added in v.1.93

  ViewVC Help
Powered by ViewVC 1.1.20