diff options
| -rw-r--r-- | eclass/kde4-base.eclass | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/eclass/kde4-base.eclass b/eclass/kde4-base.eclass index bdca31c939b..10ed2471008 100644 --- a/eclass/kde4-base.eclass +++ b/eclass/kde4-base.eclass @@ -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 @@ -819,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 |
