kde5.eclass: Extend KDE_TEST=forceoptional functionality, simplify
authorAndreas Sturmlechner <andreas.sturmlechner@gmail.com>
Sun, 22 Nov 2015 15:15:16 +0000 (16:15 +0100)
committerMichael Palimaka <kensington@gentoo.org>
Tue, 8 Dec 2015 13:59:21 +0000 (00:59 +1100)
If KDE_TEST=forceoptional, it makes sense to disable test subdirs also
outside KDE categories. No change for misc ebuilds using kde5.eclass.

eclass/kde5.eclass

index 0f50623e4ff0f163b662318b75466abf9068c9b5..b2cc679183d02f2c2a57c0e16b205457b3223ea9 100644 (file)
@@ -402,6 +402,10 @@ kde5_src_prepare() {
        # only enable handbook when required
        if ! use_if_iuse handbook ; then
                comment_add_subdirectory ${KDE_DOC_DIR}
+
+               if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
+                       punt_bogus_dep KF5 DocTools
+               fi
        fi
 
        # enable only the requested translations
@@ -435,21 +439,11 @@ kde5_src_prepare() {
                rm -rf po
        fi
 
-       # in frameworks, tests = manual tests so never
-       # build them
+       # in frameworks, tests = manual tests so never build them
        if [[ ${CATEGORY} = kde-frameworks ]]; then
                comment_add_subdirectory tests
        fi
 
-       if [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
-               # only build unit tests when required
-               if ! use_if_iuse test ; then
-                       comment_add_subdirectory autotests
-                       comment_add_subdirectory test
-                       comment_add_subdirectory tests
-               fi
-       fi
-
        case ${KDE_PUNT_BOGUS_DEPS} in
                false)  ;;
                *)
@@ -462,15 +456,18 @@ kde5_src_prepare() {
                        ;;
        esac
 
-       if [[ ${KDE_HANDBOOK} = forceoptional ]] ; then
-               if ! use_if_iuse handbook ; then
-                       punt_bogus_dep KF5 DocTools
-               fi
-       fi
-
-       if [[ ${KDE_TEST} = forceoptional ]] ; then
-               if ! use_if_iuse test ; then
+       # only build unit tests when required
+       if ! use_if_iuse test ; then
+               if [[ ${KDE_TEST} = forceoptional ]] ; then
                        punt_bogus_dep Qt5 Test
+                       # if forceoptional, also cover non-kde categories
+                       comment_add_subdirectory autotests
+                       comment_add_subdirectory test
+                       comment_add_subdirectory tests
+               elif [[ ${CATEGORY} = kde-frameworks || ${CATEGORY} = kde-plasma || ${CATEGORY} = kde-apps ]] ; then
+                       comment_add_subdirectory autotests
+                       comment_add_subdirectory test
+                       comment_add_subdirectory tests
                fi
        fi