From: "Michal Gorny (mgorny)" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-utils-r1.eclass
Date: Thu, 28 Mar 2013 12:21:46 +0000 (UTC) [thread overview]
Message-ID: <20130328122147.0C3AF2171D@flycatcher.gentoo.org> (raw)
mgorny 13/03/28 12:21:46
Modified: ChangeLog python-utils-r1.eclass
Log:
Support obtaining CFLAGS and LIBS for the Python implementation (similarly to pkg-config or python-config).
Revision Changes Path
1.756 eclass/ChangeLog
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.756&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?rev=1.756&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/ChangeLog?r1=1.755&r2=1.756
Index: ChangeLog
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v
retrieving revision 1.755
retrieving revision 1.756
diff -u -r1.755 -r1.756
--- ChangeLog 26 Mar 2013 13:49:39 -0000 1.755
+++ ChangeLog 28 Mar 2013 12:21:46 -0000 1.756
@@ -1,6 +1,10 @@
# ChangeLog for eclass directory
# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.755 2013/03/26 13:49:39 scarabeus Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.756 2013/03/28 12:21:46 mgorny Exp $
+
+ 28 Mar 2013; Michał Górny <mgorny@gentoo.org> python-utils-r1.eclass:
+ Support obtaining CFLAGS and LIBS for the Python implementation (similarly to
+ pkg-config or python-config).
26 Mar 2013; Tomáš Chvátal <scarabeus@gentoo.org> obs-service.eclass:
Fix hardcoded libexec suse path in scripts.
1.20 eclass/python-utils-r1.eclass
file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.20&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?rev=1.20&content-type=text/plain
diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/eclass/python-utils-r1.eclass?r1=1.19&r2=1.20
Index: python-utils-r1.eclass
===================================================================
RCS file: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- python-utils-r1.eclass 7 Mar 2013 20:58:51 -0000 1.19
+++ python-utils-r1.eclass 28 Mar 2013 12:21:46 -0000 1.20
@@ -1,6 +1,6 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.19 2013/03/07 20:58:51 radhermit Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/python-utils-r1.eclass,v 1.20 2013/03/28 12:21:46 mgorny Exp $
# @ECLASS: python-utils-r1
# @MAINTAINER:
@@ -34,7 +34,7 @@
if [[ ! ${_PYTHON_UTILS_R1} ]]; then
-inherit multilib
+inherit multilib toolchain-funcs
# @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
# @INTERNAL
@@ -136,6 +136,34 @@
# /usr/lib64/libpython2.6.so
# @CODE
+# @ECLASS-VARIABLE: PYTHON_CFLAGS
+# @DESCRIPTION:
+# Proper C compiler flags for building against Python. Obtained from
+# pkg-config or python-config.
+#
+# Set and exported on request using python_export().
+# Valid only for CPython. Requires a proper build-time dependency
+# on the Python implementation and on pkg-config.
+#
+# Example value:
+# @CODE
+# -I/usr/include/python2.7
+# @CODE
+
+# @ECLASS-VARIABLE: PYTHON_LIBS
+# @DESCRIPTION:
+# Proper C compiler flags for linking against Python. Obtained from
+# pkg-config or python-config.
+#
+# Set and exported on request using python_export().
+# Valid only for CPython. Requires a proper build-time dependency
+# on the Python implementation and on pkg-config.
+#
+# Example value:
+# @CODE
+# -lpython2.7
+# @CODE
+
# @ECLASS-VARIABLE: PYTHON_PKG_DEP
# @DESCRIPTION:
# The complete dependency on a particular Python package as a string.
@@ -238,7 +266,7 @@
libname=lib${impl}
;;
*)
- die "${EPYTHON} lacks a dynamic library"
+ die "${impl} lacks a dynamic library"
;;
esac
@@ -247,6 +275,46 @@
export PYTHON_LIBPATH=${path}/${libname}$(get_libname)
debug-print "${FUNCNAME}: PYTHON_LIBPATH = ${PYTHON_LIBPATH}"
;;
+ PYTHON_CFLAGS)
+ local val
+
+ case "${impl}" in
+ python2.5|python2.6)
+ # old versions support python-config only
+ val=$("${impl}-config" --includes)
+ ;;
+ python*)
+ # python-2.7, python-3.2, etc.
+ val=$($(tc-getPKG_CONFIG) --cflags ${impl/n/n-})
+ ;;
+ *)
+ die "${impl}: obtaining ${var} not supported"
+ ;;
+ esac
+
+ export PYTHON_CFLAGS=${val}
+ debug-print "${FUNCNAME}: PYTHON_CFLAGS = ${PYTHON_CFLAGS}"
+ ;;
+ PYTHON_LIBS)
+ local val
+
+ case "${impl}" in
+ python2.5|python2.6)
+ # old versions support python-config only
+ val=$("${impl}-config" --libs)
+ ;;
+ python*)
+ # python-2.7, python-3.2, etc.
+ val=$($(tc-getPKG_CONFIG) --libs ${impl/n/n-})
+ ;;
+ *)
+ die "${impl}: obtaining ${var} not supported"
+ ;;
+ esac
+
+ export PYTHON_LIBS=${val}
+ debug-print "${FUNCNAME}: PYTHON_LIBS = ${PYTHON_LIBS}"
+ ;;
PYTHON_PKG_DEP)
local d
case ${impl} in
@@ -353,6 +421,40 @@
echo "${PYTHON_LIBPATH}"
}
+# @FUNCTION: python_get_CFLAGS
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Obtain and print the compiler flags for building against Python,
+# for the given implementation. If no implementation is provided,
+# ${EPYTHON} will be used.
+#
+# 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} "${@}"
+
+ python_export "${@}" PYTHON_CFLAGS
+ echo "${PYTHON_CFLAGS}"
+}
+
+# @FUNCTION: python_get_LIBS
+# @USAGE: [<impl>]
+# @DESCRIPTION:
+# Obtain and print the compiler flags for linking against Python,
+# for the given implementation. If no implementation is provided,
+# ${EPYTHON} will be used.
+#
+# 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_LIBS() {
+ debug-print-function ${FUNCNAME} "${@}"
+
+ python_export "${@}" PYTHON_LIBS
+ echo "${PYTHON_LIBS}"
+}
+
# @FUNCTION: _python_rewrite_shebang
# @INTERNAL
# @USAGE: [<EPYTHON>] <path>...
next reply other threads:[~2013-03-28 12:21 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-28 12:21 Michal Gorny (mgorny) [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-07-27 16:35 [gentoo-commits] gentoo-x86 commit in eclass: ChangeLog python-utils-r1.eclass Michal Gorny (mgorny)
2015-07-27 16:34 Michal Gorny (mgorny)
2015-07-27 16:34 Michal Gorny (mgorny)
2015-07-27 16:32 Michal Gorny (mgorny)
2015-07-25 10:07 Michal Gorny (mgorny)
2015-02-21 8:07 Michal Gorny (mgorny)
2015-01-02 0:15 Michal Gorny (mgorny)
2015-01-02 0:14 Michal Gorny (mgorny)
2014-12-28 18:35 Michal Gorny (mgorny)
2014-12-28 11:24 Michal Gorny (mgorny)
2014-12-27 23:52 Michal Gorny (mgorny)
2014-12-27 23:22 Michal Gorny (mgorny)
2014-12-27 19:31 Michal Gorny (mgorny)
2014-12-27 18:26 Michal Gorny (mgorny)
2014-11-29 23:03 Michal Gorny (mgorny)
2014-11-23 16:05 Mike Gilbert (floppym)
2014-11-23 16:02 Mike Gilbert (floppym)
2014-10-18 22:36 Mike Gilbert (floppym)
2014-09-04 14:52 Michal Gorny (mgorny)
2014-07-06 11:45 Michal Gorny (mgorny)
2014-06-19 15:10 Michal Gorny (mgorny)
2014-05-16 7:54 Michal Gorny (mgorny)
2014-05-01 13:34 Justin Lecher (jlec)
2014-03-13 8:10 Michal Gorny (mgorny)
2014-03-12 9:29 Michal Gorny (mgorny)
2014-03-12 9:23 Michal Gorny (mgorny)
2014-03-12 9:06 Michal Gorny (mgorny)
2014-03-12 8:18 Patrick Lauer (patrick)
2014-02-22 17:01 Mike Gilbert (floppym)
2013-10-27 7:27 Michal Gorny (mgorny)
2013-10-09 19:08 Michal Gorny (mgorny)
2013-10-09 17:23 Michal Gorny (mgorny)
2013-09-17 19:40 Michal Gorny (mgorny)
2013-09-17 17:28 Michal Gorny (mgorny)
2013-09-17 13:25 Michal Gorny (mgorny)
2013-09-16 17:58 Michal Gorny (mgorny)
2013-09-08 14:56 Michal Gorny (mgorny)
2013-09-08 14:54 Michal Gorny (mgorny)
2013-09-05 9:59 Michal Gorny (mgorny)
2013-08-28 22:04 Michal Gorny (mgorny)
2013-07-11 7:20 Michal Gorny (mgorny)
2013-07-11 6:57 Michal Gorny (mgorny)
2013-06-07 1:11 Mike Gilbert (floppym)
2013-05-31 17:40 Michal Gorny (mgorny)
2013-04-14 0:10 Mike Gilbert (floppym)
2013-03-07 20:58 Tim Harder (radhermit)
2013-02-04 13:53 Michal Gorny (mgorny)
2013-02-04 13:52 Michal Gorny (mgorny)
2013-01-29 21:12 Michal Gorny (mgorny)
2013-01-27 16:35 Michal Gorny (mgorny)
2013-01-05 10:01 Michal Gorny (mgorny)
2012-12-30 14:17 Michal Gorny (mgorny)
2012-12-27 22:56 Michal Gorny (mgorny)
2012-12-20 6:05 Mike Gilbert (floppym)
2012-12-15 21:30 Michal Gorny (mgorny)
2012-11-26 10:16 Michal Gorny (mgorny)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130328122147.0C3AF2171D@flycatcher.gentoo.org \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox