python: fix disabling the SSL module
[buildroot-gz.git] / package / i2c-tools / i2c-tools.mk
blobe16b940cae0c69354c7eb41c84191239767fe747
1 ################################################################################
3 # i2c-tools
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
14 endif
16 ifeq ($(BR2_PACKAGE_PYTHON3),y)
17 I2C_TOOLS_DEPENDENCIES += python3
18 endif
20 ifeq ($(BR2_PACKAGE_BUSYBOX),y)
21 I2C_TOOLS_DEPENDENCIES += busybox
22 endif
24 # Build/install steps mirror the distutil python package type in the python package
25 # infrastructure
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
33 (cd $(@D)/py-smbus; \
34 $(I2C_TOOLS_PYTHON_BASE_ENV) \
35 $(HOST_DIR)/usr/bin/python setup.py build \
36 $(PKG_PYTHON_DISTUTILS_BUILD_OPTS))
37 endef
39 define I2C_TOOLS_INSTALL_PYSMBUS
40 (cd $(@D)/py-smbus; \
41 $(I2C_TOOLS_PYTHON_BASE_ENV) \
42 $(HOST_DIR)/usr/bin/python setup.py install \
43 $(PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS))
44 endef
46 endif # BR2_PACKAGE_PYTHON
48 define I2C_TOOLS_BUILD_CMDS
49 $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
50 $(I2C_TOOLS_BUILD_PYSMBUS)
51 endef
53 define I2C_TOOLS_INSTALL_TARGET_CMDS
54 for i in i2cdump i2cget i2cset i2cdetect; \
55 do \
56 $(INSTALL) -m 755 -D $(@D)/tools/$$i $(TARGET_DIR)/usr/sbin/$$i; \
57 done
58 $(I2C_TOOLS_INSTALL_PYSMBUS)
59 endef
61 $(eval $(generic-package))