diff options
author | Michael Palimaka <kensington@gentoo.org> | 2016-12-01 06:33:34 +1100 |
---|---|---|
committer | Michael Palimaka <kensington@gentoo.org> | 2017-10-08 12:46:22 +1100 |
commit | 2e301e46e78fd6e051b02aae7ea45459eabee5a0 (patch) | |
tree | 7e3d6f08e4f12f9827dfe385356d7835cd1d3408 /eclass | |
parent | qt5-build.eclass: adjust to upstream multimedia build system changes in qtbase (diff) | |
download | gentoo-2e301e46e78fd6e051b02aae7ea45459eabee5a0.tar.gz gentoo-2e301e46e78fd6e051b02aae7ea45459eabee5a0.tar.bz2 gentoo-2e301e46e78fd6e051b02aae7ea45459eabee5a0.zip |
qt5-build.eclass: introduce qt_use_disable_config
Similar to qt_use_disable_mod, this function helps avoid automagic dependencies.
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/qt5-build.eclass | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index fee5775d9084..a627ce882a49 100644 --- a/eclass/qt5-build.eclass +++ b/eclass/qt5-build.eclass @@ -370,6 +370,29 @@ qt_use_compile_test() { fi } +# @FUNCTION: qt_use_disable_config +# @USAGE: <flag> <config> <files...> +# @DESCRIPTION: +# <flag> is the name of a flag in IUSE. +# <config> is the (lowercase) name of a Qt5 config entry. +# <files...> is a list of one or more qmake project files. +# +# This function patches <files> to treat <config> as disabled +# when <flag> is disabled, otherwise it does nothing. +# This can be useful to avoid an automagic dependency when the config entry +# is enabled on the system but the corresponding USE flag is disabled. +qt_use_disable_config() { + [[ $# -ge 3 ]] || die "${FUNCNAME}() requires at least three arguments" + + local flag=$1 + local config=$2 + shift 2 + + if ! use "${flag}"; then + echo "$@" | xargs sed -i -e "s/qtConfig(${config})/false/g" || die + fi +} + # @FUNCTION: qt_use_disable_mod # @USAGE: <flag> <module> <files...> # @DESCRIPTION: |