Gentoo Archives: gentoo-commits

From: Davide Pesavento <pesa@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/qt:master commit in: eclass/
Date: Mon, 11 Jun 2012 22:37:56
Message-Id: 1339454126.1041c1d2fe1db668faf0e1c62973c59c17e48a0e.pesa@gentoo
1 commit: 1041c1d2fe1db668faf0e1c62973c59c17e48a0e
2 Author: Davide Pesavento <davidepesa <AT> gmail <DOT> com>
3 AuthorDate: Mon Jun 11 22:35:26 2012 +0000
4 Commit: Davide Pesavento <pesa <AT> gentoo <DOT> org>
5 CommitDate: Mon Jun 11 22:35:26 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=1041c1d2
7
8 [qt5-build.eclass] Refactoring.
9
10 ---
11 eclass/qt5-build.eclass | 52 +++++++++++++++++++++++-----------------------
12 1 files changed, 26 insertions(+), 26 deletions(-)
13
14 diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
15 index b8fd1e1..b1af0e9 100644
16 --- a/eclass/qt5-build.eclass
17 +++ b/eclass/qt5-build.eclass
18 @@ -161,7 +161,7 @@ qt5-build_src_prepare() {
19 mkdir -p "${QT5_BUILD_DIR}" || die
20
21 if [[ ${PN} != "qt-core" ]]; then
22 - symlink_tools_to_buildtree
23 + qt5_symlink_tools_to_buildtree
24 fi
25
26 # Avoid unnecessary qmake recompilations
27 @@ -201,7 +201,7 @@ qt5-build_src_prepare() {
28
29 # @FUNCTION: qt5-build_src_configure
30 # @DESCRIPTION:
31 -# Default configure phase.
32 +# Runs ./configure and qmake.
33 qt5-build_src_configure() {
34 # configure arguments
35 local conf=(
36 @@ -261,30 +261,21 @@ qt5-build_src_configure() {
37 popd >/dev/null || die
38
39 if [[ ${PN} != "qt-core" ]]; then
40 - local subdir
41 - for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
42 - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
43 - einfo "Running qmake in: ${subdir}"
44 + qmake() {
45 "${QT5_BUILD_DIR}"/bin/qmake \
46 "${S}/${subdir}/${subdir##*/}.pro" \
47 QMAKE_LIBDIR_QT="${QTLIBDIR}" \
48 - || die "qmake failed in ${subdir}"
49 - popd >/dev/null || die
50 - done
51 + || die
52 + }
53 + qt5_foreach_target_subdir qmake
54 fi
55 }
56
57 # @FUNCTION: qt5-build_src_compile
58 # @DESCRIPTION:
59 -# Compiles the code in QT5_TARGET_SUBDIRS.
60 +# Compiles the code in target directories.
61 qt5-build_src_compile() {
62 - local subdir
63 - for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
64 - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
65 - einfo "Building in: ${subdir}"
66 - emake
67 - popd >/dev/null || die
68 - done
69 + qt5_foreach_target_subdir emake
70 }
71
72 # @FUNCTION: qt5-build_src_test
73 @@ -297,14 +288,9 @@ qt5-build_src_test() {
74
75 # @FUNCTION: qt5-build_src_install
76 # @DESCRIPTION:
77 -# Perform the actual installation including some library fixes.
78 +# Performs the actual installation of target directories.
79 qt5-build_src_install() {
80 - local subdir
81 - for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
82 - pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
83 - emake INSTALL_ROOT="${D}" install
84 - popd >/dev/null || die
85 - done
86 + qt5_foreach_target_subdir emake INSTALL_ROOT="${D}" install
87
88 if [[ ${PN} == "qt-core" ]]; then
89 pushd "${QT5_BUILD_DIR}" >/dev/null || die
90 @@ -372,11 +358,11 @@ qt5_prepare_env() {
91 QTSYSCONFDIR=${EPREFIX}/etc/qt5
92 }
93
94 -# @FUNCTION: symlink_tools_to_buildtree
95 +# @FUNCTION: qt5_symlink_tools_to_buildtree
96 # @INTERNAL
97 # @DESCRIPTION:
98 # Symlinks qt-core tools to buildtree, so they can be used when building other modules.
99 -symlink_tools_to_buildtree() {
100 +qt5_symlink_tools_to_buildtree() {
101 mkdir -p "${QT5_BUILD_DIR}"/bin || die
102
103 local bin
104 @@ -386,6 +372,20 @@ symlink_tools_to_buildtree() {
105 done
106 }
107
108 +# @FUNCTION: qt5_foreach_target_subdir
109 +# @INTERNAL
110 +# @DESCRIPTION:
111 +# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
112 +qt5_foreach_target_subdir() {
113 + local subdir
114 + for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
115 + pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
116 + einfo "[${subdir}] $*"
117 + "$@"
118 + popd >/dev/null || die
119 + done
120 +}
121 +
122 # @FUNCTION: install_qconfigs
123 # @INTERNAL
124 # @DESCRIPTION: