/[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.93 Revision 1.96
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.93 2011/05/23 22:56:36 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
131# @DESCRIPTION: 131# @DESCRIPTION:
132# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'. 132# Is qt-multimedia required? Possible values are 'always', 'optional' and 'never'.
133# This variable must be set before inheriting any eclasses. Defaults to 'never'. 133# This variable must be set before inheriting any eclasses. Defaults to 'never'.
134MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}" 134MULTIMEDIA_REQUIRED="${MULTIMEDIA_REQUIRED:-never}"
135 135
136# @ECLASS-VARIABLE: WEBKIT_REQUIRED
137# @DESCRIPTION:
138# Is qt-webkit requred? Possible values are 'always', 'optional' and 'never'.
139# This variable must be set before inheriting any eclasses. Defaults to 'never'.
140WEBKIT_REQUIRED="${WEBKIT_REQUIRED:-never}"
141
142# @ECLASS-VARIABLE: CPPUNIT_REQUIRED 136# @ECLASS-VARIABLE: CPPUNIT_REQUIRED
143# @DESCRIPTION: 137# @DESCRIPTION:
144# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'. 138# Is cppunit required for tests? Possible values are 'always', 'optional' and 'never'.
145# This variable must be set before inheriting any eclasses. Defaults to 'never'. 139# This variable must be set before inheriting any eclasses. Defaults to 'never'.
146CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}" 140CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
179 HOMEPAGE="http://www.kde.org/" 173 HOMEPAGE="http://www.kde.org/"
180 LICENSE="GPL-2" 174 LICENSE="GPL-2"
181 if [[ $BUILD_TYPE = live ]]; then 175 if [[ $BUILD_TYPE = live ]]; then
182 # Disable tests for live ebuilds 176 # Disable tests for live ebuilds
183 RESTRICT+=" test" 177 RESTRICT+=" test"
184 # Live ebuilds in kde-base default to kdeprefix by default 178 fi
185 IUSE+=" +kdeprefix" 179
186 else 180 # Only add the kdeprefix USE flag for older versions, to help
187 # All other ebuild types default to -kdeprefix as before 181 # non-portage package managers handle the upgrade
182 if [[ ${PV} < 4.6.4 ]]; then
188 IUSE+=" kdeprefix" 183 IUSE+=" kdeprefix"
189 fi 184 fi
185
190 # This code is to prevent portage from searching GENTOO_MIRRORS for 186 # This code is to prevent portage from searching GENTOO_MIRRORS for
191 # 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
192 # the overlay). 188 # the overlay).
193 case ${PV} in 189 case ${PV} in
194 *9999* | 4.?.[6-9]?) 190 *9999* | 4.?.[6-9]?)
278 ;; 274 ;;
279 *) ;; 275 *) ;;
280esac 276esac
281unset qtmultimediadepend 277unset qtmultimediadepend
282 278
283# WebKit dependencies
284case ${KDE_REQUIRED} in
285 always)
286 qtwebkitusedeps="[kde]"
287 ;;
288 optional)
289 qtwebkitusedeps="[kde?]"
290 ;;
291 *) ;;
292esac
293qtwebkitdepend="
294 >=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps}
295"
296unset qtwebkitusedeps
297case ${WEBKIT_REQUIRED} in
298 always)
299 COMMONDEPEND+=" ${qtwebkitdepend}"
300 ;;
301 optional)
302 IUSE+=" webkit"
303 COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )"
304 ;;
305 *) ;;
306esac
307unset qtwebkitdepend
308
309# CppUnit dependencies 279# CppUnit dependencies
310cppuintdepend=" 280cppuintdepend="
311 dev-util/cppunit 281 dev-util/cppunit
312" 282"
313case ${CPPUNIT_REQUIRED} in 283case ${CPPUNIT_REQUIRED} in
320 ;; 290 ;;
321 *) ;; 291 *) ;;
322esac 292esac
323unset cppuintdepend 293unset cppuintdepend
324 294
295
296# WebKit use dependencies
297case ${KDE_REQUIRED} in
298 always)
299 qtwebkitusedeps="[kde]"
300 ;;
301 optional)
302 qtwebkitusedeps="[kde?]"
303 ;;
304 *) ;;
305esac
325# KDE dependencies 306# KDE dependencies
326# Qt accessibility classes are needed in various places, bug 325461 307# Qt accessibility classes are needed in various places, bug 325461
327kdecommondepend=" 308kdecommondepend="
328 dev-lang/perl 309 dev-lang/perl
329 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl] 310 >=x11-libs/qt-core-${QT_MINIMAL}:4[qt3support,ssl]
331 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde] 312 >=x11-libs/qt-qt3support-${QT_MINIMAL}:4[accessibility,kde]
332 >=x11-libs/qt-script-${QT_MINIMAL}:4 313 >=x11-libs/qt-script-${QT_MINIMAL}:4
333 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support] 314 >=x11-libs/qt-sql-${QT_MINIMAL}:4[qt3support]
334 >=x11-libs/qt-svg-${QT_MINIMAL}:4 315 >=x11-libs/qt-svg-${QT_MINIMAL}:4
335 >=x11-libs/qt-test-${QT_MINIMAL}:4 316 >=x11-libs/qt-test-${QT_MINIMAL}:4
317 >=x11-libs/qt-webkit-${QT_MINIMAL}:4${qtwebkitusedeps}
336 !aqua? ( 318 !aqua? (
337 x11-libs/libXext 319 x11-libs/libXext
338 x11-libs/libXt 320 x11-libs/libXt
339 x11-libs/libXxf86vm 321 x11-libs/libXxf86vm
340 x11-libs/libXcomposite 322 x11-libs/libXcomposite
599 case ${PV} in 581 case ${PV} in
600 9999*) ;; 582 9999*) ;;
601 *) 583 *)
602 # set EGIT_BRANCH and EGIT_COMMIT to ${SLOT} 584 # set EGIT_BRANCH and EGIT_COMMIT to ${SLOT}
603 case ${_kmname} in 585 case ${_kmname} in
604 kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs) 586 kdeplasma-addons | kdepim | kdepim-runtime | kdepimlibs | okular)
605 EGIT_BRANCH="${SLOT}" 587 EGIT_BRANCH="${SLOT}"
588 ;;
589 marble)
590 EGIT_BRANCH="kde-${SLOT}"
606 ;; 591 ;;
607 *) EGIT_BRANCH="KDE/${SLOT}" ;; 592 *) EGIT_BRANCH="KDE/${SLOT}" ;;
608 esac 593 esac
609 ;; 594 ;;
610 esac 595 esac
630# kde-base packages go into KDE4 installation directory (KDEDIR) by default. 615# kde-base packages go into KDE4 installation directory (KDEDIR) by default.
631# 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.
632 617
633# @FUNCTION: kde4-base_pkg_setup 618# @FUNCTION: kde4-base_pkg_setup
634# @DESCRIPTION: 619# @DESCRIPTION:
635# Do the basic kdeprefix KDEDIR settings and determine with which kde should 620# Do the basic KDEDIR settings and determine with which kde should
636# optional applications link 621# optional applications link
637kde4-base_pkg_setup() { 622kde4-base_pkg_setup() {
638 debug-print-function ${FUNCNAME} "$@" 623 debug-print-function ${FUNCNAME} "$@"
624
625 if has kdeprefix ${IUSE//+} && use kdeprefix; then
626 eerror "Sorry, kdeprefix support has been removed."
627 eerror "Please remove kdeprefix from your USE variable."
628 die "kdeprefix support has been removed"
629 fi
630
631 if [[ ${CATEGORY}/${PN} != kde-base/kdelibs && ${CATEGORY}/${PN} != kde-base/kde-env ]] && \
632 { [[ ${KDE_REQUIRED} == always ]] || { [[ ${KDE_REQUIRED} == optional ]] && use kde; }; } && \
633 has_version kde-base/kdelibs[kdeprefix]; then
634 eerror "Sorry, kdeprefix support has been removed."
635 eerror "Please rebuild kdelibs without kdeprefix support."
636 die "kdeprefix support has been removed"
637 fi
639 638
640 # QA ebuilds 639 # QA ebuilds
641 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})." 640 [[ -z ${KDE_MINIMAL_VALID} ]] && ewarn "QA Notice: ignoring invalid KDE_MINIMAL (defaulting to ${KDE_MINIMAL})."
642 641
643 # Don't set KDEHOME during compilation, it will cause access violations 642 # Don't set KDEHOME during compilation, it will cause access violations
649 # executions consume quite some time. 648 # executions consume quite some time.
650 [[ $(gcc-major-version) -lt 4 ]] || \ 649 [[ $(gcc-major-version) -lt 4 ]] || \
651 ( [[ $(gcc-major-version) -eq 4 && $(gcc-minor-version) -le 3 ]] ) \ 650 ( [[ $(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)." 651 && die "Sorry, but gcc-4.3 and earlier wont work for KDE (see bug 354837)."
653 652
654 if [[ ${KDEBASE} = kde-base ]]; then
655 if use kdeprefix; then
656 KDEDIR=/usr/kde/${SLOT}
657 else
658 KDEDIR=/usr 653 KDEDIR=/usr
659 fi
660 : ${PREFIX:=${KDEDIR}}
661 else
662 # Determine KDEDIR by loooking for the closest match with KDE_MINIMAL
663 KDEDIR=
664 local kde_minimal_met
665 for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do
666 [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1
667 if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then
668 if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then
669 KDEDIR=/usr/kde/${slot}
670 else
671 KDEDIR=/usr
672 fi
673 break;
674 fi
675 done
676 unset slot
677
678 # Bail out if kdelibs required but not found
679 if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then
680 [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!"
681 else
682 [[ -z ${KDEDIR} ]] && KDEDIR=/usr
683 fi
684
685 : ${PREFIX:=/usr} 654 : ${PREFIX:=/usr}
686 fi 655 EKDEDIR=${EPREFIX}/usr
687 EKDEDIR=${EPREFIX}${KDEDIR}
688 656
689 # Point pkg-config path to KDE *.pc files 657 # Point pkg-config path to KDE *.pc files
690 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}}"
691 # Point to correct QT plugins path 659 # Point to correct QT plugins path
692 QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/" 660 QT_PLUGIN_PATH="${EKDEDIR}/$(get_libdir)/kde4/plugins/"
833 QTEST_COLORED=1 801 QTEST_COLORED=1
834 802
835 # Shadow existing /usr installations 803 # Shadow existing /usr installations
836 unset KDEDIRS 804 unset KDEDIRS
837 805
838 # Handle kdeprefix-ed KDE
839 if [[ ${KDEDIR} != /usr ]]; then
840 # Override some environment variables - only when kdeprefix is different,
841 # to not break ccache/distcc
842 PATH="${EKDEDIR}/bin:${PATH}"
843
844 # Append library search path
845 append-ldflags -L"${EKDEDIR}/$(get_libdir)"
846
847 # Append full RPATH
848 cmakeargs+=(-DCMAKE_SKIP_RPATH=OFF)
849
850 # Set cmake prefixes to allow buildsystem to locate valid KDE installation
851 # when more are present
852 cmakeargs+=(-DCMAKE_SYSTEM_PREFIX_PATH="${EKDEDIR}")
853 fi
854
855 #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling 806 #qmake -query QT_INSTALL_LIBS unavailable when cross-compiling
856 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)
857 #kde-config -path data unavailable when cross-compiling 808 #kde-config -path data unavailable when cross-compiling
858 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/)
859 810
860 # Handle kdeprefix in application itself
861 if ! has kdeprefix ${IUSE//+} || ! use kdeprefix; then
862 # If prefix is /usr, sysconf needs to be /etc, not /usr/etc 811 # sysconf needs to be /etc, not /usr/etc
863 cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc) 812 cmakeargs+=(-DSYSCONF_INSTALL_DIR="${EPREFIX}"/etc)
864 fi
865 813
866 if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then 814 if [[ $(declare -p mycmakeargs 2>&-) != "declare -a mycmakeargs="* ]]; then
867 mycmakeargs=(${mycmakeargs}) 815 mycmakeargs=(${mycmakeargs})
868 fi 816 fi
869 817
992 ewarn "With this setting you are unsupported by KDE team." 940 ewarn "With this setting you are unsupported by KDE team."
993 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."
994 fi 942 fi
995 fi 943 fi
996 fi 944 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
1006} 945}
1007 946
1008# @FUNCTION: kde4-base_pkg_postrm 947# @FUNCTION: kde4-base_pkg_postrm
1009# @DESCRIPTION: 948# @DESCRIPTION:
1010# 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.

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

  ViewVC Help
Powered by ViewVC 1.1.20