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 8D1E6138350 for ; Thu, 5 Mar 2020 15:16:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E655E0AE9; Thu, 5 Mar 2020 15:11:21 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C37CAE0AE5 for ; Thu, 5 Mar 2020 15:11:20 +0000 (UTC) Received: from localhost.localdomain (c142-245.icpnet.pl [85.221.142.245]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id CF72934EDB4; Thu, 5 Mar 2020 15:11:17 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: python@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH v2 14/20] python-utils-r2.eclass: Remove PYTHON_CFLAGS export Date: Thu, 5 Mar 2020 16:10:18 +0100 Message-Id: <20200305151024.125834-15-mgorny@gentoo.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200305151024.125834-1-mgorny@gentoo.org> References: <20200305151024.125834-1-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: 99a25e35-da5f-492d-b73f-2d2566699f91 X-Archives-Hash: 54f9679d9c1ad296514057cf5559a8dd Signed-off-by: Michał Górny --- eclass/python-utils-r2.eclass | 36 ++++++++++++++------------------- eclass/tests/python-utils-r2.sh | 6 +++--- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/eclass/python-utils-r2.eclass b/eclass/python-utils-r2.eclass index eb3f2c7e5b14..2aa063152e3e 100644 --- a/eclass/python-utils-r2.eclass +++ b/eclass/python-utils-r2.eclass @@ -271,22 +271,6 @@ _python_export() { export PYTHON=${EPREFIX}/usr/bin/${impl} debug-print "${FUNCNAME}: PYTHON = ${PYTHON}" ;; - PYTHON_CFLAGS) - local val - - case "${impl}" in - python*) - # python-2.7, python-3.2, etc. - val=$($(tc-getPKG_CONFIG) --cflags ${impl/n/n-}) || die - ;; - *) - die "${impl}: obtaining ${var} not supported" - ;; - esac - - export PYTHON_CFLAGS=${val} - debug-print "${FUNCNAME}: PYTHON_CFLAGS = ${PYTHON_CFLAGS}" - ;; PYTHON_LIBS) local val @@ -412,20 +396,30 @@ python_get_library_path() { } # @FUNCTION: python_get_CFLAGS -# @USAGE: [] # @DESCRIPTION: # Obtain and print the compiler flags for building against Python, -# for the given implementation. If no implementation is provided, -# ${EPYTHON} will be used. +# for ${EPYTHON}. # # Please note that this function can be used with CPython only. # It requires Python and pkg-config installed, and therefore proper # build-time dependencies need be added to the ebuild. python_get_CFLAGS() { debug-print-function ${FUNCNAME} "${@}" + [[ ${EPYTHON} ]] || die "EPYTHON must be set before calling ${FUNCNAME}" - _python_export "${@}" PYTHON_CFLAGS - echo "${PYTHON_CFLAGS}" + local out + case ${EPYTHON} in + python*) + # python-2.7, python-3.2, etc. + out=$($(tc-getPKG_CONFIG) --cflags ${EPYTHON/n/n-}) || die + ;; + *) + die "${impl}: obtaining CFLAGS not supported" + ;; + esac + + debug-print "${FUNCNAME} -> ${out}" + echo "${out}" } # @FUNCTION: python_get_LIBS diff --git a/eclass/tests/python-utils-r2.sh b/eclass/tests/python-utils-r2.sh index cba74b84c70a..fd0883376ab7 100755 --- a/eclass/tests/python-utils-r2.sh +++ b/eclass/tests/python-utils-r2.sh @@ -80,7 +80,7 @@ if [[ -x /usr/bin/python2.7 ]]; then test_get includedir python2.7 /usr/include/python2.7 test_get library_path python2.7 "/usr/lib*/libpython2.7$(get_libname)" test_var PYTHON_CONFIG python2_7 /usr/bin/python2.7-config - test_var PYTHON_CFLAGS python2_7 "*-I/usr/include/python2.7*" + test_get CFLAGS python2.7 "*-I/usr/include/python2.7*" test_var PYTHON_LIBS python2_7 "*-lpython2.7*" fi test_var PYTHON_PKG_DEP python2_7 '*dev-lang/python*:2.7' @@ -94,7 +94,7 @@ if [[ -x /usr/bin/python3.6 ]]; then test_get includedir python3.6 "/usr/include/python3.6${abiflags}" test_get library_path python3.6 "/usr/lib*/libpython3.6${abiflags}$(get_libname)" test_var PYTHON_CONFIG python3_6 "/usr/bin/python3.6${abiflags}-config" - test_var PYTHON_CFLAGS python3_6 "*-I/usr/include/python3.6*" + test_get CFLAGS python3.6 "*-I/usr/include/python3.6*" test_var PYTHON_LIBS python3_6 "*-lpython3.6*" fi test_var PYTHON_PKG_DEP python3_6 '*dev-lang/python*:3.6' @@ -108,7 +108,7 @@ if [[ -x /usr/bin/python3.7 ]]; then test_get includedir python3.7 "/usr/include/python3.7${abiflags}" test_get library_path python3.7 "/usr/lib*/libpython3.7${abiflags}$(get_libname)" test_var PYTHON_CONFIG python3_7 "/usr/bin/python3.7${abiflags}-config" - test_var PYTHON_CFLAGS python3_7 "*-I/usr/include/python3.7*" + test_get CFLAGS python3.7 "*-I/usr/include/python3.7*" test_var PYTHON_LIBS python3_7 "*-lpython3.7*" fi test_var PYTHON_PKG_DEP python3_7 '*dev-lang/python*:3.7' -- 2.25.1