1 |
commit: 1ea428272dd5d364468a5fbb403544e877405d64 |
2 |
Author: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 30 19:29:21 2014 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 30 19:29:21 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=1ea42827 |
7 |
|
8 |
[qt5-build.eclass] Refactor qt5_install_module_qconfigs(). |
9 |
|
10 |
--- |
11 |
eclass/qt5-build.eclass | 32 +++++++++++++++----------------- |
12 |
1 file changed, 15 insertions(+), 17 deletions(-) |
13 |
|
14 |
diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass |
15 |
index 96c3d77..f64ab35 100644 |
16 |
--- a/eclass/qt5-build.eclass |
17 |
+++ b/eclass/qt5-build.eclass |
18 |
@@ -65,7 +65,7 @@ EGIT_REPO_URI=( |
19 |
IUSE="debug test" |
20 |
|
21 |
DEPEND=" |
22 |
- >=dev-lang/perl-5.14 |
23 |
+ dev-lang/perl |
24 |
virtual/pkgconfig |
25 |
" |
26 |
if [[ ${PN} != qttest ]]; then |
27 |
@@ -612,7 +612,12 @@ qt5_qmake() { |
28 |
# @DESCRIPTION: |
29 |
# Creates and installs gentoo-specific ${PN}-qconfig.{h,pri} files. |
30 |
qt5_install_module_qconfigs() { |
31 |
- local x |
32 |
+ local x qconfig_add= qconfig_remove= |
33 |
+ |
34 |
+ > "${T}"/${PN}-qconfig.h |
35 |
+ > "${T}"/${PN}-qconfig.pri |
36 |
+ |
37 |
+ # generate qconfig_{add,remove} and ${PN}-qconfig.h |
38 |
for x in "${QT5_GENTOO_CONFIG[@]}"; do |
39 |
local flag=${x%%:*} |
40 |
x=${x#${flag}:} |
41 |
@@ -622,30 +627,23 @@ qt5_install_module_qconfigs() { |
42 |
macro=$(tr 'a-z-' 'A-Z_' <<< "${macro}") |
43 |
|
44 |
if [[ -z ${flag} ]] || { [[ ${flag} != '!' ]] && use ${flag}; }; then |
45 |
- [[ -n ${feature} ]] && QCONFIG_ADD+=("${feature}") |
46 |
- [[ -n ${macro} ]] && QCONFIG_DEFINE+=("QT_${macro}") |
47 |
+ [[ -n ${feature} ]] && qconfig_add+=" ${feature}" |
48 |
+ [[ -n ${macro} ]] && echo "#define QT_${macro}" >> "${T}"/${PN}-qconfig.h |
49 |
else |
50 |
- [[ -n ${feature} ]] && QCONFIG_REMOVE+=("${feature}") |
51 |
- [[ -n ${macro} ]] && QCONFIG_DEFINE+=("QT_NO_${macro}") |
52 |
+ [[ -n ${feature} ]] && qconfig_remove+=" ${feature}" |
53 |
+ [[ -n ${macro} ]] && echo "#define QT_NO_${macro}" >> "${T}"/${PN}-qconfig.h |
54 |
fi |
55 |
done |
56 |
|
57 |
- # qconfig.h |
58 |
- > "${T}"/${PN}-qconfig.h |
59 |
- for x in "${QCONFIG_DEFINE[@]}"; do |
60 |
- echo "#define ${x}" >> "${T}"/${PN}-qconfig.h |
61 |
- done |
62 |
+ # install ${PN}-qconfig.h |
63 |
[[ -s ${T}/${PN}-qconfig.h ]] && ( |
64 |
insinto "${QT5_HEADERDIR#${EPREFIX}}"/Gentoo |
65 |
doins "${T}"/${PN}-qconfig.h |
66 |
) |
67 |
|
68 |
- # qconfig.pri |
69 |
- > "${T}"/${PN}-qconfig.pri |
70 |
- [[ -n ${QCONFIG_ADD[@]} ]] && echo "QCONFIG_ADD=${QCONFIG_ADD[@]}" \ |
71 |
- >> "${T}"/${PN}-qconfig.pri |
72 |
- [[ -n ${QCONFIG_REMOVE[@]} ]] && echo "QCONFIG_REMOVE=${QCONFIG_REMOVE[@]}" \ |
73 |
- >> "${T}"/${PN}-qconfig.pri |
74 |
+ # generate and install ${PN}-qconfig.pri |
75 |
+ [[ -n ${qconfig_add} ]] && echo "QCONFIG_ADD=${qconfig_add}" >> "${T}"/${PN}-qconfig.pri |
76 |
+ [[ -n ${qconfig_remove} ]] && echo "QCONFIG_REMOVE=${qconfig_remove}" >> "${T}"/${PN}-qconfig.pri |
77 |
[[ -s ${T}/${PN}-qconfig.pri ]] && ( |
78 |
insinto "${QT5_ARCHDATADIR#${EPREFIX}}"/mkspecs/gentoo |
79 |
doins "${T}"/${PN}-qconfig.pri |