All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
To: openembedded-core@lists.openembedded.org
Cc: Lukas Bulwahn <lukas.bulwahn@bmw-carit.de>,
	Lukas Bulwahn <Lukas.Bulwahn@oss.bmw-carit.de>
Subject: [PATCH] distutils: Replacing path to native python by path to python in the image to support python packages with console-script setup
Date: Thu,  6 Dec 2012 10:49:27 +0100	[thread overview]
Message-ID: <1354787367-18543-2-git-send-email-lukas.bulwahn@oss.bmw-carit.de> (raw)
In-Reply-To: <1354787367-18543-1-git-send-email-lukas.bulwahn@oss.bmw-carit.de>

From: Lukas Bulwahn <lukas.bulwahn@bmw-carit.de>

When using distutils for a python package based on a python-setuptools
installation script that sets up a console script, the header
of the console script created by setuptools points to the
python-native path.

The console scripts are commonly executed in the image, but not
in the sysroot environment. Therefore, the header of the
console scripts should point to the python interpreter in the
image.

Setuptools does not allow to set the path of the python
interpreter via some command-line argument.
Hence after the installation script ran, the distutils
class replaces the path in the console script files created by
the installation.

Signed-off-by: Lukas Bulwahn <Lukas.Bulwahn@oss.bmw-carit.de>
---
 meta/classes/distutils.bbclass |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/meta/classes/distutils.bbclass b/meta/classes/distutils.bbclass
index 552e5f3..f67297e 100644
--- a/meta/classes/distutils.bbclass
+++ b/meta/classes/distutils.bbclass
@@ -47,12 +47,14 @@ distutils_do_install() {
 
         if test -e ${D}${bindir} ; then	
             for i in ${D}${bindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/python:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
 
         if test -e ${D}${sbindir}; then
             for i in ${D}${sbindir}/* ; do \
+                sed -i -e s:${STAGING_BINDIR_NATIVE}/python-native/python:${bindir}/python:g $i
                 sed -i -e s:${STAGING_BINDIR_NATIVE}:${bindir}:g $i
             done
         fi
@@ -64,7 +66,6 @@ distutils_do_install() {
         #
         if test -e ${D}${datadir}/share; then
             mv -f ${D}${datadir}/share/* ${D}${datadir}/
-            rmdir ${D}${datadir}/share
         fi
 }
 
-- 
1.7.9.5




  reply	other threads:[~2012-12-06 10:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-06  9:49 (No subject) Lukas Bulwahn
2012-12-06  9:49 ` Lukas Bulwahn [this message]
2012-12-06  9:54   ` [PATCH] distutils: Replacing path to native python by path to python in the image to support python packages with console-script setup Lukas Bulwahn
2012-12-10 23:18   ` Saul Wold
2012-12-13 16:43     ` Lukas Bulwahn
     [not found] <0C66DAA.8090800@linux.intel.com>
2012-12-13 16:55 ` Lukas Bulwahn

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=1354787367-18543-2-git-send-email-lukas.bulwahn@oss.bmw-carit.de \
    --to=lukas.bulwahn@oss.bmw-carit.de \
    --cc=lukas.bulwahn@bmw-carit.de \
    --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.