openembedded - Building python packages -


i bitbaking couple of python libraries , got warning while adding second 1 of them:

warning: recipe trying install files shared area when files exist. files are:    /home/ilya/beaglebone-dany/build/tmp/sysroots/beaglebone/usr/lib/python2.7/site-packages/site.py    /home/ilya/beaglebone-dany/build/tmp/sysroots/beaglebone/usr/lib/python2.7/site-packages/site.pyo 

the libraries both use inherit distutils. okay far bitbake goes, when tried install second package via opkg, got error:

# opkg install http://yocto.local:8080/python-requests_1.2.0-r0_armv7a-vfp-neon.ipk downloading http://yocto.local:8080/python-requests_1.2.0-r0_armv7a-vfp-neon.ipk. installing python-requests (1.2.0-r0) root... configuring python-requests.  # opkg install http://yocto.local:8000/python-mylib_0.0.1-r0_armv7a-vfp-neon.ipk downloading http://yocto.local:8080/python-mylib_0.0.1-r0_armv7a-vfp-neon.ipk. installing python-mylib (0.0.1-r0) root... collected errors:  * check_data_file_clashes: package mylib-python wants install file /usr/lib/python2.7/site-packages/site.py         file provided package  * python-requests  * check_data_file_clashes: package mylib-python wants install file /usr/lib/python2.7/site-packages/site.pyo         file provided package  * python-requests  * opkg_install_cmd: cannot install package mylib-python. 

both recipes so:

description = "requests: http humans" homepage = "http://docs.python-requests.org/en/latest/" section = "devel/python" license = "apache-2.0"  depends = "python" rdepends_${pn} = "python-core" pr = "r0"  src_uri = "git://github.com/kennethreitz/requests;protocol=git"  s = "${workdir}/git/"  inherit distutils  #note: i'm not 100% sure whether still need export these? export build_sys export host_sys export staging_incdir export staging_libdir  bbclassextend = "native" 

i have copied pycurl recipe, have had these lines removed:

do_install_append() {     rm -rf ${d}${datadir}/share } 

to rid of conflicting /usr/lib/python2.7/site-packages/site.py, 1 needs avoid shipping file doing this:

do_install_append() {   rm -f ${d}${libdir}/python*/site-packages/site.py* } 

there had been issue original version of recipe, files installed contained .egg directory. wasn't able import resulting package.

it turns out using inherit setuptools instead of inherit distutils works.

i'm not python expert, setuptools class this:

inherit distutils  depends += "python-setuptools-native"  distutils_install_args = "--root=${d} \     --single-version-externally-managed \     --prefix=${prefix} \     --install-lib=${python_sitepackages_dir} \     --install-data=${datadir}" 

it turns out modules (e.g. pybbio) not recognise --single-version-externally-managed, have use inherit distutils , working package.

below full recipe python-requests package should available upstream, in case intending use it.

description = "requests: http humans" homepage = "http://docs.python-requests.org/en/latest/" section = "devel/python" license = "apache-2.0"  #depends = "python-core" rdepends_${pn} = "python" pr = "r0"  src_uri = "git://github.com/kennethreitz/requests;protocol=git"  s = "${workdir}/git/"  inherit setuptools  # need export these variables python-config work export build_sys export host_sys export staging_incdir export staging_libdir  bbclassextend = "native"  do_install_append() {   rm -f ${d}${libdir}/python*/site-packages/site.py* } 

Comments

Popular posts from this blog

node.js - Bad Request - node js ajax post -

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -