commit:     279a71a89cea2e9774cf6d465f05e5c82709bc2e
Author:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
AuthorDate: Fri Aug 29 22:57:20 2014 +0000
Commit:     Davide Pesavento <pesa <AT> gentoo <DOT> org>
CommitDate: Fri Aug 29 22:57:20 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/qt.git;a=commit;h=279a71a8

[qt5-build.eclass] Make qt5_symlink_tools_to_build_dir() slightly smarter.

With the new behavior, we no longer symlink the tools that are about to
be built. For example, uic is not symlinked when emerging qtwidgets.

---
 eclass/qt5-build.eclass | 21 ++++++++++++++-------
 1 file changed, 14 insertions(+), 7 deletions(-)

diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass
index 226c17a..596e4bd 100644
--- a/eclass/qt5-build.eclass
+++ b/eclass/qt5-build.eclass
@@ -423,16 +423,23 @@ qt5_foreach_target_subdir() {
 # Symlinks qmake and a few other tools to QT5_BUILD_DIR,
 # so that they can be used when building other modules.
 qt5_symlink_tools_to_build_dir() {
-       mkdir -p "${QT5_BUILD_DIR}"/bin || die
+       local tool= tools=()
+       if [[ ${PN} != qtcore ]]; then
+               tools+=(qmake moc rcc qlalr)
+               [[ ${PN} != qdoc ]] && tools+=(qdoc)
+               [[ ${PN} != qtdbus ]] && tools+=(qdbuscpp2xml qdbusxml2cpp)
+               [[ ${PN} != qtwidgets ]] && tools+=(uic)
+       fi
 
-       [[ ${PN} == qtcore ]] && return
+       mkdir -p "${QT5_BUILD_DIR}"/bin || die
+       pushd "${QT5_BUILD_DIR}"/bin >/dev/null || die
 
-       local bin
-       for bin in 
"${QT5_BINDIR}"/{qmake,moc,rcc,qlalr,uic,qdbuscpp2xml,qdbusxml2cpp,qdoc}; do
-               if [[ -e ${bin} ]]; then
-                       ln -s "${bin}" "${QT5_BUILD_DIR}"/bin || die "failed to 
symlink ${bin}"
-               fi
+       for tool in "${tools[@]}"; do
+               [[ -e ${QT5_BINDIR}/${tool} ]] || continue
+               ln -s "${QT5_BINDIR}/${tool}" . || die "failed to symlink 
${tool}"
        done
+
+       popd >/dev/null || die
 }
 
 # @FUNCTION: qt5_base_configure

Reply via email to