public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] python-utils-r1: introduce python_doheader() to install headers
@ 2013-01-24 22:40 Michał Górny
  2013-01-24 22:40 ` [gentoo-python] [PATCH 1/2] Add python_doheader() to install header files into impl-specific dir Michał Górny
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Michał Górny @ 2013-01-24 22:40 UTC (permalink / raw
  To: gentoo-python; +Cc: python

Following my invalid use of insinto with python_get_includedir
in the dev-python/imaging ebuild, I am proposing adding a dedicated
function to install headers into python-specific includedir.

  python_doinclude foo.h bar.h

And that's it. Clean, simple and sane.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* [gentoo-python] [PATCH 1/2] Add python_doheader() to install header files into impl-specific dir.
  2013-01-24 22:40 [gentoo-python] python-utils-r1: introduce python_doheader() to install headers Michał Górny
@ 2013-01-24 22:40 ` Michał Górny
  2013-01-24 22:40 ` [gentoo-python] [PATCH 2/2] Example use on dev-python/imaging Michał Górny
  2013-01-26 15:44 ` [gentoo-python] Re: python-utils-r1: introduce python_doheader() to install headers Mike Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2013-01-24 22:40 UTC (permalink / raw
  To: gentoo-python; +Cc: python, Michał Górny

---
 gx86/eclass/python-utils-r1.eclass | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/gx86/eclass/python-utils-r1.eclass b/gx86/eclass/python-utils-r1.eclass
index 474ac08..4c616e1 100644
--- a/gx86/eclass/python-utils-r1.eclass
+++ b/gx86/eclass/python-utils-r1.eclass
@@ -618,5 +618,34 @@ python_domodule() {
 	python_optimize "${ED}/${d}"
 }
 
+# @FUNCTION: python_doheader
+# @USAGE: <files>...
+# @DESCRIPTION:
+# Install the given headers into the implementation-specific include
+# directory. This function is unconditionally recursive, i.e. you can
+# pass directories instead of files.
+#
+# Example:
+# @CODE
+# src_install() {
+#   python_foreach_impl python_doheader foo.h bar.h
+# }
+# @CODE
+python_doheader() {
+	debug-print-function ${FUNCNAME} "${@}"
+
+	[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
+
+	local d PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR}
+	[[ ${PYTHON_INCLUDEDIR} ]] || python_export PYTHON_INCLUDEDIR
+
+	d=${PYTHON_INCLUDEDIR#${EPREFIX}}
+
+	local INSDESTTREE
+
+	insinto "${d}"
+	doins -r "${@}" || die
+}
+
 _PYTHON_UTILS_R1=1
 fi
-- 
1.8.1.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-python] [PATCH 2/2] Example use on dev-python/imaging.
  2013-01-24 22:40 [gentoo-python] python-utils-r1: introduce python_doheader() to install headers Michał Górny
  2013-01-24 22:40 ` [gentoo-python] [PATCH 1/2] Add python_doheader() to install header files into impl-specific dir Michał Górny
@ 2013-01-24 22:40 ` Michał Górny
  2013-01-26 15:44 ` [gentoo-python] Re: python-utils-r1: introduce python_doheader() to install headers Mike Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Michał Górny @ 2013-01-24 22:40 UTC (permalink / raw
  To: gentoo-python; +Cc: python, Michał Górny

---
 gx86/dev-python/imaging/imaging-1.1.7-r2.ebuild | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/gx86/dev-python/imaging/imaging-1.1.7-r2.ebuild b/gx86/dev-python/imaging/imaging-1.1.7-r2.ebuild
index 0e217a3..f2189b0 100644
--- a/gx86/dev-python/imaging/imaging-1.1.7-r2.ebuild
+++ b/gx86/dev-python/imaging/imaging-1.1.7-r2.ebuild
@@ -76,9 +76,7 @@ python_test() {
 }
 
 python_install() {
-	local incdir=$(python_get_includedir)
-	insinto "${incdir#${EPREFIX}}"
-	doins libImaging/{Imaging.h,ImPlatform.h}
+	python_doheader libImaging/{Imaging.h,ImPlatform.h}
 
 	wrap_phase distutils-r1_python_install
 }
-- 
1.8.1.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [gentoo-python] Re: python-utils-r1: introduce python_doheader() to install headers
  2013-01-24 22:40 [gentoo-python] python-utils-r1: introduce python_doheader() to install headers Michał Górny
  2013-01-24 22:40 ` [gentoo-python] [PATCH 1/2] Add python_doheader() to install header files into impl-specific dir Michał Górny
  2013-01-24 22:40 ` [gentoo-python] [PATCH 2/2] Example use on dev-python/imaging Michał Górny
@ 2013-01-26 15:44 ` Mike Gilbert
  2 siblings, 0 replies; 4+ messages in thread
From: Mike Gilbert @ 2013-01-26 15:44 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-python, python

On Thu, Jan 24, 2013 at 5:40 PM, Michał Górny <mgorny@gentoo.org> wrote:
> Following my invalid use of insinto with python_get_includedir
> in the dev-python/imaging ebuild, I am proposing adding a dedicated
> function to install headers into python-specific includedir.
>
>   python_doinclude foo.h bar.h
>
> And that's it. Clean, simple and sane.
>

Do it.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-01-26 15:45 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-01-24 22:40 [gentoo-python] python-utils-r1: introduce python_doheader() to install headers Michał Górny
2013-01-24 22:40 ` [gentoo-python] [PATCH 1/2] Add python_doheader() to install header files into impl-specific dir Michał Górny
2013-01-24 22:40 ` [gentoo-python] [PATCH 2/2] Example use on dev-python/imaging Michał Górny
2013-01-26 15:44 ` [gentoo-python] Re: python-utils-r1: introduce python_doheader() to install headers Mike Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox