1 ################################################################################
5 ################################################################################
7 I2C_TOOLS_VERSION
= v3.1
.2
8 I2C_TOOLS_SITE
= git
://git.kernel.org
/pub
/scm
/utils
/i2c-tools
/i2c-tools.git
9 I2C_TOOLS_LICENSE
= GPLv2
+, GPLv2
(py-smbus
)
10 I2C_TOOLS_LICENSE_FILES
= COPYING
12 ifeq ($(BR2_PACKAGE_PYTHON
),y
)
13 I2C_TOOLS_DEPENDENCIES
+= python
16 ifeq ($(BR2_PACKAGE_PYTHON3
),y
)
17 I2C_TOOLS_DEPENDENCIES
+= python3
20 ifeq ($(BR2_PACKAGE_BUSYBOX
),y
)
21 I2C_TOOLS_DEPENDENCIES
+= busybox
24 # Build/install steps mirror the distutil python package type in the python package
26 ifeq ($(BR2_PACKAGE_PYTHON
)$(BR2_PACKAGE_PYTHON3
),y
)
27 # BASE_ENV taken from PKG_PYTHON_DISTUTILS_ENV in package/pkg-python.mk
28 I2C_TOOLS_PYTHON_BASE_ENV
= \
29 $(PKG_PYTHON_DISTUTILS_ENV
) \
30 CFLAGS
="$(TARGET_CFLAGS) -I../include"
32 define I2C_TOOLS_BUILD_PYSMBUS
34 $(I2C_TOOLS_PYTHON_BASE_ENV
) \
35 $(HOST_DIR
)/usr
/bin
/python setup.py build \
36 $(PKG_PYTHON_DISTUTILS_BUILD_OPTS
))
39 define I2C_TOOLS_INSTALL_PYSMBUS
41 $(I2C_TOOLS_PYTHON_BASE_ENV
) \
42 $(HOST_DIR
)/usr
/bin
/python setup.py
install \
43 $(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS
))
46 endif # BR2_PACKAGE_PYTHON
48 define I2C_TOOLS_BUILD_CMDS
49 $(MAKE
) $(TARGET_CONFIGURE_OPTS
) -C
$(@D
)
50 $(I2C_TOOLS_BUILD_PYSMBUS
)
53 define I2C_TOOLS_INSTALL_TARGET_CMDS
54 for i in i2cdump i2cget i2cset i2cdetect
; \
56 $(INSTALL
) -m
755 -D
$(@D
)/tools
/$$i $(TARGET_DIR
)/usr
/sbin
/$$i; \
58 $(I2C_TOOLS_INSTALL_PYSMBUS
)
61 $(eval
$(generic-package
))