summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Mrozowski <reavertm@gentoo.org>2010-09-14 13:41:27 +0200
committerMaciej Mrozowski <reavertm@gentoo.org>2010-09-14 13:41:27 +0200
commita8172709ccd85251400de4965ba8b0ca24e792d4 (patch)
tree506fcc98d6960bd8c5de2bac1ff061b297a93aec
parent4743c8e9f463c33085f8d09eef50c6dd413453d1 (diff)
downloadkde-a8172709ccd85251400de4965ba8b0ca24e792d4.tar.gz
kde-a8172709ccd85251400de4965ba8b0ca24e792d4.tar.bz2
kde-a8172709ccd85251400de4965ba8b0ca24e792d4.zip
[eclass/kde4-{base,meta}] Rework KDE_HANDBOOK to accept 'always', 'optional' (USE=handbook) and 'never' (default)
-rw-r--r--eclass/kde4-base.eclass41
-rw-r--r--eclass/kde4-meta.eclass17
2 files changed, 38 insertions, 20 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass
index 2d48d76ad1c..120d4193f3c 100644
--- a/eclass/kde4-base.eclass
+++ b/eclass/kde4-base.eclass
@@ -141,15 +141,18 @@ CPPUNIT_REQUIRED="${CPPUNIT_REQUIRED:-never}"
# @DESCRIPTION:
# Is kde required? Possible values are 'always', 'optional' and 'never'.
# This variable must be set before inheriting any eclasses. Defaults to 'always'
-# If set to always or optional, KDE_MINIMAL may be overriden as well.
+# If set to 'always' or 'optional', KDE_MINIMAL may be overriden as well.
# Note that for kde-base packages this variable is fixed to 'always'.
KDE_REQUIRED="${KDE_REQUIRED:-always}"
# @ECLASS-VARIABLE: KDE_HANDBOOK
# @DESCRIPTION:
-# Set to enable handbook in application. It adds +handbook to IUSE, handbook dirs
-# to KMEXTRA and ensures buildtime and runtime dependencies.
-[[ -n ${KDE_HANDBOOK} ]] && IUSE+=" +handbook"
+# Set to enable handbook in application. Possible values are 'always', 'optional'
+# (handbook USE flag) and 'never'.
+# This variable must be set before inheriting any eclasses. Defaults to 'never'.
+# It adds default handbook dirs for kde-base packages to KMEXTRA and in any case it
+# ensures buildtime and runtime dependencies.
+KDE_HANDBOOK="${KDE_HANDBOOK:-never}"
# Setup packages inheriting this eclass
case ${KDEBASE} in
@@ -318,16 +321,26 @@ kdedepend="
"
kderdepend=""
-# Handbook handling - dependencies
-if [[ -n ${KDE_HANDBOOK} ]]; then
- kdedepend+="
- handbook? (
- app-text/docbook-xml-dtd:4.2
- app-text/docbook-xsl-stylesheets
- )
- "
- [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( $(add_kdebase_dep khelpcenter) )"
-fi
+kdehandbookdepend="
+ app-text/docbook-xml-dtd:4.2
+ app-text/docbook-xsl-stylesheets
+"
+kdehandbookrdepend="
+ $(add_kdebase_dep kdelibs 'handbook')
+"
+case ${KDE_HANDBOOK} in
+ always)
+ kdedepend+=" ${kdehandbookdepend}"
+ [[ ${PN} != kdelibs ]] && kderdepend+=" ${kdehandbookrdepend}"
+ ;;
+ optional)
+ IUSE+=" +handbook"
+ kdedepend+=" handbook? ( ${kdehandbookdepend} )"
+ [[ ${PN} != kdelibs ]] && kderdepend+=" handbook? ( ${kdehandbookrdepend} )"
+ ;;
+ *) ;;
+esac
+unset kdehandbookdepend kdehandbookrdepend
case ${KDE_REQUIRED} in
always)
diff --git a/eclass/kde4-meta.eclass b/eclass/kde4-meta.eclass
index 9cd7fb36f10..51468e9b196 100644
--- a/eclass/kde4-meta.eclass
+++ b/eclass/kde4-meta.eclass
@@ -108,10 +108,9 @@ fi
# @DESCRIPTION:
# All subdirectories listed here will be extracted, compiled & installed.
# $KMMODULE is always added to $KMEXTRA.
-# If the handbook USE-flag is set, and if this directory exists,
-# then "doc/$KMMODULE" is added to $KMEXTRA. In other cases, this should be
-# handled in the ebuild.
-# If the documentation is in a different subdirectory, you should add it to KMEXTRA.
+# If KDE_HANDBOOK is 'always' or 'optional' and handbook USE-flag is set, and if this
+# directory exists, then "doc/$KMMODULE" is added to $KMEXTRA. If there's additional
+# documentation in different subdirectories, it should be added to KMEXTRA manually..
# @ECLASS-VARIABLE: KMCOMPILEONLY
# @DESCRIPTION:
@@ -282,14 +281,20 @@ kde4-meta_src_extract() {
kde4-meta_create_extractlists() {
debug-print-function ${FUNCNAME} "$@"
- # TODO change to KMEXTRA for more strict check
- if has handbook ${IUSE//+} && use handbook && [[ -n ${KMMODULE} ]]; then
+ # Add default handbook locations
+ # FIXME - legacy code - remove when 4.4.5 is gone or preferrably port 4.4.5.
+ if ! slot_is_at_least 4.5 ${SLOT} && 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+="
doc/${KMMODULE##*/}"
fi
+ # Add default handbook locations
+ if [[ -n ${KMMODULE} ]] && [[ ${KDE_HANDBOOK} = always ]] || { [[ ${KDE_HANDBOOK} = optional ]] && use handbook; }; then
+ KMEXTRA+=" doc/${KMMODULE##*/}"
+ fi
+
# Add some CMake-files to KMEXTRACTONLY.
# Note that this actually doesn't include KMEXTRA handling.
# In those cases you should care to add the relevant files to KMEXTRACTONLY