1 |
commit: 59718fb00fe774f1918dd7263f016e6993dc99e5 |
2 |
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Nov 30 19:33:34 2016 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Dec 1 13:49:10 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=59718fb0 |
7 |
|
8 |
qt5-build.eclass: introduce qt_use_disable_config |
9 |
|
10 |
Similar to qt_use_disable_mod, this function helps avoid automagic dependencies. |
11 |
|
12 |
eclass/qt5-build.eclass | 23 +++++++++++++++++++++++ |
13 |
1 file changed, 23 insertions(+) |
14 |
|
15 |
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass |
16 |
index 9727ce7..d496ba0 100644 |
17 |
--- a/eclass/qt5-build.eclass |
18 |
+++ b/eclass/qt5-build.eclass |
19 |
@@ -388,6 +388,29 @@ qt_use_compile_test() { |
20 |
fi |
21 |
} |
22 |
|
23 |
+# @FUNCTION: qt_use_disable_config |
24 |
+# @USAGE: <flag> <config> <files...> |
25 |
+# @DESCRIPTION: |
26 |
+# <flag> is the name of a flag in IUSE. |
27 |
+# <config> is the (lowercase) name of a Qt5 config entry. |
28 |
+# <files...> is a list of one or more qmake project files. |
29 |
+# |
30 |
+# This function patches <files> to treat <config> as disabled |
31 |
+# when <flag> is disabled, otherwise it does nothing. |
32 |
+# This can be useful to avoid an automagic dependency when the config entry |
33 |
+# is enabled on the system but the corresponding USE flag is disabled. |
34 |
+qt_use_disable_config() { |
35 |
+ [[ $# -ge 3 ]] || die "${FUNCNAME}() requires at least three arguments" |
36 |
+ |
37 |
+ local flag=$1 |
38 |
+ local config=$2 |
39 |
+ shift 2 |
40 |
+ |
41 |
+ if ! use "${flag}"; then |
42 |
+ echo "$@" | xargs sed -i -e "s/qtConfig(${config})/false/g" || die |
43 |
+ fi |
44 |
+} |
45 |
+ |
46 |
# @FUNCTION: qt_use_disable_mod |
47 |
# @USAGE: <flag> <module> <files...> |
48 |
# @DESCRIPTION: |