From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1Scmjq-0000Jp-UI for garchives@archives.gentoo.org; Fri, 08 Jun 2012 00:07:39 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 92689E067D; Fri, 8 Jun 2012 00:07:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 4F4BFE0676 for ; Fri, 8 Jun 2012 00:07:31 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8B76A1B402D for ; Fri, 8 Jun 2012 00:07:30 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 5325CE5432 for ; Fri, 8 Jun 2012 00:07:29 +0000 (UTC) From: "Davide Pesavento" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Davide Pesavento" Message-ID: <1339113746.4aa226b76f0168f53919278534004e8cba8ce0cc.pesa@gentoo> Subject: [gentoo-commits] proj/qt:master commit in: eclass/ X-VCS-Repository: proj/qt X-VCS-Files: eclass/qt5-build.eclass X-VCS-Directories: eclass/ X-VCS-Committer: pesa X-VCS-Committer-Name: Davide Pesavento X-VCS-Revision: 4aa226b76f0168f53919278534004e8cba8ce0cc X-VCS-Branch: master Date: Fri, 8 Jun 2012 00:07:29 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: d04ea401-141f-4798-a2b3-382cd6b1086d X-Archives-Hash: ecb798412f9c3dabe81462f8e589951b commit: 4aa226b76f0168f53919278534004e8cba8ce0cc Author: Davide Pesavento gmail com> AuthorDate: Fri Jun 8 00:02:26 2012 +0000 Commit: Davide Pesavento gentoo org> CommitDate: Fri Jun 8 00:02:26 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/qt.git;a=3Dco= mmit;h=3D4aa226b7 [qt5-build.eclass] Add support for building other Qt modules. --- eclass/qt5-build.eclass | 74 +++++++++++++++++++++++++++++++++--------= ----- 1 files changed, 53 insertions(+), 21 deletions(-) diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index 03bb283..874e9e2 100644 --- a/eclass/qt5-build.eclass +++ b/eclass/qt5-build.eclass @@ -150,20 +150,24 @@ qt5-build_src_unpack() { default ;; esac - - qt5_prepare_env } =20 # @FUNCTION: qt5-build_src_prepare # @DESCRIPTION: # Prepare the sources before the configure phase. qt5-build_src_prepare() { + qt5_prepare_env + + mkdir -p "${QT5_BUILD_DIR}" || die + if [[ ${PN} !=3D "qt-core" ]]; then - skip_qmake_build - skip_project_generation - symlink_binaries_to_buildtree + symlink_tools_to_buildtree fi =20 + # Avoid unnecessary qmake recompilations + sed -i -re "s|^if true;.*(\[ '\!').*(\"\\\$outpath/bin/qmake\".*)|if \1= -e \2 then|" \ + configure || die "sed configure failed" + # Respect CC, CXX, *FLAGS, MAKEOPTS and EXTRA_EMAKE when building qmake sed -i -e "/\"\$MAKE\".*QMAKE_BUILD_ERROR/ s:): \ ${MAKEOPTS} ${EXTRA_EMAKE} \ @@ -182,11 +186,11 @@ qt5-build_src_prepare() { # in compile.test, -m flags are passed to the linker via LIBS # config tests that use $COMPILER directly ignore toolchain =20 - # respect compiler + # Respect C/C++ compiler tc-export CC CXX # qmake-generated Makefiles use LD/LINK for linking export LD=3D"$(tc-getCXX)" - # don't strip binaries + # Don't strip binaries export STRIP=3D":" =20 base_src_prepare @@ -252,13 +256,23 @@ qt5-build_src_configure() { "${myconf[@]}" ) =20 - mkdir -p "${QT5_BUILD_DIR}" || die pushd "${QT5_BUILD_DIR}" >/dev/null || die - einfo "Configuring with: ${conf[@]}" "${S}"/configure "${conf[@]}" || die "configure failed" - popd >/dev/null || die + + if [[ ${PN} !=3D "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}" + "${QT5_BUILD_DIR}"/bin/qmake \ + "${S}/${subdir}/${subdir##*/}.pro" \ + QMAKE_LIBDIR_QT=3D"${QTLIBDIR}" \ + || die "qmake failed in ${subdir}" + popd >/dev/null || die + done + fi } =20 # @FUNCTION: qt5-build_src_compile @@ -268,7 +282,7 @@ 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}" + einfo "Building in: ${subdir}" emake popd >/dev/null || die done @@ -320,11 +334,26 @@ qt5-build_pkg_postrm() { : } =20 +# @FUNCTION: qt_use +# @USAGE: < flag > [ feature ] [ enableval ] +# @DESCRIPTION: +# This will echo "-${enableval}-${feature}" if is enabled, or +# "-no-${feature}" if it's disabled. If [feature] is not specified, +# will be used for that. If [enableval] is not specified, it omits the +# "-${enableval}" part. +qt_use() { + use "$1" && echo "${3:+-$3}-${2:-$1}" || echo "-no-${2:-$1}" +} + + +###### Internal functions ###### + # @FUNCTION: qt5_prepare_env # @INTERNAL # @DESCRIPTION: -# Sets up installation directories. +# Prepares the environment for building Qt. qt5_prepare_env() { + # setup installation directories QTPREFIXDIR=3D${EPREFIX}/usr QTBINDIR=3D${EPREFIX}/usr/qt5/bin # FIXME QTLIBDIR=3D${QTPREFIXDIR}/$(get_libdir)/qt5 @@ -339,21 +368,24 @@ qt5_prepare_env() { QTSYSCONFDIR=3D${EPREFIX}/etc/qt5 } =20 -# @FUNCTION: qt_use -# @USAGE: < flag > [ feature ] [ enableval ] +# @FUNCTION: symlink_tools_to_buildtree +# @INTERNAL # @DESCRIPTION: -# This will echo "-${enableval}-${feature}" if is enabled, or -# "-no-${feature}" if it's disabled. If [feature] is not specified, -# will be used for that. If [enableval] is not specified, it omits the -# "-${enableval}" part. -qt_use() { - use "$1" && echo "${3:+-$3}-${2:-$1}" || echo "-no-${2:-$1}" +# Symlinks qt-core tools to buildtree, so they can be used when building= other modules. +symlink_tools_to_buildtree() { + mkdir -p "${QT5_BUILD_DIR}"/bin || die + + local bin + for bin in "${QTBINDIR}"/{qmake,moc,rcc}; do + ln -s "${bin}" "${QT5_BUILD_DIR}"/bin/ \ + || die "symlinking '${bin}' to '${QT5_BUILD_DIR}/bin/' failed" + done } =20 # @FUNCTION: install_qconfigs # @INTERNAL # @DESCRIPTION: -# Install gentoo-specific mkspecs configurations. +# Installs gentoo-specific mkspecs configurations. install_qconfigs() { local x =20