All of lore.kernel.org
 help / color / mirror / Atom feed
From: Morgan Little <morgan.little@windriver.com>
To: <openembedded-core@lists.openembedded.org>
Subject: [PATCH 01/20] python-native: Put binaries in seperate directory
Date: Fri, 13 Jul 2012 09:54:50 -0400	[thread overview]
Message-ID: <1342187709-19368-2-git-send-email-morgan.little@windriver.com> (raw)
In-Reply-To: <1342187709-19368-1-git-send-email-morgan.little@windriver.com>

Update python-native to install the binaries in the python-native directory,
add pythonnative.bbclass to let recipes that need python-native use the
binaries and update disutils access the new binaries.

Signed-off-by: Morgan Little <morgan.little@windriver.com>
---
 meta/classes/distutils.bbclass                     |   14 +++++++++-----
 meta/classes/pythonnative.bbclass                  |    3 +++
 .../recipes-devtools/python/python-native_2.7.3.bb |    9 ++++++---
 3 files changed, 18 insertions(+), 8 deletions(-)
 create mode 100644 meta/classes/pythonnative.bbclass

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index bcddf8d..f731257 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -1,4 +1,4 @@
-inherit distutils-base
+inherit distutils-base pythonnative
 
 DISTUTILS_BUILD_ARGS ?= ""
 DISTUTILS_STAGE_HEADERS_ARGS ?= "--install-dir=${STAGING_INCDIR}/${PYTHON_DIR}"
@@ -11,14 +11,14 @@ distutils_do_compile() {
          STAGING_INCDIR=${STAGING_INCDIR} \
          STAGING_LIBDIR=${STAGING_LIBDIR} \
          BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-         ${STAGING_BINDIR_NATIVE}/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
+         ${STAGING_BINDIR_NATIVE}/python-native/python setup.py build ${DISTUTILS_BUILD_ARGS} || \
          bbfatal "python setup.py build_ext execution failed."
 }
 
 distutils_stage_headers() {
         install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install_headers ${DISTUTILS_STAGE_HEADERS_ARGS} || \
         bbfatal "python setup.py install_headers execution failed."
 }
 
@@ -28,7 +28,7 @@ distutils_stage_all() {
         install -d ${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR}
         PYTHONPATH=${STAGING_DIR_HOST}${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install ${DISTUTILS_STAGE_ALL_ARGS} || \
         bbfatal "python setup.py install (stage) execution failed."
 }
 
@@ -38,7 +38,7 @@ distutils_do_install() {
         STAGING_LIBDIR=${STAGING_LIBDIR} \
         PYTHONPATH=${D}/${PYTHON_SITEPACKAGES_DIR} \
         BUILD_SYS=${BUILD_SYS} HOST_SYS=${HOST_SYS} \
-        ${STAGING_BINDIR_NATIVE}/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \
+        ${STAGING_BINDIR_NATIVE}/python-native/python setup.py install ${DISTUTILS_INSTALL_ARGS} || \
         bbfatal "python setup.py install execution failed."
 
         for i in `find ${D} -name "*.py"` ; do \
@@ -65,6 +65,10 @@ distutils_do_install() {
         if test -e ${D}${datadir}/share; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
         fi
+
+        # These are generated files, on really slow systems the storage/speed trade off
+        # might be worth it, but in general it isn't 
+        find ${D}${libdir}/${PYTHON_DIR}/site-packages -iname '*.pyo' -exec rm {} \;
 }
 
 EXPORT_FUNCTIONS do_compile do_install
diff --git a/meta/classes/pythonnative.bbclass b/meta/classes/pythonnative.bbclass
new file mode 100644
index 0000000..bc346da
--- /dev/null
+++ b/meta/classes/pythonnative.bbclass
@@ -0,0 +1,3 @@
+PYTHON="${STAGING_BINDIR_NATIVE}/python-native/python"
+PATH_prepend = "${STAGING_BINDIR_NATIVE}/python-native:"
+DEPENDS += " python-native "
diff --git a/meta/recipes-devtools/python/python-native_2.7.3.bb b/meta/recipes-devtools/python/python-native_2.7.3.bb
index 50bf894..a4cbdcd 100644
--- a/meta/recipes-devtools/python/python-native_2.7.3.bb
+++ b/meta/recipes-devtools/python/python-native_2.7.3.bb
@@ -1,6 +1,6 @@
 require python.inc
 DEPENDS = "openssl-native bzip2-full-native zlib-native readline-native sqlite3-native"
-PR = "${INC_PR}.0"
+PR = "${INC_PR}.1"
 
 SRC_URI += "file://04-default-is-optimized.patch \
            file://05-enable-ctypes-cross-build.patch \
@@ -20,6 +20,8 @@ inherit native
 
 RPROVIDES += "python-distutils-native python-compression-native python-textutils-native python-core-native"
 
+EXTRA_OECONF += " --bindir=${bindir}/${PN}"
+
 EXTRA_OEMAKE = '\
   BUILD_SYS="" \
   HOST_SYS="" \
@@ -35,10 +37,11 @@ do_configure_prepend() {
 do_install() {
 	oe_runmake 'DESTDIR=${D}' install
 	install -d ${D}${bindir}/
-	install -m 0755 Parser/pgen ${D}${bindir}/
+	install -d ${D}${bindir}/${PN}
+	install -m 0755 Parser/pgen ${D}${bindir}/${PN}
 
 	# Make sure we use /usr/bin/env python
-	for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do
+	for PYTHSCRIPT in `grep -rIl ${bindir}/${PN}/python ${D}${bindir}/${PN}`; do
 		sed -i -e '1s|^#!.*|#!/usr/bin/env python|' $PYTHSCRIPT
 	done
 }
-- 
1.7.0.4




  reply	other threads:[~2012-07-13 15:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-13 13:54 [PATCH 00/20] Change python-native path Morgan Little
2012-07-13 13:54 ` Morgan Little [this message]
2012-07-15  3:06   ` [PATCH 01/20] python-native: Put binaries in seperate directory Randy MacLeod
2012-07-13 13:54 ` [PATCH 02/20] python: Update for python-native changes Morgan Little
2012-07-13 13:54 ` [PATCH 03/20] python-dbus: " Morgan Little
2012-07-13 13:54 ` [PATCH 04/20] python-gst: " Morgan Little
2012-07-13 13:54 ` [PATCH 05/20] python-pygobject: " Morgan Little
2012-07-13 13:54 ` [PATCH 06/20] python-pygtk: " Morgan Little
2012-07-13 13:54 ` [PATCH 07/20] python-pyrex-native:Update " Morgan Little
2012-07-13 13:54 ` [PATCH 08/20] python-scons-native: Update " Morgan Little
2012-07-13 13:54 ` [PATCH 09/20] python-setuptools: " Morgan Little
2012-07-16  8:50   ` Richard Purdie
2012-07-18 20:07     ` Little, Morgan
2012-07-13 13:54 ` [PATCH 10/20] telepathy-glib: " Morgan Little
2012-07-13 13:55 ` [PATCH 11/20] telepathy-python: " Morgan Little
2012-07-13 13:55 ` [PATCH 12/20] libxml2: " Morgan Little
2012-07-13 13:55 ` [PATCH 13/20] mklibs-native: " Morgan Little
2012-07-13 13:55 ` [PATCH 14/20] gnome-doc-utils: " Morgan Little
2012-07-13 13:55 ` [PATCH 15/20] mesa-common: " Morgan Little
2012-07-13 13:55 ` [PATCH 16/20] libxcb: " Morgan Little
2012-07-13 13:55 ` [PATCH 17/20] xcb-proto: " Morgan Little
2012-07-13 13:55 ` [PATCH 18/20] kernelshark: " Morgan Little
2012-07-13 13:55 ` [PATCH 19/20] trace-cmd: " Morgan Little
2012-07-13 13:55 ` [PATCH 20/20] gobject-introspection: " Morgan Little

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=1342187709-19368-2-git-send-email-morgan.little@windriver.com \
    --to=morgan.little@windriver.com \
    --cc=openembedded-core@lists.openembedded.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.