2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2008-06-24 17:55:37 +08:00
|
|
|
#
|
|
|
|
# i2c-tools
|
|
|
|
#
|
2013-06-06 07:53:30 +08:00
|
|
|
################################################################################
|
2011-01-08 01:42:48 +08:00
|
|
|
|
2020-10-02 13:34:47 +08:00
|
|
|
I2C_TOOLS_VERSION = 4.2
|
2017-07-10 19:38:01 +08: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 21:54:06 +08: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 22:54:10 +08:00
|
|
|
I2C_TOOLS_MAKE_OPTS = EXTRA=eeprog
|
2018-08-24 21:54:07 +08:00
|
|
|
I2C_TOOLS_INSTALL_STAGING = YES
|
2008-06-24 17:55:37 +08:00
|
|
|
|
2015-04-06 06:15:05 +08:00
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON),y)
|
|
|
|
I2C_TOOLS_DEPENDENCIES += python
|
2015-06-18 16:12:28 +08:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(BR2_PACKAGE_PYTHON3),y)
|
|
|
|
I2C_TOOLS_DEPENDENCIES += python3
|
|
|
|
endif
|
|
|
|
|
2017-12-21 22:54:10 +08: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 16:12:28 +08: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 06:15:05 +08: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 23:24:48 +08:00
|
|
|
(cd $(@D)/py-smbus; \
|
2015-04-06 06:15:05 +08:00
|
|
|
$(I2C_TOOLS_PYTHON_BASE_ENV) \
|
2017-07-05 19:14:19 +08:00
|
|
|
$(HOST_DIR)/bin/python setup.py build \
|
2015-04-06 06:15:05 +08:00
|
|
|
$(PKG_PYTHON_DISTUTILS_BUILD_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
define I2C_TOOLS_INSTALL_PYSMBUS
|
|
|
|
(cd $(@D)/py-smbus; \
|
|
|
|
$(I2C_TOOLS_PYTHON_BASE_ENV) \
|
2017-07-05 19:14:19 +08:00
|
|
|
$(HOST_DIR)/bin/python setup.py install \
|
2015-04-06 06:15:05 +08:00
|
|
|
$(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS))
|
|
|
|
endef
|
|
|
|
|
|
|
|
endif # BR2_PACKAGE_PYTHON
|
|
|
|
|
2009-11-07 02:36:34 +08:00
|
|
|
define I2C_TOOLS_BUILD_CMDS
|
2017-12-21 22:54:10 +08:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) -C $(@D)
|
2015-04-06 06:15:05 +08:00
|
|
|
$(I2C_TOOLS_BUILD_PYSMBUS)
|
2009-11-07 02:36:34 +08:00
|
|
|
endef
|
2008-06-24 17:55:37 +08:00
|
|
|
|
2009-11-07 02:36:34 +08:00
|
|
|
define I2C_TOOLS_INSTALL_TARGET_CMDS
|
2017-12-31 21:25:45 +08:00
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) \
|
2018-12-11 19:52:06 +08:00
|
|
|
DESTDIR="$(TARGET_DIR)" PREFIX=/usr -C $(@D) install
|
2015-04-06 06:15:05 +08:00
|
|
|
$(I2C_TOOLS_INSTALL_PYSMBUS)
|
2009-11-07 02:36:34 +08:00
|
|
|
endef
|
2008-08-26 22:01:37 +08:00
|
|
|
|
2018-08-24 21:54:07 +08:00
|
|
|
define I2C_TOOLS_INSTALL_STAGING_CMDS
|
|
|
|
$(MAKE) $(TARGET_CONFIGURE_OPTS) $(I2C_TOOLS_MAKE_OPTS) \
|
2018-12-11 19:52:06 +08:00
|
|
|
DESTDIR="$(STAGING_DIR)" PREFIX=/usr -C $(@D) install
|
2018-08-24 21:54:07 +08:00
|
|
|
endef
|
|
|
|
|
2012-07-03 06:07:32 +08:00
|
|
|
$(eval $(generic-package))
|