Gentoo Logo
Gentoo Spaceship




Note: Due to technical difficulties, the Archives are currently not up to date. GMANE provides an alternative service for most mailing lists.
c.f. bug 424647
List Archive: gentoo-commits
Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Headers:
To: gentoo-commits@g.o
From: "Davide Pesavento" <pesa@g.o>
Subject: proj/qt:master commit in: eclass/
Date: Mon, 11 Jun 2012 22:37:41 +0000 (UTC)
commit:     1041c1d2fe1db668faf0e1c62973c59c17e48a0e
Author:     Davide Pesavento <davidepesa <AT> gmail <DOT> com>
AuthorDate: Mon Jun 11 22:35:26 2012 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Mon Jun 11 22:35:26 2012 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=1041c1d2

[qt5-build.eclass] Refactoring.

---
 eclass/qt5-build.eclass |   52 +++++++++++++++++++++++-----------------------
 1 files changed, 26 insertions(+), 26 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index b8fd1e1..b1af0e9 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -161,7 +161,7 @@ qt5-build_src_prepare() {
 	mkdir -p "${QT5_BUILD_DIR}" || die
 
 	if [[ ${PN} != "qt-core" ]]; then
-		symlink_tools_to_buildtree
+		qt5_symlink_tools_to_buildtree
 	fi
 
 	# Avoid unnecessary qmake recompilations
@@ -201,7 +201,7 @@ qt5-build_src_prepare() {
 
 # @FUNCTION: qt5-build_src_configure
 # @DESCRIPTION:
-# Default configure phase.
+# Runs ./configure and qmake.
 qt5-build_src_configure() {
 	# configure arguments
 	local conf=(
@@ -261,30 +261,21 @@ qt5-build_src_configure() {
 	popd >/dev/null || die
 
 	if [[ ${PN} != "qt-core" ]]; then
-		local subdir
-		for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
-			pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
-			einfo "Running qmake in: ${subdir}"
+		qmake() {
 			"${QT5_BUILD_DIR}"/bin/qmake \
 				"${S}/${subdir}/${subdir##*/}.pro" \
 				QMAKE_LIBDIR_QT="${QTLIBDIR}" \
-				|| die "qmake failed in ${subdir}"
-			popd >/dev/null || die
-		done
+				|| die
+		}
+		qt5_foreach_target_subdir qmake
 	fi
 }
 
 # @FUNCTION: qt5-build_src_compile
 # @DESCRIPTION:
-# Compiles the code in QT5_TARGET_SUBDIRS.
+# Compiles the code in target directories.
 qt5-build_src_compile() {
-	local subdir
-	for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
-		pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
-		einfo "Building in: ${subdir}"
-		emake
-		popd >/dev/null || die
-	done
+	qt5_foreach_target_subdir emake
 }
 
 # @FUNCTION: qt5-build_src_test
@@ -297,14 +288,9 @@ qt5-build_src_test() {
 
 # @FUNCTION: qt5-build_src_install
 # @DESCRIPTION:
-# Perform the actual installation including some library fixes.
+# Performs the actual installation of target directories.
 qt5-build_src_install() {
-	local subdir
-	for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
-		pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
-		emake INSTALL_ROOT="${D}" install
-		popd >/dev/null || die
-	done
+	qt5_foreach_target_subdir emake INSTALL_ROOT="${D}" install
 
 	if [[ ${PN} == "qt-core" ]]; then
 		pushd "${QT5_BUILD_DIR}" >/dev/null || die
@@ -372,11 +358,11 @@ qt5_prepare_env() {
 	QTSYSCONFDIR=${EPREFIX}/etc/qt5
 }
 
-# @FUNCTION: symlink_tools_to_buildtree
+# @FUNCTION: qt5_symlink_tools_to_buildtree
 # @INTERNAL
 # @DESCRIPTION:
 # Symlinks qt-core tools to buildtree, so they can be used when building other modules.
-symlink_tools_to_buildtree() {
+qt5_symlink_tools_to_buildtree() {
 	mkdir -p "${QT5_BUILD_DIR}"/bin || die
 
 	local bin
@@ -386,6 +372,20 @@ symlink_tools_to_buildtree() {
 	done
 }
 
+# @FUNCTION: qt5_foreach_target_subdir
+# @INTERNAL
+# @DESCRIPTION:
+# Executes the arguments inside each directory listed in QT5_TARGET_SUBDIRS.
+qt5_foreach_target_subdir() {
+	local subdir
+	for subdir in "${QT5_TARGET_SUBDIRS[@]}"; do
+		pushd "${QT5_BUILD_DIR}/${subdir}" >/dev/null || die
+		einfo "[${subdir}] $*"
+		"$@"
+		popd >/dev/null || die
+	done
+}
+
 # @FUNCTION: install_qconfigs
 # @INTERNAL
 # @DESCRIPTION:


Navigation:
Lists: gentoo-commits: < Prev By Thread Next > < Prev By Date Next >
Previous by thread:
proj/qt:master commit in: eclass/
Next by thread:
proj/qt:master commit in: eclass/
Previous by date:
proj/qt:master commit in: x11-libs/qt-core/, eclass/
Next by date:
proj/qt:master commit in: /


Updated Jun 26, 2012

Summary: Archive of the gentoo-commits mailing list.

Donate to support our development efforts.

Copyright 2001-2013 Gentoo Foundation, Inc. Questions, Comments? Contact us.