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.95 2011/06/06 18:42:55 abcd Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.96 2011/06/06 21:38:18 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 |
… | |
… | |
173 | HOMEPAGE="http://www.kde.org/" |
173 | HOMEPAGE="http://www.kde.org/" |
174 | LICENSE="GPL-2" |
174 | LICENSE="GPL-2" |
175 | if [[ $BUILD_TYPE = live ]]; then |
175 | if [[ $BUILD_TYPE = live ]]; then |
176 | # Disable tests for live ebuilds |
176 | # Disable tests for live ebuilds |
177 | RESTRICT+=" test" |
177 | RESTRICT+=" test" |
178 | # Live ebuilds in kde-base default to kdeprefix by default |
178 | fi |
179 | IUSE+=" +kdeprefix" |
179 | |
180 | else |
180 | # Only add the kdeprefix USE flag for older versions, to help |
181 | # All other ebuild types default to -kdeprefix as before |
181 | # non-portage package managers handle the upgrade |
|
|
182 | if [[ ${PV} < 4.6.4 ]]; then |
182 | IUSE+=" kdeprefix" |
183 | IUSE+=" kdeprefix" |
183 | fi |
184 | fi |
|
|
185 | |
184 | # This code is to prevent portage from searching GENTOO_MIRRORS for |
186 | # This code is to prevent portage from searching GENTOO_MIRRORS for |
185 | # packages that will never be mirrored. (As they only will ever be in |
187 | # packages that will never be mirrored. (As they only will ever be in |
186 | # the overlay). |
188 | # the overlay). |
187 | case ${PV} in |
189 | case ${PV} in |
188 | *9999* | 4.?.[6-9]?) |
190 | *9999* | 4.?.[6-9]?) |
… | |
… | |
613 | # kde-base packages go into KDE4 installation directory (KDEDIR) by default. |
615 | # kde-base packages go into KDE4 installation directory (KDEDIR) by default. |
614 | # No matter the PREFIX, package will be built against KDE installed in KDEDIR. |
616 | # No matter the PREFIX, package will be built against KDE installed in KDEDIR. |
615 | |
617 | |
616 | # @FUNCTION: kde4-base_pkg_setup |
618 | # @FUNCTION: kde4-base_pkg_setup |
617 | # @DESCRIPTION: |
619 | # @DESCRIPTION: |
618 | # Do the basic kdeprefix KDEDIR settings and determine with which kde should |
620 | # Do the basic KDEDIR settings and determine with which kde should |
619 | # optional applications link |
621 | # optional applications link |
620 | kde4-base_pkg_setup() { |
622 | kde4-base_pkg_setup() { |
621 | debug-print-function ${FUNCNAME} "$@" |
623 | debug-print-function ${FUNCNAME} "$@" |
622 | |
624 | |
623 | if has kdeprefix ${IUSE//+} && use kdeprefix; then |
625 | if has kdeprefix ${IUSE//+} && use kdeprefix; then |
… | |
… | |
646 | # executions consume quite some time. |
648 | # executions consume quite some time. |
647 | [[ $(gcc-major-version) -lt 4 ]] || \ |
649 | [[ $(gcc-major-version) -lt 4 ]] || \ |
648 | ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ |
650 | ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ |
649 | && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)." |
651 | && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)." |
650 | |
652 | |
651 | if [[ ${KDEBASE} = kde-base ]]; then |
|
|
652 | if use kdeprefix; then |
|
|
653 | KDEDIR=/usr/kde/${SLOT} |
|
|
654 | else |
|
|
655 | KDEDIR=/usr |
653 | KDEDIR=/usr |
656 | fi |
|
|
657 | : ${PREFIX:=${KDEDIR}} |
|
|
658 | else |
|
|
659 | # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL |
|
|
660 | KDEDIR= |
|
|
661 | local kde_minimal_met |
|
|
662 | for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do |
|
|
663 | [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1 |
|
|
664 | if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then |
|
|
665 | if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then |
|
|
666 | KDEDIR=/usr/kde/${slot} |
|
|
667 | else |
|
|
668 | KDEDIR=/usr |
|
|
669 | fi |
|
|
670 | break; |
|
|
671 | fi |
|
|
672 | done |
|
|
673 | unset slot |
|
|
674 | |
|
|
675 | # Bail out if kdelibs required but not found |
|
|
676 | if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then |
|
|
677 | [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!" |
|
|
678 | else |
|
|
679 | [[ -z ${KDEDIR} ]] && KDEDIR=/usr |
|
|
680 | fi |
|
|
681 | |
|
|
682 | : ${PREFIX:=/usr} |
654 | : ${PREFIX:=/usr} |
683 | fi |
655 | EKDEDIR=${EPREFIX}/usr |
684 | EKDEDIR=${EPREFIX}${KDEDIR} |
|
|
685 | |
656 | |
686 | # Point pkg-config path to KDE *.pc files |
657 | # Point pkg-config path to KDE *.pc files |
687 | export PKG_CONFIG_PATH="${EKDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" |
658 | export PKG_CONFIG_PATH="${EKDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" |
688 | # Point to correct QT plugins path |
659 | # Point to correct QT plugins path |
689 | QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/" |
660 | QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/" |
… | |
… | |
830 | QTEST_COLORED=1 |
801 | QTEST_COLORED=1 |
831 | |
802 | |
832 | # Shadow existing /usr installations |
803 | # Shadow existing /usr installations |
833 | unset KDEDIRS |
804 | unset KDEDIRS |
834 | |
805 | |
835 | # Handle kdeprefix-ed KDE |
|
|
836 | if [[ ${KDEDIR} != /usr ]]; then |
|
|
837 | # Override some environment variables - only when kdeprefix is different, |
|
|
838 | # to not break ccache/distcc |
|
|
839 | PATH="${EKDEDIR}/bin:${PATH}" |
|
|
840 | |
|
|
841 | # Append library search path |
|
|
842 | append-ldflags -L"${EKDEDIR}/$(get_libdir)" |
|
|
843 | |
|
|
844 | # Append full RPATH |
|
|
845 | cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF) |
|
|
846 | |
|
|
847 | # Set cmake prefixes to allow buildsystem to locate valid KDE installation |
|
|
848 | # when more are present |
|
|
849 | cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${EKDEDIR}") |
|
|
850 | fi |
|
|
851 | |
|
|
852 | #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling |
806 | #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling |
853 | tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/lib/qt4) |
807 | tc-is-cross-compiler && cmakeargs+=(-DQT_LIBRARY_DIR=${ROOT}/usr/$(get_libdir)/qt4) |
854 | #kde-config -path data unavailable when cross-compiling |
808 | #kde-config -path data unavailable when cross-compiling |
855 | tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/) |
809 | tc-is-cross-compiler && cmakeargs+=(-DKDE4_DATA_DIR=${ROOT}/usr/share/apps/) |
856 | |
810 | |
857 | # Handle kdeprefix in application itself |
|
|
858 | if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then |
|
|
859 | # If prefix is /usr, sysconf needs to be /etc, not /usr/etc |
811 | # sysconf needs to be /etc, not /usr/etc |
860 | cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc) |
812 | cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc) |
861 | fi |
|
|
862 | |
813 | |
863 | if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then |
814 | if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then |
864 | mycmakeargs=(${mycmakeargs}) |
815 | mycmakeargs=(${mycmakeargs}) |
865 | fi |
816 | fi |
866 | |
817 | |
… | |
… | |
989 | ewarn "With this setting you are unsupported by KDE team." |
940 | ewarn "With this setting you are unsupported by KDE team." |
990 | ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID." |
941 | ewarn "All missing features you report for misc packages will be probably ignored or closed as INVALID." |
991 | fi |
942 | fi |
992 | fi |
943 | fi |
993 | fi |
944 | fi |
994 | if has kdeprefix ${IUSE//+} && use kdeprefix; then |
|
|
995 | # warning about kdeprefix |
|
|
996 | echo |
|
|
997 | ewarn "WARNING! You have the kdeprefix useflag enabled." |
|
|
998 | eerror "This setting will be removed on or about 2011-06-06." |
|
|
999 | ewarn "You are using this setup at your own risk and the kde team does not" |
|
|
1000 | ewarn "take responsibilities for dead kittens." |
|
|
1001 | echo |
|
|
1002 | fi |
|
|
1003 | } |
945 | } |
1004 | |
946 | |
1005 | # @FUNCTION: kde4-base_pkg_postrm |
947 | # @FUNCTION: kde4-base_pkg_postrm |
1006 | # @DESCRIPTION: |
948 | # @DESCRIPTION: |
1007 | # Function to rebuild the KDE System Configuration Cache after an application has been removed. |
949 | # Function to rebuild the KDE System Configuration Cache after an application has been removed. |