From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5E7721395E2 for ; Thu, 1 Dec 2016 13:49:30 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 76716E0B8B; Thu, 1 Dec 2016 13:49:28 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 536F1E0B8B for ; Thu, 1 Dec 2016 13:49:28 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 7007F340E7B for ; Thu, 1 Dec 2016 13:49:26 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A12B3498 for ; Thu, 1 Dec 2016 13:49:24 +0000 (UTC) From: "Michael Palimaka" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Palimaka" Message-ID: <1480600150.59718fb00fe774f1918dd7263f016e6993dc99e5.kensington@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: kensington X-VCS-Committer-Name: Michael Palimaka X-VCS-Revision: 59718fb00fe774f1918dd7263f016e6993dc99e5 X-VCS-Branch: master Date: Thu, 1 Dec 2016 13:49:24 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 91bac1ba-fa60-442f-8e24-29d54809f01f X-Archives-Hash: 862af293780522f792dfabbddac3d135 commit: 59718fb00fe774f1918dd7263f016e6993dc99e5 Author: Michael Palimaka gentoo org> AuthorDate: Wed Nov 30 19:33:34 2016 +0000 Commit: Michael Palimaka gentoo org> CommitDate: Thu Dec 1 13:49:10 2016 +0000 URL: https://gitweb.gentoo.org/proj/qt.git/commit/?id=59718fb0 qt5-build.eclass: introduce qt_use_disable_config Similar to qt_use_disable_mod, this function helps avoid automagic dependencies. eclass/qt5-build.eclass | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/eclass/qt5-build.eclass b/eclass/qt5-build.eclass index 9727ce7..d496ba0 100644 --- a/eclass/qt5-build.eclass +++ b/eclass/qt5-build.eclass @@ -388,6 +388,29 @@ qt_use_compile_test() { fi } +# @FUNCTION: qt_use_disable_config +# @USAGE: +# @DESCRIPTION: +# is the name of a flag in IUSE. +# is the (lowercase) name of a Qt5 config entry. +# is a list of one or more qmake project files. +# +# This function patches to treat as disabled +# when is disabled, otherwise it does nothing. +# This can be useful to avoid an automagic dependency when the config entry +# is enabled on the system but the corresponding USE flag is disabled. +qt_use_disable_config() { + [[ $# -ge 3 ]] || die "${FUNCNAME}() requires at least three arguments" + + local flag=$1 + local config=$2 + shift 2 + + if ! use "${flag}"; then + echo "$@" | xargs sed -i -e "s/qtConfig(${config})/false/g" || die + fi +} + # @FUNCTION: qt_use_disable_mod # @USAGE: # @DESCRIPTION: