kde5.eclass: introduce "forceoptional" value for KDE_HANDBOOK
authorMichael Palimaka <kensington@gentoo.org>
Wed, 4 Nov 2015 17:20:02 +0000 (04:20 +1100)
committerMichael Palimaka <kensington@gentoo.org>
Fri, 13 Nov 2015 17:18:50 +0000 (04:18 +1100)
eclass/kde5.eclass

index e76a969ff486e84b7781aae923795074e6348b6d..7a5d2222eb50a4c1160d9b644fb8611e7bc9cb2d 100644 (file)
@@ -80,6 +80,8 @@ fi
 # If set to "false", do nothing.
 # Otherwise, add "+handbook" to IUSE, add the appropriate dependency, and
 # generate and install KDE handbook.
+# If set to "forceoptional", remove a KF5DocTools dependency from the root
+# CMakeLists.txt in addition to the above.
 : ${KDE_HANDBOOK:=false}
 
 # @ECLASS-VARIABLE: KDE_DOC_DIR
@@ -418,7 +420,7 @@ kde5_src_prepare() {
                        popd > /dev/null || die
                fi
 
-               if [[ ${KDE_HANDBOOK} = true && -d ${KDE_DOC_DIR} && ${CATEGORY} != kde-apps ]] ; then
+               if [[ ${KDE_HANDBOOK} != false && -d ${KDE_DOC_DIR} && ${CATEGORY} != kde-apps ]] ; then
                        pushd ${KDE_DOC_DIR} > /dev/null || die
                        for lang in *; do
                                if ! has ${lang} ${LINGUAS} ; then
@@ -458,6 +460,12 @@ kde5_src_prepare() {
                        ;;
        esac
 
+       if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
+               if ! use_if_iuse handbook ; then
+                       punt_bogus_dep KF5 DocTools
+               fi
+       fi
+
        cmake-utils_src_prepare
 }