summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Shvetsov <alexxy@gentoo.org>2010-12-02 21:49:54 +0000
committerAlexey Shvetsov <alexxy@gentoo.org>2010-12-02 21:49:54 +0000
commit1f5c2f48711170d13b18782ef2700c07bf0236ec (patch)
tree98c550224f780d8ca53bffae03b0031d5200b2ec
parentVersion bump. (diff)
downloadhistorical-1f5c2f48711170d13b18782ef2700c07bf0236ec.tar.gz
historical-1f5c2f48711170d13b18782ef2700c07bf0236ec.tar.bz2
historical-1f5c2f48711170d13b18782ef2700c07bf0236ec.zip
Update eclasses for kde
-rw-r--r--eclass/kde4-base.eclass105
-rw-r--r--eclass/kde4-functions.eclass176
-rw-r--r--eclass/kde4-meta.eclass19
3 files changed, 214 insertions, 86 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
index 47eb7f189ce4..00ba2e3029c5 100644
--- a/eclass/kde4-base.eclass
+++ b/eclass/kde4-base.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.77 2010/11/24 23:54:55 dilfridge Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-base.eclass,v 1.78 2010/12/02 21:49:54 alexxy Exp $
# @ECLASS: kde4-base.eclass
# @MAINTAINER:
@@ -13,7 +13,20 @@
# NOTE: KDE 4 ebuilds by default define EAPI="2", this can be redefined but
# eclass will fail with version older than 2.
-inherit kde4-functions base eutils
+# @ECLASS-VARIABLE: VIRTUALX_REQUIRED
+# @DESCRIPTION:
+# Do we need an X server? Valid values are "always", "optional", and "manual".
+# "tests" is a synonym for "optional". While virtualx.eclass supports in principle
+# also the use of an X server during other ebuild phases, we only use it in
+# src_test here. Most likely you'll want to set "optional", which introduces the
+# use-flag "test" (if not already present), adds dependencies conditional on that
+# use-flag, and automatically runs (only) the ebuild test phase with a virtual X server
+# present. This makes things a lot more comfortable than the bare virtualx eclass.
+
+# In case the variable is not set in the ebuild, let virtualx eclass not do anything
+: ${VIRTUALX_REQUIRED:=manual}
+
+inherit kde4-functions base virtualx eutils
get_build_type
if [[ ${BUILD_TYPE} = live ]]; then
@@ -113,6 +126,18 @@ EXPORT_FUNCTIONS pkg_setup src_unpack src_prepare ${export_fns} pkg_postinst pkg
unset buildsystem_eclass
unset export_fns
+# @ECLASS-VARIABLE: DECLARATIVE_REQUIRED
+# @DESCRIPTION:
+# Is qt-declarative required? Possible values are 'always', 'optional' and 'never'.
+# This variable must be set before inheriting any eclasses. Defaults to 'never'.
+DECLARATIVE_REQUIRED="${DECLARATIVE_REQUIRED:-never}"
+
+# @ECLASS-VARIABLE: QTHELP_REQUIRED
+# @DESCRIPTION:
+# Is qt-assistant required? Possible values are 'always', 'optional' and 'never'.
+# This variable must be set before inheriting any eclasses. Defaults to 'never'.
+QTHELP_REQUIRED="${QTHELP_REQUIRED:-never}"
+
# @ECLASS-VARIABLE: OPENGL_REQUIRED
# @DESCRIPTION:
# Is qt-opengl required? Possible values are 'always', 'optional' and 'never'.
@@ -192,13 +217,46 @@ esac
# @ECLASS-VARIABLE: QT_MINIMAL
# @DESCRIPTION:
# Determine version of qt we enforce as minimal for the package. 4.4.0 4.5.1...
-# 4.6.0 for 4.4 and 4.6.3 for 4.5 and later
-if slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
+# 4.6.0 for 4.4, 4.6.3 for 4.5, and 4.7.0 for 4.6 and later
+if slot_is_at_least 4.6 "${KDE_MINIMAL}"; then
+ QT_MINIMAL="${QT_MINIMAL:-4.7.0}"
+elif slot_is_at_least 4.5 "${KDE_MINIMAL}"; then
QT_MINIMAL="${QT_MINIMAL:-4.6.3}"
else
QT_MINIMAL="${QT_MINIMAL:-4.6.0}"
fi
+# Declarative dependencies
+qtdeclarativedepend="
+ >=x11-libs/qt-declarative-${QT_MINIMAL}:4
+"
+case ${DECLARATIVE_REQUIRED} in
+ always)
+ COMMONDEPEND+=" ${qtdeclarativedepend}"
+ ;;
+ optional)
+ IUSE+=" declarative"
+ COMMONDEPEND+=" declarative? ( ${qtdeclarativedepend} )"
+ ;;
+ *) ;;
+esac
+unset qtdeclarativedepend
+
+# QtHelp dependencies
+qthelpdepend="
+ >=x11-libs/qt-assistant-${QT_MINIMAL}:4
+"
+case ${QTHELP_REQUIRED} in
+ always)
+ COMMONDEPEND+=" ${qthelpdepend}"
+ ;;
+ optional)
+ IUSE+=" qthelp"
+ COMMONDEPEND+=" qthelp? ( ${qthelpdepend} )"
+ ;;
+esac
+unset qthelpdepend
+
# OpenGL dependencies
qtopengldepend="
>=x11-libs/qt-opengl-${QT_MINIMAL}:4
@@ -454,7 +512,7 @@ case ${BUILD_TYPE} in
fi
case ${KDEBASE} in
kdevelop)
- EGIT_REPO_URI="git://gitorious.org/${KMNAME}/${KMMODULE}.git"
+ EGIT_REPO_URI="git://git.kde.org/${KMMODULE}"
;;
esac
fi
@@ -656,8 +714,27 @@ kde4-base_src_prepare() {
load_library_dependencies
fi
+ # Replace KDE4Workspace library targets
+ find "${S}" -name CMakeLists.txt \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_TASKMANAGER_(LIBRARY|LIBS)\}/taskmanager/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWORKSPACE_(LIBRARY|LIBS)\}/kworkspace/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROLIFACES_(LIBRARY|LIBS)\}/solidcontrolifaces/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_SOLIDCONTROL_(LIBRARY|LIBS)\}/solidcontrol/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PROCESSUI_(LIBRARY|LIBS)\}/processui/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_LSOFUI_(LIBRARY|LIBS)\}/lsofui/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_PLASMACLOCK_(LIBRARY|LIBS)\}/plasmaclock/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERYCLIENT_(LIBRARY|LIBS)\}/nepomukqueryclient/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_NEPOMUKQUERY_(LIBRARY|LIBS)\}/nepomukquery/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSCREENSAVER_(LIBRARY|LIBS)\}/kscreensaver/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_WEATHERION_(LIBRARY|LIBS)\}/weather_ion/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KWINEFFECTS_(LIBRARY|LIBS)\}/kwineffects/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KDECORATIONS_(LIBRARY|LIBS)\}/kdecorations/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KSGRD_(LIBRARY|LIBS)\}/ksgrd/g' {} + \
+ -exec sed -i -r -e 's/\$\{KDE4WORKSPACE_KEPHAL_(LIBRARY|LIBS)\}/kephal/g' {} + \
+ || die 'failed to replace KDE4Workspace library targets'
+
# Hack for manuals relying on outdated DTD, only outside kde-base/koffice/...
- if [ -z ${KDEBASE} ]; then
+ if [[ -z ${KDEBASE} ]]; then
find "${S}" -name "*.docbook" \
-exec sed -i -r \
-e 's:-//KDE//DTD DocBook XML V4\.1(\..)?-Based Variant V1\.[01]//EN:-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN:g' {} + \
@@ -755,7 +832,21 @@ kde4-base_src_test() {
cmake-utils_src_configure
kde4-base_src_compile
- cmake-utils_src_test
+ if [[ ${VIRTUALX_REQUIRED} == always ]] ||
+ ( [[ ${VIRTUALX_REQUIRED} != manual ]] && use test ); then
+
+ if [[ ${maketype} ]]; then
+ # surprise- we are already INSIDE virtualmake!!!
+ ewarn "QA Notice: This version of kde4-base.eclass includes the virtualx functionality."
+ ewarn " You may NOT set maketype or call virtualmake from the ebuild. Applying workaround."
+ cmake-utils_src_test
+ else
+ export maketype="cmake-utils_src_test"
+ virtualmake
+ fi
+ else
+ cmake-utils_src_test
+ fi
}
# @FUNCTION: kde4-base_src_install
diff --git a/eclass/kde4-functions.eclass b/eclass/kde4-functions.eclass
index 0feaca469632..5738d8f18c48 100644
--- a/eclass/kde4-functions.eclass
+++ b/eclass/kde4-functions.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.36 2010/10/24 15:56:03 tampakrap Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-functions.eclass,v 1.37 2010/12/02 21:49:54 alexxy Exp $
inherit versionator
@@ -136,7 +136,7 @@ done
enable_selected_linguas() {
debug-print-function ${FUNCNAME} "$@"
- local lingua linguas sr_mess wp
+ local x
# if there is no linguas defined we enable everything
if ! $(env | grep -q "^LINGUAS="); then
@@ -146,49 +146,18 @@ enable_selected_linguas() {
# @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
- # fail at any point
- sr_mess="sr@latn sr@latin sr@Latin"
- for wp in ${sr_mess}; do
- [[ -e "${wp}.po" ]] && mv "${wp}.po" "sr@Latn.po"
- if [[ -d "${wp}" ]]; then
- # move dir and fix cmakelists
- mv "${wp}" "sr@Latn"
- sed -i \
- -e "s:${wp}:sr@Latin:g" \
- CMakeLists.txt
- fi
- done
-
- for lingua in ${KDE_LINGUAS}; do
- if [[ -e "${lingua}.po" ]]; then
- mv "${lingua}.po" "${lingua}.po.old"
- fi
- done
-
- for lingua in ${KDE_LINGUAS}; do
- if use linguas_${lingua} ; then
- 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
- fi
- done
- [[ -n "${linguas}" ]] && einfo "Enabling languages: ${linguas}"
-
- popd > /dev/null
+ # Can be defined as array of folders where translations are located.
+ # Note that space separated list of dirs is not supported.
+ # Default value is set to "po".
+ if [[ "$(declare -p KDE_LINGUAS_DIR 2>/dev/null 2>&1)" == "declare -a"* ]]; then
+ debug-print "$FUNCNAME: we have these subfolders defined: ${KDE_LINGUAS_DIR}"
+ for x in "${KDE_LINGUAS_DIR[@]}"; do
+ _enable_selected_linguas_dir ${x}
+ done
+ else
+ KDE_LINGUAS_DIR=${KDE_LINGUAS_DIR:="po"}
+ _enable_selected_linguas_dir ${KDE_LINGUAS_DIR}
+ fi
}
# @FUNCTION: enable_selected_doc_linguas
@@ -388,6 +357,52 @@ add_blocker() {
RDEPEND+=" $(_do_blocker "$@")"
}
+# @FUNCTION: add_kdebase_dep
+# @DESCRIPTION:
+# Create proper dependency for kde-base/ dependencies,
+# adding SLOT when needed (and *only* when needed).
+# This takes 1 or 2 arguments. The first being the package
+# name, the optional second, is additional USE flags to append.
+# The output of this should be added directly to DEPEND/RDEPEND, and
+# may be wrapped in a USE conditional (but not an || conditional
+# without an extra set of parentheses).
+add_kdebase_dep() {
+ debug-print-function ${FUNCNAME} "$@"
+
+ [[ -z ${1} ]] && die "Missing parameter"
+
+ local use=${2:+,${2}}
+
+ if [[ ${KDEBASE} = kde-base ]]; then
+ # FIXME remove hack when kdepim-4.4.{6,7} is gone
+ local FIXME_PV
+ if [[ ${KMNAME} = kdepim || ${PN} = kdepim-runtime ]] && [[ ${PV} = 4.4.6* || ${PV} = 4.4.7* ]] && [[ ${1} = kdelibs || ${1} = kdepimlibs ]]; then
+ FIXME_PV=4.4.5
+ else
+ FIXME_PV=${PV}
+ fi
+
+ # if building stable-live version depend just on slot
+ # to allow merging packages against more stable basic stuff
+ case ${PV} in
+ *.9999*)
+ echo " !kdeprefix? ( >=kde-base/${1}-${SLOT}[aqua=,-kdeprefix${use}] )"
+ echo " kdeprefix? ( >=kde-base/${1}-${SLOT}:${SLOT}[aqua=,kdeprefix${use}] )"
+ ;;
+ *)
+ echo " !kdeprefix? ( >=kde-base/${1}-${FIXME_PV}[aqua=,-kdeprefix${use}] )"
+ echo " kdeprefix? ( >=kde-base/${1}-${FIXME_PV}:${SLOT}[aqua=,kdeprefix${use}] )"
+ ;;
+ esac
+ else
+ if [[ ${KDE_MINIMAL} = live ]]; then
+ echo " kde-base/${1}:${KDE_MINIMAL}[aqua=${use}]"
+ else
+ echo " >=kde-base/${1}-${KDE_MINIMAL}[aqua=${use}]"
+ fi
+ fi
+}
+
# _greater_max_in_slot ver slot
# slot must be 4.x or live
# returns true if ver is >= the maximum possibile version in slot
@@ -501,37 +516,52 @@ _do_blocker() {
fi
}
-# @FUNCTION: add_kdebase_dep
-# @DESCRIPTION:
-# Create proper dependency for kde-base/ dependencies,
-# adding SLOT when needed (and *only* when needed).
-# This takes 1 or 2 arguments. The first being the package
-# name, the optional second, is additional USE flags to append.
-# The output of this should be added directly to DEPEND/RDEPEND, and
-# may be wrapped in a USE conditional (but not an || conditional
-# without an extra set of parentheses).
-add_kdebase_dep() {
- debug-print-function ${FUNCNAME} "$@"
+# local function to enable specified translations for specified directory
+# used from kde4-functions_enable_selected_linguas function
+_enable_selected_linguas_dir() {
+ local lingua linguas sr_mess wp
+ local dir=${1}
- [[ -z ${1} ]] && die "Missing parameter"
+ [[ -d "${dir}" ]] || die "linguas dir \"${dir}\" does not exist"
+ comment_all_add_subdirectory "${dir}"
+ pushd "${dir}" > /dev/null
- local use=${2:+,${2}}
+ # fix all various crazy sr@Latn variations
+ # this part is only ease for ebuilds, so there wont be any die when this
+ # fail at any point
+ sr_mess="sr@latn sr@latin sr@Latin"
+ for wp in ${sr_mess}; do
+ [[ -e "${wp}.po" ]] && mv "${wp}.po" "sr@Latn.po"
+ if [[ -d "${wp}" ]]; then
+ # move dir and fix cmakelists
+ mv "${wp}" "sr@Latn"
+ sed -i \
+ -e "s:${wp}:sr@Latin:g" \
+ CMakeLists.txt
+ fi
+ done
- if [[ ${KDEBASE} = kde-base ]]; then
- # FIXME remove hack when kdepim-4.4.{6,7} is gone
- local FIXME_PV
- if [[ ${KMNAME} = kdepim || ${PN} = kdepim-runtime ]] && [[ ${PV} = 4.4.6* || ${PV} = 4.4.7* ]] && [[ ${1} = kdelibs || ${1} = kdepimlibs ]]; then
- FIXME_PV=4.4.5
- else
- FIXME_PV=${PV}
+ for lingua in ${KDE_LINGUAS}; do
+ if [[ -e "${lingua}.po" ]]; then
+ mv "${lingua}.po" "${lingua}.po.old"
fi
- echo " !kdeprefix? ( >=kde-base/${1}-${FIXME_PV}[aqua=,-kdeprefix${use}] )"
- echo " kdeprefix? ( >=kde-base/${1}-${FIXME_PV}:${SLOT}[aqua=,kdeprefix${use}] )"
- else
- if [[ ${KDE_MINIMAL} = live ]]; then
- echo " kde-base/${1}:${KDE_MINIMAL}[aqua=${use}]"
- else
- echo " >=kde-base/${1}-${KDE_MINIMAL}[aqua=${use}]"
+ done
+
+ for lingua in ${KDE_LINGUAS}; do
+ if use linguas_${lingua} ; then
+ 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
fi
- fi
+ done
+ [[ -n "${linguas}" ]] && echo ">>> Enabling languages: ${linguas}"
+
+ popd > /dev/null
}
diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
index eea465720bca..24a36f80890d 100644
--- a/eclass/kde4-meta.eclass
+++ b/eclass/kde4-meta.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.43 2010/09/15 11:06:33 reavertm Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/kde4-meta.eclass,v 1.44 2010/12/02 21:49:54 alexxy Exp $
#
# @ECLASS: kde4-meta.eclass
# @MAINTAINER:
@@ -356,16 +356,23 @@ kde4-meta_create_extractlists() {
;;
koffice)
KMEXTRACTONLY+="
- config-endian.h.cmake
filters/config-filters.h.cmake
- config-openexr.h.cmake
- config-opengl.h.cmake
- config-prefix.h.cmake
"
case ${PV} in
2.0.*)
KMEXTRACTONLY+="
- config-openctl.h.cmake"
+ config-openctl.h.cmake
+ config-endian.h.cmake
+ config-openexr.h.cmake
+ config-opengl.h.cmake
+ config-prefix.h.cmake"
+ ;;
+ 2.[12].*)
+ KMEXTRACTONLY+="
+ config-endian.h.cmake
+ config-openexr.h.cmake
+ config-opengl.h.cmake
+ config-prefix.h.cmake"
;;
esac
;;