i2c-tools: add hash file
PATCH v4 1/2 i2c-tools: add hash file
Signed-off-by Ryan Barnett <[email protected]>
Acked-by "Yann E. MORIN" <[email protected]>
---
Changes v2->v3:
- None
--- package/i2c-tools/i2c-tools.hash | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 package/i2c-tools/i2c-tools.hash
package/i2c-tools/i2c-tools.hash new file +2 -0
@@ -0,0 +1,2 @@ +# locally computed hash +sha256 14d4d7d60d1c12e43f2befe239c682a5c44c27682f153d4b58c1e392d2db1700 i2c-tools-3.1.1.tar.bz2
Signature · 1 line
1.9.1
PATCH v4 2/2 i2c-tools: add support to build python extension
Add a config option to build the python bindings for i2c-tools - py-smbus. The steps for building the python bindings is the same as the distutil steps that are a part of the python infrastructure.
Signed-off-by Ryan Barnett <[email protected]>
CC Thomas Petazzoni <[email protected]>
CC Baruch Siach <[email protected]>
CC Yann E. MORIN <[email protected]>
---
Changes v2 -> v3:
- Removed Config.in entry (suggested by Baruch)
- Moved install and build defines with the CMD block (suggested by Yann)
Changes v1 -> v2:
- Fixed spelling in config entry
- Utilize the python infrastructure variables for environment and build/install opts (suggested by Thomas P)
- Only support python2.7 since this is not compatabile with python3 (suggested by Baruch)
--- package/i2c-tools/i2c-tools.mk | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
package/i2c-tools/i2c-tools.mk +28 -0
@@ -10,8 +10,35 @@ I2C_TOOLS_SITE = http://dl.lm-sensors.org/i2c-tools/releases I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus) I2C_TOOLS_LICENSE_FILES = COPYING +# BASE_ENV taken from PKG_PYTHON_DISTUTILS_ENV in package/pkg-python.mk +I2C_TOOLS_PYTHON_BASE_ENV = \ + $(PKG_PYTHON_DISTUTILS_ENV) \ + CFLAGS="$(TARGET_CFLAGS) -I../include" + +# Build/install steps mirror the distutil python package type in the python package +# infrastructure +ifeq ($(BR2_PACKAGE_PYTHON),y) +I2C_TOOLS_DEPENDENCIES += python + +define I2C_TOOLS_BUILD_PYSMBUS + (cd $(@D)/py-smbus; \ + $(I2C_TOOLS_PYTHON_BASE_ENV) \ + $(HOST_DIR)/usr/bin/python setup.py build \ + $(PKG_PYTHON_DISTUTILS_BUILD_OPTS)) +endef + +define I2C_TOOLS_INSTALL_PYSMBUS + (cd $(@D)/py-smbus; \ + $(I2C_TOOLS_PYTHON_BASE_ENV) \ + $(HOST_DIR)/usr/bin/python setup.py install \ + $(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS)) +endef + +endif # BR2_PACKAGE_PYTHON + define I2C_TOOLS_BUILD_CMDS $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) + $(I2C_TOOLS_BUILD_PYSMBUS) endef define I2C_TOOLS_INSTALL_TARGET_CMDS
@@ -19,6 +46,7 @@ define I2C_TOOLS_INSTALL_TARGET_CMDS do \ $(INSTALL) -m 755 -D $(@D)/tools/$$i $(TARGET_DIR)/usr/bin/$$i; \ done + $(I2C_TOOLS_INSTALL_PYSMBUS) endef $(eval $(generic-package))
Signature · 1 line
1.9.1