diff options
author | Alex Alexander <wired@gentoo.org> | 2009-08-03 21:59:53 +0000 |
---|---|---|
committer | Alex Alexander <wired@gentoo.org> | 2009-08-03 21:59:53 +0000 |
commit | ab3c6d69435930fe5cfba03ae8994229fc2bd60f (patch) | |
tree | 8c773c7640410a2b71282d649502f5f660248c9a /eclass | |
parent | amd64 stable, bug #264649 (diff) | |
download | historical-ab3c6d69435930fe5cfba03ae8994229fc2bd60f.tar.gz historical-ab3c6d69435930fe5cfba03ae8994229fc2bd60f.tar.bz2 historical-ab3c6d69435930fe5cfba03ae8994229fc2bd60f.zip |
synced kde4 eclasses with new ones from kde-testing overlay
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/kde4-base.eclass | 164 | ||||
-rw-r--r-- | eclass/kde4-functions.eclass | 127 | ||||
-rw-r--r-- | eclass/kde4-meta.eclass | 199 |
3 files changed, 272 insertions, 218 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index 97dd6a0c0084..311a812bf911 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -1,6 +1,6 @@ # Copyright 2007-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.41 2009/06/05 09:48:46 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.42 2009/08/03 21:59:53 wired Exp $ # @ECLASS: kde4-base.eclass # @MAINTAINER: @@ -61,11 +61,11 @@ fi # @ECLASS-VARIABLE: KDE_MINIMAL # @DESCRIPTION: -# This wariable is used when KDE_REQUIRED is set, to specify required KDE minimal +# This variable is used when KDE_REQUIRED is set, to specify required KDE minimal # version for apps to work. Currently defaults to 4.2 # One may override this variable to raise version requirements. # For possible values look at KDE_SLOTS and KDE_LIVE_SLOTS variables. -# Note that for kde-base packages is fixed to ${SLOT}. +# Note that it is fixed to ${SLOT} for kde-base packages. KDE_MINIMAL="${KDE_MINIMAL:-4.2}" # Fallback behaviour (for now) @@ -94,13 +94,11 @@ qtopengldepend=" " case ${OPENGL_REQUIRED} in always) - COMMONDEPEND="${COMMONDEPEND} ${qtopengldepend}" + COMMONDEPEND+=" ${qtopengldepend}" ;; optional) - IUSE="${IUSE} opengl" - COMMONDEPEND="${COMMONDEPEND} - opengl? ( ${qtopengldepend} ) - " + IUSE+=" opengl" + COMMONDEPEND+=" opengl? ( ${qtopengldepend} )" ;; *) ;; esac @@ -112,13 +110,11 @@ qtwebkitdepend=" " case ${WEBKIT_REQUIRED} in always) - COMMONDEPEND="${COMMONDEPEND} ${qtwebkitdepend}" + COMMONDEPEND+=" ${qtwebkitdepend}" ;; optional) - IUSE="${IUSE} webkit" - COMMONDEPEND="${COMMONDEPEND} - webkit? ( ${qtwebkitdepend} ) - " + IUSE+=" webkit" + COMMONDEPEND+=" webkit? ( ${qtwebkitdepend} )" ;; *) ;; esac @@ -130,52 +126,32 @@ cppuintdepend=" " case ${CPPUNIT_REQUIRED} in always) - DEPEND="${DEPEND} ${cppuintdepend}" + DEPEND+=" ${cppuintdepend}" ;; optional) - IUSE="${IUSE} test" - DEPEND="${DEPEND} - test? ( ${cppuintdepend} ) - " + IUSE+=" test" + DEPEND+=" test? ( ${cppuintdepend} )" ;; *) ;; esac unset cppuintdepend -# DEPRECATED block -if [[ ${NEED_KDE} != "none" ]]; then - # localization deps - # DISABLED UNTIL PMS decide correct approach :( - if [[ -n ${KDE_LINGUAS} ]]; then - LNG_DEP="" - for _lng in ${KDE_LINGUAS}; do - # there must be or due to issue if lingua is not present in kde-l10n so - # it wont die but pick kde-l10n as-is. - LNG_DEP="${LNG_DEP} - || ( - kde-base/kde-l10n[linguas_${_lng},kdeprefix=] - kde-base/kde-l10n[kdeprefix=] - ) - " - done - fi -fi # NEED_KDE != NONE block - # Setup packages inheriting this eclass case ${KDEBASE} in kde-base) if [[ $BUILD_TYPE = live ]]; then # Disable tests for live ebuilds - RESTRICT="${RESTRICT} test" + RESTRICT+=" test" # Live ebuilds in kde-base default to kdeprefix by default - IUSE="${IUSE} +kdeprefix" + IUSE+=" +kdeprefix" else # All other ebuild types default to -kdeprefix as before - IUSE="${IUSE} kdeprefix" + IUSE+=" kdeprefix" fi # Determine SLOT from PVs case ${PV} in *.9999*) SLOT="${PV/.9999*/}" ;; # stable live + 4.4* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) SLOT="4.4" ;; 4.3* | 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) SLOT="4.3" ;; 4.2* | 4.1.9* | 4.1.8* | 4.1.7* | 4.1.6*) SLOT="4.2" ;; 9999*) SLOT="live" ;; # regular live @@ -186,12 +162,10 @@ case ${KDEBASE} in _pvn="-${PV}" # Block installation of other SLOTS unless kdeprefix - for slot in ${KDE_SLOTS[@]}; do + for slot in ${KDE_SLOTS[@]} ${KDE_LIVE_SLOTS[@]}; do # Block non kdeprefix ${PN} on other slots if [[ ${SLOT} != ${slot} ]]; then - RDEPEND="${RDEPEND} - !kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] ) - " + RDEPEND+=" !kdeprefix? ( !kde-base/${PN}:${slot}[-kdeprefix] )" fi done unset slot @@ -211,9 +185,6 @@ esac # KDE dependencies kdecommondepend=" dev-lang/perl - x11-libs/libXext - x11-libs/libXt - x11-libs/libXxf86vm >=x11-libs/qt-core-${QT_DEPEND}:4[qt3support,ssl] >=x11-libs/qt-gui-${QT_DEPEND}:4[accessibility,dbus] >=x11-libs/qt-qt3support-${QT_DEPEND}:4[accessibility] @@ -221,15 +192,20 @@ kdecommondepend=" >=x11-libs/qt-sql-${QT_DEPEND}:4[qt3support] >=x11-libs/qt-svg-${QT_DEPEND}:4 >=x11-libs/qt-test-${QT_DEPEND}:4 + !aqua? ( + x11-libs/libXext + x11-libs/libXt + x11-libs/libXxf86vm + ) " if [[ ${PN} != kdelibs ]]; then if [[ ${KDEBASE} = kde-base ]]; then - kdecommondepend="${kdecommondepend} + kdecommondepend+=" kdeprefix? ( >=kde-base/kdelibs${_pv}[kdeprefix] ) !kdeprefix? ( >=kde-base/kdelibs${_pvn}[-kdeprefix] ) " else - kdecommondepend="${kdecommondepend} + kdecommondepend+=" >=kde-base/kdelibs${_pv} " fi @@ -237,19 +213,17 @@ fi unset _pv _pvn kdedepend=" dev-util/pkgconfig - >=sys-apps/sandbox-1.3.2 " case ${KDE_REQUIRED} in always) - COMMONDEPEND="${COMMONDEPEND} ${kdecommondepend}" - DEPEND="${DEPEND} ${kdedepend}" + IUSE+=" aqua" + COMMONDEPEND+=" ${kdecommondepend}" + DEPEND+=" ${kdedepend}" ;; optional) - IUSE="${IUSE} kde" - COMMONDEPEND="${COMMONDEPEND} - kde? ( ${kdecommondepend} )" - DEPEND="${DEPEND} - kde? ( ${kdedepend} )" + IUSE+=" aqua kde" + COMMONDEPEND+=" kde? ( ${kdecommondepend} )" + DEPEND+=" kde? ( ${kdedepend} )" ;; *) ;; esac @@ -260,8 +234,9 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: DEPEND (only) is ${DEPEND}" debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: RDEPEND (only) is ${RDEPEND}" # Accumulate dependencies set by this eclass -DEPEND="${DEPEND} ${COMMONDEPEND}" -RDEPEND="${RDEPEND} ${COMMONDEPEND}" +DEPEND+=" ${COMMONDEPEND}" +RDEPEND+=" ${COMMONDEPEND}" +unset COMMONDEPEND # Fetch section - If the ebuild's category is not 'kde-base' and if it is not a # koffice ebuild, the URI should be set in the ebuild itself @@ -301,6 +276,9 @@ case ${BUILD_TYPE} in kdebase-*) ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdebase/${KMNAME#kdebase-}" ;; + kdelibs-*) + ESVN_REPO_URI="${ESVN_MIRROR}/${branch_prefix}/kdelibs/${KMNAME#kdelibs-}" + ;; kdereview) ESVN_REPO_URI="${ESVN_MIRROR}/trunk/${KMNAME}/${KMMODULE}" ;; @@ -353,7 +331,12 @@ case ${BUILD_TYPE} in case ${KDEBASE} in kde-base) case ${PV} in - 4.2.85|4.2.90) + 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96) + # block for normally packed unstable releases + SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; + 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) + SRC_URI="http://dev.gentooexperimental.org/~alexxy/kde/${PV}/${_kmname_pv}.tar.lzma" ;; + 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98) # block for normally packed unstable releases SRC_URI="mirror://kde/unstable/${PV}/src/${_kmname_pv}.tar.bz2" ;; 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) @@ -384,7 +367,7 @@ debug-print "${LINENO} ${ECLASS} ${FUNCNAME}: SRC_URI is ${SRC_URI}" # @DESCRIPTION: # Set the installation PREFIX for non kde-base applications. It defaults to /usr. # kde-base packages go into KDE4 installation directory (KDEDIR) by default. -# No matter the PREFIX, package will be built agains KDE installed in KDEDIR. +# No matter the PREFIX, package will be built against KDE installed in KDEDIR. # @FUNCTION: kde4-base_pkg_setup # @DESCRIPTION: @@ -405,9 +388,9 @@ kde4-base_pkg_setup() { if [[ ${KDEBASE} = kde-base ]]; then if use kdeprefix; then - KDEDIR="${ROOT}usr/kde/${_kdedir}" + KDEDIR="${EROOT}usr/kde/${_kdedir}" else - KDEDIR="${ROOT}usr" + KDEDIR="${EROOT}usr" fi PREFIX="${PREFIX:-${KDEDIR}}" else @@ -418,9 +401,9 @@ kde4-base_pkg_setup() { [[ -z ${kde_minimal_met} ]] && [[ ${slot} = ${KDE_MINIMAL} ]] && kde_minimal_met=1 if [[ -n ${kde_minimal_met} ]] && has_version "kde-base/kdelibs:${slot}"; then if has_version "kde-base/kdelibs:${slot}[kdeprefix]"; then - KDEDIR="${ROOT}usr/kde/${slot}" + KDEDIR="${EROOT}usr/kde/${slot}" else - KDEDIR="${ROOT}usr" + KDEDIR="${EROOT}usr" fi break; fi @@ -431,11 +414,15 @@ kde4-base_pkg_setup() { if [[ ${KDE_REQUIRED} = always ]] || { [[ ${KDE_REQUIRED} = optional ]] && use kde; }; then [[ -z ${KDEDIR} ]] && die "Failed to determine KDEDIR!" else - [[ -z ${KDEDIR} ]] && KDEDIR="${ROOT}usr" + [[ -z ${KDEDIR} ]] && KDEDIR="${EROOT}usr" fi - PREFIX="${PREFIX:-${ROOT}usr}" + PREFIX="${PREFIX:-${EROOT}usr}" fi + # Point pkg-config path to KDE *.pc files + export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" + # Point to correct QT plugins path + QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" # Not needed anymore unset _kdedir @@ -459,7 +446,8 @@ kde4-base_src_unpack() { # @DESCRIPTION: # General pre-configure and pre-compile function for KDE4 applications. # It also handles translations if KDE_LINGUAS is defined. See KDE_LINGUAS and -# enable_selected_linguas() in kde4-functions.eclass(5) for further details. +# enable_selected_linguas() and enable_selected_doc_linguas() +# in kde4-functions.eclass(5) for further details. kde4-base_src_prepare() { debug-print-function ${FUNCNAME} "$@" @@ -468,6 +456,12 @@ kde4-base_src_prepare() { enable_selected_linguas fi + # Enable/disable handbooks for kde4-base packages + # kde-l10n inherits kde-base but is metpackage, so no check for doc + if ! has kde4-meta ${INHERITED}; then + has handbook ${IUSE//+} && [[ ${PN} != kde-l10n ]] && enable_selected_doc_linguas + fi + [[ ${BUILD_TYPE} = live ]] && subversion_src_prepare base_src_prepare @@ -502,38 +496,34 @@ kde4-base_src_configure() { fi # Set distribution name - [[ ${PN} = kdelibs ]] && cmakeargs="${cmakeargs} -DKDE_DISTRIBUTION_TEXT=Gentoo" + [[ ${PN} = kdelibs ]] && cmakeargs+=" -DKDE_DISTRIBUTION_TEXT=Gentoo" # Here we set the install prefix - cmakeargs="${cmakeargs} -DCMAKE_INSTALL_PREFIX=${PREFIX}" + cmakeargs+=" -DCMAKE_INSTALL_PREFIX=${PREFIX}" - # Set environment + # Use colors QTEST_COLORED=1 - QT_PLUGIN_PATH="${KDEDIR}/$(get_libdir)/kde4/plugins/" - - # Point pkg-config path to KDE *.pc files - export PKG_CONFIG_PATH="${KDEDIR}/$(get_libdir)/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}" # Shadow existing /usr installations unset KDEDIRS - if [[ ${KDEDIR} != "${ROOT}usr" ]]; then + if [[ ${KDEDIR} != "${EROOT}usr" ]]; then # Override some environment variables - only when kdeprefix is different, # to not break ccache/distcc PATH="${KDEDIR}/bin:${PATH}" LDPATH="${KDEDIR}/$(get_libdir):${LDPATH}" # Append full RPATH - cmakeargs="${cmakeargs} -DCMAKE_SKIP_RPATH=OFF" + cmakeargs+=" -DCMAKE_SKIP_RPATH=OFF" fi if has kdeprefix ${IUSE//+} && use kdeprefix; then # Set cmake prefixes to allow buildsystem to localize valid KDE installation # when more are present - cmakeargs="${cmakeargs} -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}" + cmakeargs+=" -DCMAKE_SYSTEM_PREFIX_PATH=${KDEDIR}" else # If prefix is /usr, sysconf needs to be /etc, not /usr/etc - cmakeargs="${cmakeargs} -DSYSCONF_INSTALL_DIR=${ROOT}etc" + cmakeargs+=" -DSYSCONF_INSTALL_DIR=${EROOT}etc" fi mycmakeargs="${cmakeargs} ${mycmakeargs}" @@ -547,7 +537,7 @@ kde4-base_src_configure() { kde4-base_src_compile() { debug-print-function ${FUNCNAME} "$@" - cmake-utils_src_compile + cmake-utils_src_compile "$@" } # @FUNCTION: kde4-base_src_test @@ -557,7 +547,7 @@ kde4-base_src_test() { debug-print-function ${FUNCNAME} "$@" # Override this value, set in kde4-base_src_configure() - mycmakeargs="${mycmakeargs} -DKDE4_BUILD_TESTS=ON" + mycmakeargs+=" -DKDE4_BUILD_TESTS=ON" cmake-utils_src_configure kde4-base_src_compile @@ -599,10 +589,10 @@ kde4-base_src_make_doc() { done fi - if [[ -n ${KDEBASE} ]] && [[ -d "${D}${ROOT}usr/share/doc/${PF}" ]]; then + if [[ -n ${KDEBASE} ]] && [[ -d "${D}${EROOT}usr/share/doc/${PF}" ]]; then # work around bug #97196 dodir /usr/share/doc/KDE4 && \ - mv "${D}${ROOT}usr/share/doc/${PF}" "${D}${ROOT}usr/share/doc/KDE4/" || \ + mv "${D}${EROOT}usr/share/doc/${PF}" "${D}${EROOT}usr/share/doc/KDE4/" || \ die "Failed to move docs to KDE4/." fi } @@ -617,17 +607,17 @@ kde4-base_pkg_postinst() { if [[ ${BUILD_TYPE} = live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]]; then echo - einfo "WARNING! This is an experimental live ebuild of ${KMNAME:-${PN}}" + einfo "WARNING! This is an experimental live ebuild of ${CATEGORY}/${PN}" einfo "Use it at your own risk." einfo "Do _NOT_ file bugs at bugs.gentoo.org because of this ebuild!" echo elif [[ ${BUILD_TYPE} != live ]] && [[ -z ${I_KNOW_WHAT_I_AM_DOING} ]] && has kdeprefix ${IUSE//+} && use kdeprefix; then # warning about kdeprefix for non-live users echo - ewarn "WARNING! You have kdeprefix useflag enabled." - ewarn "This setting is strongly discouraged and might lead to potential troubles" + ewarn "WARNING! You have the kdeprefix useflag enabled." + ewarn "This setting is strongly discouraged and might lead to potential trouble" ewarn "with KDE update strategies." - ewarn "You are using this setup at your own risk and kde team does not" + ewarn "You are using this setup at your own risk and the kde team does not" ewarn "take responsibilities for dead kittens." echo fi diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass index 45a0d3953bb9..33ace54973d2 100644 --- a/eclass/kde4-functions.eclass +++ b/eclass/kde4-functions.eclass @@ -1,6 +1,9 @@ # Copyright 1999-2008 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.21 2009/06/04 09:29:54 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.22 2009/08/03 21:59:53 wired Exp $ + +# Prefix compat: +: ${EROOT:=${ROOT}} # @ECLASS: kde4-functions.eclass # @MAINTAINER: @@ -12,7 +15,7 @@ # @ECLASS-VARIABLE: EAPI # @DESCRIPTION: -# By default kde4 eclasses wants eapi 2 which might be redefinable to newer +# By default kde4 eclasses want EAPI 2 which might be redefinable to newer # versions. case ${EAPI:-0} in 2) : ;; @@ -39,7 +42,7 @@ fi # @DESCRIPTION: # The slots used by all KDE versions later than 4.0. The live KDE releases use # KDE_LIVE_SLOTS instead. Values should be ordered. -KDE_SLOTS=( "kde-4" "4.1" "4.2" "4.3" ) +KDE_SLOTS=( "kde-4" "4.1" "4.2" "4.3" "4.4" ) # @ECLASS-VARIABLE: KDE_LIVE_SLOTS # @DESCRIPTION: @@ -53,7 +56,21 @@ KDE_LIVE_SLOTS=( "live" ) buildsycoca() { debug-print-function ${FUNCNAME} "$@" - if [[ -z ${ROOT%%/} && -x ${KDEDIR}/bin/kbuildsycoca4 ]]; then + local KDE3DIR="${EROOT}usr/kde/3.5" + if [[ -z ${EROOT%%/} && -x "${KDE3DIR}"/bin/kbuildsycoca ]]; then + # Since KDE3 is aware of shortcuts in /usr, rebuild database + # for KDE3 as well. + touch "${KDE3DIR}"/share/services/ksycoca + chmod 644 "${KDE3DIR}"/share/services/ksycoca + + ebegin "Running kbuildsycoca to build global database" + XDG_DATA_DIRS="${EROOT}usr/local/share:${KDE3DIR}/share:${EROOT}usr/share" \ + DISPLAY="" \ + "${KDE3DIR}"/bin/kbuildsycoca --global --noincremental &> /dev/null + eend $? + fi + + if [[ -z ${EROOT%%/} && -x "${KDEDIR}"/bin/kbuildsycoca4 ]]; then # Make sure tha cache file exists, writable by root and readable by # others. Otherwise kbuildsycoca4 will fail. touch "${KDEDIR}/share/kde4/services/ksycoca4" @@ -66,17 +83,17 @@ buildsycoca() { ebegin "Running kbuildsycoca4 to build global database" # This is needed because we support multiple kde versions installed together. # Lookup in order - local, KDEDIR, /usr, do not duplicate entries btw. - local KDEDIRS="${ROOT}usr/share" - [[ ${KDEDIR} != "${ROOT}usr" ]] && KDEDIRS="${KDEDIR}/share:${KDEDIRS}" - XDG_DATA_DIRS="${ROOT}usr/local/share:${KDEDIRS}" \ + local KDEDIRS="${EROOT}usr/share" + [[ ${KDEDIR} != "${EROOT}usr" ]] && KDEDIRS="${KDEDIR}/share:${KDEDIRS}" + XDG_DATA_DIRS="${EROOT}usr/local/share:${KDEDIRS}" \ DISPLAY="" DBUS_SESSION_BUS_ADDRESS="" \ - ${KDEDIR}/bin/kbuildsycoca4 --global --noincremental &> /dev/null + "${KDEDIR}"/bin/kbuildsycoca4 --global --noincremental &> /dev/null eend $? fi # fix permission for some directories - for x in share/config share/kde4; do - [[ ${KDEDIR} = ${ROOT}usr ]] && DIRS=${ROOT}usr || DIRS="${ROOT}usr ${KDEDIR}" + for x in share/{config,kde4}; do + [[ ${KDEDIR} = ${EROOT}usr ]] && DIRS=${EROOT}usr || DIRS="${EROOT}usr ${KDEDIR}" for y in ${DIRS}; do [[ -d "${y}/${x}" ]] || break # nothing to do if directory does not exist if [[ $(stat --format=%a "${y}/${x}") != 755 ]]; then @@ -97,8 +114,12 @@ buildsycoca() { # except those in cmake/. comment_all_add_subdirectory() { find "$@" -name CMakeLists.txt -print0 | grep -vFzZ "./cmake" | \ - xargs -0 sed -i -e '/add_subdirectory/s/^/#DONOTCOMPILE /' -e '/ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' || \ - die "${LINENO}: Initial sed died" + xargs -0 sed -i \ + -e '/^[[:space:]]*add_subdirectory/s/^/#DONOTCOMPILE /' \ + -e '/^[[:space:]]*ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \ + -e '/^[[:space:]]*macro_optional_add_subdirectory/s/^/#DONOTCOMPILE /' \ + -e '/^[[:space:]]*MACRO_OPTIONAL_ADD_SUBDIRECTORY/s/^/#DONOTCOMPILE /' \ + || die "${LINENO}: Initial sed died" } # @ECLASS-VARIABLE: KDE_LINGUAS @@ -120,19 +141,22 @@ done # the package (see KDE_LINGUAS). By default, translations are found in "${S}"/po # but this default can be overridden by defining KDE_LINGUAS_DIR. enable_selected_linguas() { - local lingua sr_mess wp + debug-print-function ${FUNCNAME} "$@" + + local lingua linguas sr_mess wp - ## This isn't working because it seems portage sets LINGUAS - ## even if you don't have it in make.conf - ## Im leaving the command that *should* work if LINGUAS was unset commented # if there is no linguas defined we enable everything if ! $(env | grep -q "^LINGUAS="); then return 0 fi - # [[ ! ${LINGUAS+set} = set ]] && LINGUAS="*" - # ebuild overridable linguas directory definition - KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="${S}/po"} - cd "${KDE_LINGUAS_DIR}" || die "wrong linguas dir specified" + + # @ECLASS-VARIABLE: KDE_LINGUAS_DIR + # @DESCRIPTION: + # Specified folder where application translations are located. + KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"} + [[ -d "${KDE_LINGUAS_DIR}" ]] || die "wrong linguas dir specified" + comment_all_add_subdirectory "${KDE_LINGUAS_DIR}" + pushd "${KDE_LINGUAS_DIR}" > /dev/null # fix all various crazy sr@Latn variations # this part is only ease for ebuilds, so there wont be any die when this @@ -154,21 +178,74 @@ enable_selected_linguas() { mv "${lingua}.po" "${lingua}.po.old" fi done - comment_all_add_subdirectory "${KDE_LINGUAS_DIR}" + for lingua in ${KDE_LINGUAS}; do if use linguas_${lingua} ; then - ebegin "Enabling LANGUAGE: ${lingua}" if [[ -d "${lingua}" ]]; then + linguas="${linguas} ${lingua}" sed -e "/add_subdirectory([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ -e "/ADD_SUBDIRECTORY([[:space:]]*${lingua}[[:space:]]*)[[:space:]]*$/ s/^#DONOTCOMPILE //" \ -i CMakeLists.txt || die "Sed to uncomment linguas_${lingua} failed." fi if [[ -e "${lingua}.po.old" ]]; then + linguas="${linguas} ${lingua}" mv "${lingua}.po.old" "${lingua}.po" fi - eend $? fi done + [[ -n "${linguas}" ]] && einfo "Enabling languages: ${linguas}" + + popd > /dev/null +} + +# @FUNCTION: enable_selected_doc_linguas +# @DESCRIPTION: +# Enable only selected linguas enabled doc folders. +enable_selected_doc_linguas() { + debug-print-function ${FUNCNAME} "$@" + + # if there is no linguas defined we enable everything + if ! $(env | grep -q "^LINGUAS="); then + return 0 + fi + + # @ECLASS-VARIABLE: KDE_DOC_DIRS + # @DESCRIPTION: + # Variable specifying whitespace separated patterns for documentation locations. + # Default is "doc/%lingua" + KDE_DOC_DIRS=${KDE_DOC_DIRS:='doc/%lingua'} + local linguas + for pattern in ${KDE_DOC_DIRS}; do + + local handbookdir=`dirname ${pattern}` + local translationdir=`basename ${pattern}` + # Do filename pattern supplied, treat as directory + [[ "${handbookdir}" = '.' ]] && handbookdir=${translationdir} && translationdir= + [[ -d "${handbookdir}" ]] || die 'wrong doc dir specified' + + if ! use handbook; then + # Disable whole directory + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ + -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${handbookdir}[[:space:]]*)/s/^/#DONOTCOMPILE /" \ + -i CMakeLists.txt || die 'failed to comment out all handbooks' + else + # Disable subdirectories recursively + comment_all_add_subdirectory "${handbookdir}" + # Add requested translations + local lingua + for lingua in en ${KDE_LINGUAS}; do + if [[ ${lingua} = 'en' ]] || use linguas_${lingua}; then + if [[ -d "${handbookdir}/${translationdir//%lingua/${lingua}}" ]]; then + sed -e "/add_subdirectory[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ + -e "/ADD_SUBDIRECTORY[[:space:]]*([[:space:]]*${translationdir//%lingua/${lingua}}/s/^#DONOTCOMPILE //" \ + -i "${handbookdir}"/CMakeLists.txt && ! has ${lingua} ${linguas} && linguas="${linguas} ${lingua}" + fi + fi + done + fi + + done + [[ -n "${linguas}" ]] && einfo "Enabling handbook translations:${linguas}" } # @FUNCTION: get_build_type @@ -253,7 +330,7 @@ install_library_dependencies() { local depsfile="${T}/${PN}:${SLOT}" ebegin "Installing library dependencies as ${depsfile##*/}" - insinto ${ROOT}var/lib/kde + insinto ${EROOT}var/lib/kde doins "${depsfile}" || die "Failed to install library dependencies." eend $? } @@ -268,7 +345,7 @@ load_library_dependencies() { i=0 for pn in ${KMLOADLIBS} ; do ((i++)) - depsfile="${ROOT}var/lib/kde/${pn}:${SLOT}" + depsfile="${EROOT}var/lib/kde/${pn}:${SLOT}" [[ -r "${depsfile}" ]] || die "Depsfile '${depsfile}' not accessible. You probably need to reinstall ${pn}." sed -i -e "${i}iINCLUDE(\"${depsfile}\")" "${S}/CMakeLists.txt" || \ die "Failed to include library dependencies for ${pn}" diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass index 46bc50ada8d6..4d36ff548040 100644 --- a/eclass/kde4-meta.eclass +++ b/eclass/kde4-meta.eclass @@ -1,6 +1,6 @@ # Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.22 2009/06/04 09:29:54 scarabeus Exp $ +# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.23 2009/08/03 21:59:53 wired Exp $ # # @ECLASS: kde4-meta.eclass # @MAINTAINER: @@ -31,96 +31,64 @@ case ${KDEBASE} in ;; esac -# remove this codeblock when 4.2.3 is dropped -if [[ ${PV} = "4.2.3" ]]; then - [[ ${PN} != khelpcenter ]] && has doc ${IUSE//+} \ - RDEPEND="${RDEPEND} doc? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" -else # Add khelpcenter dependency when installing handbooks if [[ ${PN} != khelpcenter ]] && has handbook ${IUSE//+}; then - RDEPEND="${RDEPEND} - handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] ) - " -fi + RDEPEND+=" handbook? ( >=kde-base/khelpcenter-${PV}:${SLOT}[kdeprefix=] )" fi + # Add dependencies that all packages in a certain module share. case ${KMNAME} in kdebase|kdebase-apps|kdebase-workspace|kdebase-runtime|kdegraphics) - DEPEND="${DEPEND} - >=kde-base/qimageblitz-0.0.4 - " - RDEPEND="${RDEPEND} - >=kde-base/qimageblitz-0.0.4 - " + COMMONDEPEND+=" >=kde-base/qimageblitz-0.0.4" ;; kdenetwork) - DEPEND="${DEPEND} - >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] - " - RDEPEND="${RDEPEND} - >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] - " + COMMONDEPEND+=" >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=]" ;; - kdepim) - DEPEND="${DEPEND} - dev-libs/boost - >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] - " - RDEPEND="${RDEPEND} + kdepim|kdepim-runtime) + COMMONDEPEND+=" dev-libs/boost >=kde-base/kdepimlibs-${PV}:${SLOT}[kdeprefix=] " case ${PN} in akregator|kaddressbook|kjots|kmail|knode|knotes|korganizer|ktimetracker) - IUSE="+kontact" - RDEPEND="${RDEPEND} - kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] ) - " + IUSE+=" +kontact" + RDEPEND+=" kontact? ( >=kde-base/kontactinterfaces-${PV}:${SLOT}[kdeprefix=] )" ;; esac ;; kdegames) if [[ ${PN} != libkdegames ]]; then - DEPEND="${DEPEND} - >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] - " - RDEPEND="${RDEPEND} - >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] - " + COMMONDEPEND+=" >=kde-base/libkdegames-${PV}:${SLOT}[kdeprefix=] " fi ;; koffice) - [[ ${PN} != koffice-data ]] && IUSE="debug" - RDEPEND="${RDEPEND} + [[ ${PN} != koffice-data ]] && IUSE+=" debug" + RDEPEND+=" !app-office/${PN}:0 !app-office/koffice:0 !app-office/koffice-meta:0 " if has openexr ${IUSE//+}; then - COMMON_DEPEND="media-gfx/imagemagick[openexr?]" + COMMONDEPEND+=" media-gfx/imagemagick[openexr?]" else - COMMON_DEPEND="media-gfx/imagemagick" + COMMONDEPEND+=" media-gfx/imagemagick" fi - COMMON_DEPEND="${COMMON_DEPEND} + COMMONDEPEND+=" dev-cpp/eigen:2 media-libs/fontconfig media-libs/freetype:2 " - DEPEND="${DEPEND} ${COMMON_DEPEND}" - RDEPEND="${RDEPEND} ${COMMON_DEPEND}" - unset COMMON_DEPEND if [[ ${PN} != koffice-libs && ${PN} != koffice-data ]]; then - DEPEND="${DEPEND} - >=app-office/koffice-libs-${PV}:${SLOT} - " - RDEPEND="${RDEPEND} - >=app-office/koffice-libs-${PV}:${SLOT} - " + COMMONDEPEND+=" >=app-office/koffice-libs-${PV}:${SLOT}" fi ;; esac +DEPEND+=" ${COMMONDEPEND}" +RDEPEND+=" ${COMMONDEPEND}" +unset COMMONDEPEND + debug-print "line ${LINENO} ${ECLASS}: DEPEND ${DEPEND} - after metapackage-specific dependencies" debug-print "line ${LINENO} ${ECLASS}: RDEPEND ${RDEPEND} - after metapackage-specific dependencies" @@ -260,27 +228,27 @@ kde4-meta_src_extract() { else local abort tarball tarfile f extractlist moduleprefix postfix case ${PV} in - 4.2.85|4.2.90) + 4.3.85 | 4.3.90 | 4.3.95 | 4.3.96 | 4.3.98 | 4.2.85 | 4.2.90 | 4.2.95 | 4.2.96 | 4.2.98) # block for normally packed upstream unstable snapshots - KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2 + KMTARPARAMS+=" --bzip2" # bz2 postfix="bz2" ;; - 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6*) - KMTARPARAMS="${KMTARPARAMS} --lzma" # lzma + 4.2.9* | 4.2.8* | 4.2.7* | 4.2.6* | 4.3.9* | 4.3.8* | 4.3.7* | 4.3.6*) + KMTARPARAMS+=" --lzma" # lzma postfix="lzma" ;; *) - KMTARPARAMS="${KMTARPARAMS} --bzip2" # bz2 + KMTARPARAMS+=" --bzip2" # bz2 postfix="bz2" ;; esac case ${KMNAME} in kdebase-apps) - # kdebase/apps -> kdebasa-apps + # kdebase/apps -> kdebase-apps tarball="kdebase-${PV}.tar.${postfix}" # Go one level deeper for kdebase-apps in tarballs moduleprefix=apps/ - KMTARPARAMS="${KMTARPARAMS} --transform=s|apps/||" + KMTARPARAMS+=" --transform=s|apps/||" ;; *) # Create tarball name from module name (this is the default) @@ -288,7 +256,7 @@ kde4-meta_src_extract() { ;; esac - # Full patch to source tarball + # Full path to source tarball tarfile="${DISTDIR}/${tarball}" # Detect real toplevel dir from tarball name - it will be used upon extraction @@ -302,9 +270,9 @@ kde4-meta_src_extract() { for f in cmake/ CMakeLists.txt ConfigureChecks.cmake config.h.cmake \ AUTHORS COPYING INSTALL README NEWS ChangeLog do - extractlist="${extractlist} ${topdir}${moduleprefix}${f}" + extractlist+=" ${topdir}${moduleprefix}${f}" done - extractlist="${extractlist} $(__list_needed_subdirectories)" + extractlist+=" $(__list_needed_subdirectories)" pushd "${WORKDIR}" > /dev/null [[ -n ${KDE4_STRICTER} ]] && echo tar -xpf "${tarfile}" ${KMTARPARAMS} ${extractlist} >&2 @@ -344,17 +312,11 @@ kde4-meta_create_extractlists() { debug-print-function ${FUNCNAME} "$@" # TODO change to KMEXTRA for more strict check - # remvove 4.2.3 check when dropped - if [[ ${PV} = "4.2.3" ]]; then - if has doc ${IUSE//+} && use doc && [[ -n ${KMMODULE} ]]; then - KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" - fi - else if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then # We use the basename of $KMMODULE because $KMMODULE can contain # the path to the module subdirectory. - KMEXTRA_NONFATAL="${KMEXTRA_NONFATAL} doc/${KMMODULE##*/}" - fi + KMEXTRA_NONFATAL+=" + doc/${KMMODULE##*/}" fi # Add some CMake-files to KMEXTRACTONLY. @@ -362,21 +324,21 @@ kde4-meta_create_extractlists() { # In those cases you should care to add the relevant files to KMEXTRACTONLY case ${KMNAME} in kdebase) - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" apps/config-apps.h.cmake apps/ConfigureChecks.cmake" ;; kdebase-apps) - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" config-apps.h.cmake ConfigureChecks.cmake" ;; kdebase-runtime) - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" config-runtime.h.cmake" ;; kdebase-workspace) - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" config-unix.h.cmake ConfigureChecks.cmake config-workspace.h.cmake @@ -386,37 +348,53 @@ kde4-meta_create_extractlists() { ;; kdegames) if [[ ${PN} != libkdegames ]]; then - KMEXTRACTONLY="${KMEXTRACTONLY} - libkdegames" + KMEXTRACTONLY+=" + libkdegames/" fi ;; kdepim) if [[ ${PN} != libkdepim ]]; then - KMEXTRACTONLY="${KMEXTRACTONLY} - libkdepim" + KMEXTRACTONLY+=" + libkdepim/" fi case ${SLOT} in - 4.3|live) - KMEXTRACTONLY="${KMEXTRACTONLY} - kdepim-version.h - config-enterprise.h.cmake" + 4.3|4.4|live) + KMEXTRACTONLY+=" + kdepim-version.h + config-enterprise.h.cmake" ;; esac - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" kleopatra/ConfigureChecks.cmake" if has kontact ${IUSE//+} && use kontact; then - KMEXTRA="${KMEXTRA} kontact/plugins/${PLUGINNAME:-${PN}}" - KMEXTRACTONLY="${KMEXTRACTONLY} kontactinterfaces/" + KMEXTRA+=" + kontact/plugins/${PLUGINNAME:-${PN}}/" + KMEXTRACTONLY+=" + kontactinterfaces/" fi ;; + kdeutils) + case ${SLOT} in + 4.3|4.4|live) + KMEXTRACTONLY+=" + kdeutils-version.h" + ;; + esac + ;; koffice) - KMEXTRACTONLY="${KMEXTRACTONLY} + KMEXTRACTONLY+=" config-endian.h.cmake filters/config-filters.h.cmake - config-openctl.h.cmake config-openexr.h.cmake config-opengl.h.cmake - config-prefix.h.cmake" + config-prefix.h.cmake + " + case ${PV} in + 2.0.*) + KMEXTRACTONLY+=" + config-openctl.h.cmake" + ;; + esac ;; esac # Don't install cmake modules for split ebuilds, to avoid collisions. @@ -426,20 +404,20 @@ kde4-meta_create_extractlists() { # Remove when 4.2 is wiped out from the tree case ${PV} in 4.1*|4.2.0|4.2.1|4.2.2|4.2.3|4.2.4|4.2.85) - KMCOMPILEONLY="${KMCOMPILEONLY} + KMCOMPILEONLY+=" cmake/modules/" - ;; + ;; *) ;; esac ;; kdebase-runtime|kdebase-workspace|kdeedu|kdegames|kdegraphics) case ${PN} in libkdegames|libkdeedu|libkworkspace) - KMEXTRA="${KMEXTRA} + KMEXTRA+=" cmake/modules/" ;; *) - KMCOMPILEONLY="${KMCOMPILEONLY} + KMCOMPILEONLY+=" cmake/modules/" ;; esac @@ -454,12 +432,12 @@ __list_needed_subdirectories() { # We expand KMEXTRA by adding CMakeLists.txt files kmextra="${KMEXTRA}" - [[ ${1} != fatal ]] && kmextra="${kmextra} ${KMEXTRA_NONFATAL}" + [[ ${1} != fatal ]] && kmextra+=" ${KMEXTRA_NONFATAL}" for i in ${kmextra}; do - kmextra_expanded="${kmextra_expanded} ${i}" + kmextra_expanded+=" ${i}" j=$(dirname ${i}) while [[ ${j} != "." ]]; do - kmextra_expanded="${kmextra_expanded} ${j}/CMakeLists.txt"; + kmextra_expanded+=" ${j}/CMakeLists.txt"; j=$(dirname ${j}) done done @@ -469,17 +447,17 @@ __list_needed_subdirectories() { kmmodule_expanded="${KMMODULE}" j=$(dirname ${KMMODULE}) while [[ ${j} != "." ]]; do - kmmodule_expanded="${kmmodule_expanded} ${j}/CMakeLists.txt"; + kmmodule_expanded+=" ${j}/CMakeLists.txt"; j=$(dirname ${j}) done fi # Expand KMCOMPILEONLY for i in ${KMCOMPILEONLY}; do - kmcompileonly_expanded="${kmcompileonly_expanded} ${i}" + kmcompileonly_expanded+=" ${i}" j=$(dirname ${i}) while [[ ${j} != "." ]]; do - kmcompileonly_expanded="${kmcompileonly_expanded} ${j}/CMakeLists.txt"; + kmcompileonly_expanded+=" ${j}/CMakeLists.txt"; j=$(dirname ${j}) done done @@ -493,7 +471,7 @@ __list_needed_subdirectories() { for i in ${kmmodule_expanded} ${kmextra_expanded} ${kmcompileonly_expanded} \ ${KMEXTRACTONLY} do - extractlist="${extractlist} ${topdir}${moduleprefix}${i}" + extractlist+=" ${topdir}${moduleprefix}${i}" done echo ${extractlist} @@ -607,7 +585,7 @@ kde4-meta_change_cmakelists() { if [[ ${PN} != libkworkspace ]]; then sed -i \ -e '/install(FILES ${CMAKE_CURRENT_BINARY_DIR}\/KDE4WorkspaceConfig.cmake/,/^[[:space:]]*FILE KDE4WorkspaceLibraryTargets.cmake )[[:space:]]*^/d' \ - CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" + CMakeLists.txt || die "${LINENO}: sed died in kdebase-workspace strip config install and fix EXPORT section" fi ;; kdebase-runtime) @@ -641,9 +619,18 @@ kde4-meta_change_cmakelists() { sed -i -e '/install(.*FindKOfficeLibs.cmake/,/)/ d' \ "${S}"/cmake/modules/CMakeLists.txt || \ die "${LINENO}: sed died in collision prevention section" - sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ - "${S}"/CMakeLists.txt || \ - die "${LINENO}: sed died in collision prevention section" + case ${PV} in + 2.0.*) + sed -i -n -e '1h;1!H;${g;s/install(.\+config-openexr.h.\+)//;p}' \ + "${S}"/CMakeLists.txt || \ + die "${LINENO}: sed died in collision prevention section" + ;; + *) + sed -i -e '/install(.\+config-openexr\.h.\+)/d' \ + "${S}"//CMakeLists.txt || \ + die "${LINENO}: sed died in collision prevention section" + ;; + esac fi esac @@ -680,7 +667,7 @@ kde4-meta_src_configure() { kde4-meta_src_compile() { debug-print-function ${FUNCNAME} "$@" - kde4-base_src_compile + kde4-base_src_compile "$@" } # @FUNCTION: kde4-meta_src_test @@ -705,7 +692,7 @@ kde4-meta_src_install() { # @FUNCTION: kde4-meta_src_make_doc # @DESCRIPTION: # This function searches in ${S}/${KMMODULE}, -# and tries to install "AUTHORS ChangeLog* README* NEWS todo" if these files exist. +# and tries to install "AUTHORS ChangeLog* README* NEWS TODO" if these files exist. kde4-meta_src_make_doc() { debug-print-function ${FUNCNAME} "$@" @@ -726,7 +713,7 @@ kde4-meta_pkg_postinst() { if has handbook ${IUSE//+} && ! use handbook; then echo einfo "Application handbook for ${PN} has not been installed." - einfo "To install handbook, reemerge =${CATEGORY}/${P} with 'handbook' USE flag." + einfo "To install handbook, reemerge =${CATEGORY}/${PF} with 'handbook' USE flag." echo fi |