Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Saul Wold <sgw@linux.intel.com>
To: Lukas Bulwahn <lukas.bulwahn@oss.bmw-carit.de>
Cc: Lukas Bulwahn <lukas.bulwahn@bmw-carit.de>,
	openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] distutils: Replacing path to native python by path to python in the image to support python packages with console-script setup
Date: Mon, 10 Dec 2012 15:18:02 -0800	[thread overview]
Message-ID: <50C66DAA.8090800@linux.intel.com> (raw)
In-Reply-To: <1354787367-18543-2-git-send-email-lukas.bulwahn@oss.bmw-carit.de>

On 12/06/2012 01:49 AM, Lukas Bulwahn wrote:
> 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(-)
>
Thanks for the patch, good catch, but need a slight tweak.

Sau!


> 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
I think this should really end up being #!/usr/bin/env python as that's 
how I see all other scripts do it.

>                   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
Same here.
>                   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
>   }
>
>



  parent reply	other threads:[~2012-12-10 23:32 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 ` [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-06  9:54   ` Lukas Bulwahn
2012-12-10 23:18   ` Saul Wold [this message]
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=50C66DAA.8090800@linux.intel.com \
    --to=sgw@linux.intel.com \
    --cc=lukas.bulwahn@bmw-carit.de \
    --cc=lukas.bulwahn@oss.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox