Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: ir. Tjeerd Pinkert <t.j.pinkert@vu.nl>
To: buildroot@busybox.net
Subject: [Buildroot] trying to add python-smbus-cffi, but installing fails
Date: Fri, 13 Mar 2015 18:08:31 +0100	[thread overview]
Message-ID: <5503198F.6070804@vu.nl> (raw)

Hi,

I was trying to install the python smbus-cffi as a package (currently in 
my BR2_EXTERNAL directory) but installation fails.

It looks like the package is trying to load itself to register, but of 
course it fails because I think the host python loads this, and can not 
load the _cffi_backend.so compiled for the target?

Anyone an idea how to get solve this chicken egg problem?

This is the part where the install script fails:
Installed 
/local/opt/freescale/buildroot/output/build/python-smbus-cffi-0.4.1/pycparser-2.10-py2.7.egg
Traceback (most recent call last):
   File "setup.py", line 7, in <module>
     import smbus
   File 
"/local/opt/freescale/buildroot/output/build/python-smbus-cffi-0.4.1/smbus/__init__.py", 
line 1, in <module>
     from .smbus import ffi
   File 
"/local/opt/freescale/buildroot/output/build/python-smbus-cffi-0.4.1/smbus/smbus.py", 
line 40, in <module>
     ffi = FFI()
   File 
"/opt/freescale/buildroot/output/target/usr/lib/python2.7/site-packages/cffi/api.py", 
line 56, in __init__
     import _cffi_backend as backend
ImportError: 
/opt/freescale/buildroot/output/target/usr/lib/python2.7/site-packages/_cffi_backend.so: 
wrong ELF class: ELFCLASS32
make: *** 
[/opt/freescale/buildroot/output/build/python-smbus-cffi-0.4.1/.stamp_built] 
Error 1

I include here the Buildroot scripts for installation, which should make 
it easy to test for others. (I think the 
PYTHON_SMBUS_CFFI_INSTALL_TARGET_OPTS = install is not needed, but it 
also fails without this)



Best regards,


Tjeerd Pinkert
-------------- next part --------------
config BR2_PACKAGE_PYTHON_SMBUS_CFFI
	bool "python-smbus-cffi"
	depends on BR2_PACKAGE_PYTHON_CFFI
	help
	  This Python module allows SMBus access through the I2C /dev interface
	  on Linux hosts. The host kernel must have I2C support, I2C device
	  interface support, and a bus adapter driver.

	  This module is a cffi-based python reimplementation of the
	  python-smbus C-extension (http://www.lm-sensors.org/browser
	  /i2c-tools/trunk/py-smbus/) and works on PyPy and CPython (2.6
	  and up).

	  https://pypi.python.org/pypi/smbus-cffi/
-------------- next part --------------
################################################################################
#
# python-smbus-cffi
#
################################################################################

PYTHON_SMBUS_CFFI_VERSION = 0.4.1
PYTHON_SMBUS_CFFI_SOURCE = smbus-cffi-$(PYTHON_SMBUS_CFFI_VERSION).tar.gz
PYTHON_SMBUS_CFFI_SITE = https://pypi.python.org/packages/source/s/smbus-cffi
PYTHON_SMBUS_CFFI_SETUP_TYPE = setuptools
PYTHON_SMBUS_CFFI_INSTALL_TARGET_OPTS = install
PYTHON_SMBUS_CFFI_DEPENDENCIES = host-pkgconf libffi python-cffi
PYTHON_SMBUS_CFFI_LICENSE = GPLv2
PYTHON_SMBUS_CFFI_LICENSE_FILES = LICENSE

$(eval $(python-package))

             reply	other threads:[~2015-03-13 17:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-13 17:08 ir. Tjeerd Pinkert [this message]
2015-03-13 17:22 ` [Buildroot] trying to add python-smbus-cffi, but installing fails Yegor Yefremov
2015-03-13 17:34   ` Yegor Yefremov
2015-03-16 18:43     ` ir. Tjeerd Pinkert
2015-03-17 11:11       ` [Buildroot] [Patch] Added package python-smbus ir. Tjeerd Pinkert
2015-03-17 11:37         ` Zoltan Gyarmati
2015-03-17 14:12           ` ir. Tjeerd Pinkert
2015-04-05 18:11         ` Ryan Barnett

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=5503198F.6070804@vu.nl \
    --to=t.j.pinkert@vu.nl \
    --cc=buildroot@busybox.net \
    /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