i2c-tools: make the python dependency optional
authorFelix Fietkau <nbd@openwrt.org>
Sat, 25 Jun 2011 00:28:46 +0000 (00:28 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Sat, 25 Jun 2011 00:28:46 +0000 (00:28 +0000)
SVN-Revision: 27280

utils/i2c-tools/Makefile

index 3452bee6656c599a2eaed5cc18cdf9b182a27388..d2119a52eb9d1cc0478261b123f0613808bf75c2 100644 (file)
@@ -16,7 +16,7 @@ PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
 PKG_SOURCE_URL:=http://dl.lm-sensors.org/i2c-tools/releases
 PKG_MD5SUM:=511376eed04455cdb277ef19c5f73bb4
 
-PKG_BUILD_DEPENDS:=python
+PKG_BUILD_DEPENDS:=PACKAGE_python-smbus:python
 
 include $(INCLUDE_DIR)/package.mk
 $(call include_mk, python-package.mk)
@@ -35,7 +35,7 @@ define Package/python-smbus
   CATEGORY:=Languages
   TITLE:=Python bindings for the SMBUS
   URL:=http://www.lm-sensors.org/wiki/I2CTools
-  DEPENDS:= +python-mini +i2c-tools
+  DEPENDS:= +PACKAGE_python-smbus:python-mini +i2c-tools
 endef
 
 define Package/i2c-tools/description
@@ -56,15 +56,21 @@ endef
 
 TARGET_CPPFLAGS += -I$(LINUX_DIR)/include
 
+ifdef CONFIG_PACKAGE_python-smbus
+  define Build/Compile/python-smbus
+       $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
+       $(call Build/Compile/PyMod,./py-smbus/, \
+               install --prefix="$(PKG_INSTALL_DIR)/usr", \
+       )
+  endef
+endif
+
 define Build/Compile
        $(MAKE) -C $(PKG_BUILD_DIR) \
                LINUX="$(LINUX_DIR)" \
                CC="$(TARGET_CC)" \
                STAGING_DIR="$(STAGING_DIR)"
-       $(if $(Build/Compile/PyMod),,@echo Python packaging code not found.; false)
-       $(call Build/Compile/PyMod,./py-smbus/, \
-               install --prefix="$(PKG_INSTALL_DIR)/usr", \
-       )
+       $(Build/Compile/python-smbus)
 endef
 
 define Package/i2c-tools/install