[OE-core] [PATCH v2 1/2] python-distribute: add nativesdk to BBCLASSEXTEND

João Henrique Ferreira de Freitas joaohf at gmail.com
Thu Jul 17 00:50:23 UTC 2014


Hi Otavio,

Em 15-07-2014 10:35, Otavio Salvador escreveu:
> On Mon, Jul 14, 2014 at 7:55 PM, João Henrique Ferreira de Freitas
> <joaohf at gmail.com> wrote:
>> Without this, python tools that need python-distribute doesn't install
>> in SDK generated by OE.
>>
>> Signed-off-by: João Henrique Ferreira de Freitas <joaohf at gmail.com>
>> ---
>>   meta/recipes-devtools/python/python-distribute_0.6.32.bb | 8 +++++++-
>>   1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/meta/recipes-devtools/python/python-distribute_0.6.32.bb b/meta/recipes-devtools/python/python-distribute_0.6.32.bb
>> index 58bb8b4..7000145 100644
>> --- a/meta/recipes-devtools/python/python-distribute_0.6.32.bb
>> +++ b/meta/recipes-devtools/python/python-distribute_0.6.32.bb
>> @@ -39,6 +39,12 @@ do_install_append() {
>>       echo "./${SRCNAME}-${PV}-py${PYTHON_BASEVERSION}.egg" > ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools.pth
>>   }
>>
>> +do_install_append_class-nativesdk() {
>> +       sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${PYTHON_SITEPACKAGES_DIR}/distribute-${PV}-py${PYTHON_BASEVERSION}.egg/setuptools/tests/test_resources.py
>> +       sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install
>> +       sed -i -e '1s|^#!.*|#!/usr/bin/env python|' ${D}${bindir}/easy_install-${PYTHON_BASEVERSION}
>> +}
> Couldn't this be done unconditionally for all target types?
> "/usr/bin/env python" should work fine in target as well, no?
>
I don't know if I fully understood your question...


Do you mean by 'all target types' like native, nativesdk ?

In some recipes (gnome-doc-utils.inc, createrepo_0.4.11.bb) , this 
pattern was used:

----
# Wrap the python script since the native python is
# ${bindir}/python-native/python, and the "#! /usr/bin/env python" can't
# find it since it is not in PATH.
do_install_append_class-native () {
  ...
   sed -i -e 's|^#!.*/usr/bin/env python|#! /usr/bin/env nativepython|' $i
  ...
}
----

Sometimes I feel really lost when need to fixes things like that. What 
is the correct way?

Without do_install_append_class-nativesdk() I got:

Computing transaction...error: Can't install nativesdk-python-distribute-0.6.32-ml5 at x86_64_nativesdk: no package provides /usr/bin/python


Thanks.

-- 
João Henrique Ferreira de Freitas - joaohf_at_gmail.com
Campinas-SP-Brasil




More information about the Openembedded-core mailing list