1 |
commit: 6feaa4f92f24205c0bb63a68585f6d4baa3bd20c |
2 |
Author: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Jun 3 14:04:30 2014 +0000 |
4 |
Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Jun 3 14:04:30 2014 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=6feaa4f9 |
7 |
|
8 |
[qt4-build-multilib.eclass] Refactoring. |
9 |
|
10 |
--- |
11 |
eclass/qt4-build-multilib.eclass | 68 ++++++++++++++++++++++------------------ |
12 |
1 file changed, 37 insertions(+), 31 deletions(-) |
13 |
|
14 |
diff --git a/eclass/qt4-build-multilib.eclass b/eclass/qt4-build-multilib.eclass |
15 |
index 9c0d397..86285af 100644 |
16 |
--- a/eclass/qt4-build-multilib.eclass |
17 |
+++ b/eclass/qt4-build-multilib.eclass |
18 |
@@ -350,21 +350,8 @@ multilib_src_configure() { |
19 |
sed -i -e '/^QMAKE_LFLAGS =/ s:$: $$QMAKE_LFLAGS:' \ |
20 |
.qmake.cache || die "sed .qmake.cache failed" |
21 |
|
22 |
- local dir |
23 |
- for dir in . ${QT4_TARGET_DIRECTORIES}; do |
24 |
- mkdir -p "${dir}" || die |
25 |
- pushd "${dir}" >/dev/null || die |
26 |
- |
27 |
- local projectdir=${PWD/#${BUILD_DIR}/${S}} |
28 |
- einfo "Running qmake in: ${dir}" |
29 |
- "${BUILD_DIR}"/bin/qmake \ |
30 |
- CONFIG+=nostrip \ |
31 |
- LIBS+=-L"${QT4_LIBDIR}" \ |
32 |
- "${projectdir}" \ |
33 |
- || die "qmake failed (${projectdir})" |
34 |
- |
35 |
- popd >/dev/null || die |
36 |
- done |
37 |
+ qt4_qmake |
38 |
+ qt4_foreach_target_subdir qt4_qmake |
39 |
} |
40 |
|
41 |
# @FUNCTION: qt4-build-multilib_src_compile |
42 |
@@ -377,12 +364,7 @@ qt4-build-multilib_src_compile() { |
43 |
multilib_src_compile() { |
44 |
qt4_prepare_env |
45 |
|
46 |
- local dir |
47 |
- for dir in ${QT4_TARGET_DIRECTORIES}; do |
48 |
- pushd ${dir} >/dev/null || die |
49 |
- emake |
50 |
- popd >/dev/null || die |
51 |
- done |
52 |
+ qt4_foreach_target_subdir emake |
53 |
} |
54 |
|
55 |
# @FUNCTION: qt4-build-multilib_src_test |
56 |
@@ -398,10 +380,7 @@ multilib_src_test() { |
57 |
|
58 |
qt4_prepare_env |
59 |
|
60 |
- local dir |
61 |
- for dir in ${QT4_TARGET_DIRECTORIES}; do |
62 |
- emake -j1 check -C ${dir} |
63 |
- done |
64 |
+ qt4_foreach_target_subdir emake -j1 check |
65 |
} |
66 |
|
67 |
# @FUNCTION: qt4-build-multilib_src_install |
68 |
@@ -415,12 +394,7 @@ qt4-build-multilib_src_install() { |
69 |
multilib_src_install() { |
70 |
qt4_prepare_env |
71 |
|
72 |
- local dir |
73 |
- for dir in ${QT4_TARGET_DIRECTORIES}; do |
74 |
- pushd ${dir} >/dev/null || die |
75 |
- emake INSTALL_ROOT="${D}" install |
76 |
- popd >/dev/null || die |
77 |
- done |
78 |
+ qt4_foreach_target_subdir emake INSTALL_ROOT="${D}" install |
79 |
|
80 |
# install private headers of a few modules |
81 |
if has ${PN} qtcore qtdeclarative qtgui qtscript; then |
82 |
@@ -493,6 +467,38 @@ qt4_prepare_env() { |
83 |
export XDG_CONFIG_HOME="${T}" |
84 |
} |
85 |
|
86 |
+# @FUNCTION: qt4_foreach_target_subdir |
87 |
+# @INTERNAL |
88 |
+# @DESCRIPTION: |
89 |
+# Executes the given command inside each directory listed in QT4_TARGET_DIRECTORIES. |
90 |
+qt4_foreach_target_subdir() { |
91 |
+ local subdir |
92 |
+ for subdir in ${QT4_TARGET_DIRECTORIES}; do |
93 |
+ mkdir -p "${subdir}" || die |
94 |
+ pushd "${subdir}" >/dev/null || die |
95 |
+ |
96 |
+ einfo "Running $* ${subdir:+in ${subdir}}" |
97 |
+ "$@" |
98 |
+ |
99 |
+ popd >/dev/null || die |
100 |
+ done |
101 |
+} |
102 |
+ |
103 |
+# @FUNCTION: qt4_qmake |
104 |
+# @INTERNAL |
105 |
+# @DESCRIPTION: |
106 |
+# Helper function that runs qmake in the current target subdir. |
107 |
+# Intended to be called by qt4_foreach_target_subdir(). |
108 |
+qt4_qmake() { |
109 |
+ local projectdir=${PWD/#${BUILD_DIR}/${S}} |
110 |
+ |
111 |
+ "${BUILD_DIR}"/bin/qmake \ |
112 |
+ CONFIG+=nostrip \ |
113 |
+ LIBS+=-L"${QT4_LIBDIR}" \ |
114 |
+ "${projectdir}" \ |
115 |
+ || die "qmake failed (${projectdir})" |
116 |
+} |
117 |
+ |
118 |
# @ECLASS-VARIABLE: QCONFIG_ADD |
119 |
# @DESCRIPTION: |
120 |
# List options that need to be added to QT_CONFIG in qconfig.pri |