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
|
|
|
|
2018-12-11 12:52:06 +01:00
|
|
|
I2C_TOOLS_VERSION = 4.1
|
2017-07-10 13:38:01 +02:00
|
|
|
I2C_TOOLS_SOURCE = i2c-tools-$(I2C_TOOLS_VERSION).tar.xz
|
|
|
|
I2C_TOOLS_SITE = https://www.kernel.org/pub/software/utils/i2c-tools
|
2018-08-24 15:54:06 +02:00
|
|
|
I2C_TOOLS_LICENSE = GPL-2.0+, GPL-2.0 (py-smbus), LGPL-2.1+ (libi2c)
|
|
|
|
I2C_TOOLS_LICENSE_FILES = COPYING COPYING.LGPL README
|
2017-12-21 15:54:10 +01:00
|
|
|
I2C_TOOLS_MAKE_OPTS = EXTRA=eeprog
|
2018-08-24 15:54:07 +02:00
|
|
|
I2C_TOOLS_INSTALL_STAGING = YES
|
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
|
|
|
|
|
2017-12-21 15:54:10 +01:00
|
|
|
ifeq ($(BR2_STATIC_LIBS),y)
|
|
|
|
I2C_TOOLS_MAKE_OPTS += BUILD_DYNAMIC_LIB=0 USE_STATIC_LIB=1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_SHARED_LIBS),y)
|
|
|
|
I2C_TOOLS_MAKE_OPTS += BUILD_STATIC_LIB=0
|
|
|
|
endif
|
|
|
|
|
2015-06-18 10:12:28 +02:00
|
|
|
# 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
|
2017-04-21 17:24:48 +02:00
|
|
|
(cd $(@D)/py-smbus; \
|
2015-04-06 00:15:05 +02:00
|
|
|
$(I2C_TOOLS_PYTHON_BASE_ENV) \
|
2017-07-05 13:14:19 +02:00
|
|
|
$(HOST_DIR)/bin/python setup.py build \
|
2015-04-06 00:15:05 +02:00
|
|
|
$(PKG_PYTHON_DISTUTILS_BUILD_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define I2C_TOOLS_INSTALL_PYSMBUS
|
|
|
|
(cd $(@D)/py-smbus; \
|
|
|
|
$(I2C_TOOLS_PYTHON_BASE_ENV) \
|
2017-07-05 13:14:19 +02:00
|
|
|
$(HOST_DIR)/bin/python setup.py install \
|
2015-04-06 00:15:05 +02:00
|
|
|
$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
endif # BR2_PACKAGE_PYTHON
|
|
|
|
|
2009-11-06 19:36:34 +01:00
|
|
|
define I2C_TOOLS_BUILD_CMDS
|
2017-12-21 15:54:10 +01:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_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
|
2017-12-31 14:25:45 +01:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) \
|
2018-12-11 12:52:06 +01:00
|
|
|
DESTDIR="$(TARGET_DIR)" PREFIX=/usr -C $(@D) install
|
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
|
|
|
|
2018-08-24 15:54:07 +02:00
|
|
|
define I2C_TOOLS_INSTALL_STAGING_CMDS
|
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) \
|
2018-12-11 12:52:06 +01:00
|
|
|
DESTDIR="$(STAGING_DIR)" PREFIX=/usr -C $(@D) install
|
2018-08-24 15:54:07 +02:00
|
|
|
endef
|
|
|
|
|
2012-07-03 00:07:32 +02:00
|
|
|
$(eval $(generic-package))
|