2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2008-06-24 11:55:37 +02:00
|
|
|
#
|
|
|
|
# i2c-tools
|
|
|
|
#
|
2013-06-06 01:53:30 +02:00
|
|
|
################################################################################
|
2011-01-07 18:42:48 +01:00
|
|
|
|
2015-06-18 10:12:28 +02:00
|
|
|
I2C_TOOLS_VERSION = 3.1.2
|
2011-01-07 18:42:48 +01:00
|
|
|
I2C_TOOLS_SOURCE = i2c-tools-$(I2C_TOOLS_VERSION).tar.bz2
|
2012-01-26 17:51:27 +01:00
|
|
|
I2C_TOOLS_SITE = http://dl.lm-sensors.org/i2c-tools/releases
|
2013-10-09 09:10:51 +02:00
|
|
|
I2C_TOOLS_LICENSE = GPLv2+, GPLv2 (py-smbus)
|
|
|
|
I2C_TOOLS_LICENSE_FILES = COPYING
|
2008-06-24 11:55:37 +02:00
|
|
|
|
2015-04-06 00:15:05 +02:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON),y)
|
|
|
|
I2C_TOOLS_DEPENDENCIES += python
|
2015-06-18 10:12:28 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
|
|
I2C_TOOLS_DEPENDENCIES += python3
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Build/install steps mirror the distutil python package type in the python package
|
|
|
|
# infrastructure
|
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
|
2015-04-06 00:15:05 +02:00
|
|
|
# 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"
|
|
|
|
|
|
|
|
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
|
|
|
|
|
2009-11-06 19:36:34 +01:00
|
|
|
define I2C_TOOLS_BUILD_CMDS
|
2014-10-23 10:43:37 +02:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
|
2015-04-06 00:15:05 +02:00
|
|
|
$(I2C_TOOLS_BUILD_PYSMBUS)
|
2009-11-06 19:36:34 +01:00
|
|
|
endef
|
2008-06-24 11:55:37 +02:00
|
|
|
|
2009-11-06 19:36:34 +01:00
|
|
|
define I2C_TOOLS_INSTALL_TARGET_CMDS
|
2008-06-24 11:55:37 +02:00
|
|
|
for i in i2cdump i2cget i2cset i2cdetect; \
|
|
|
|
do \
|
2010-12-09 10:55:03 +01:00
|
|
|
$(INSTALL) -m 755 -D $(@D)/tools/$$i $(TARGET_DIR)/usr/bin/$$i; \
|
2008-06-24 11:55:37 +02:00
|
|
|
done
|
2015-04-06 00:15:05 +02:00
|
|
|
$(I2C_TOOLS_INSTALL_PYSMBUS)
|
2009-11-06 19:36:34 +01:00
|
|
|
endef
|
2008-08-26 16:01:37 +02:00
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|