You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.7 KiB

  1. #
  2. # Copyright (C) 2007-2015 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=i2c-tools
  9. PKG_VERSION:=4.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/software/utils/i2c-tools
  13. PKG_HASH:=1f899e43603184fac32f34d72498fc737952dbc9c97a8dd9467fadfdf4600cf9
  14. PKG_MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
  15. PKG_LICENSE:=GPL-2.0-or-later LGPL-2.1-or-later
  16. PKG_LICENSE_FILES:=COPYING COPYING.LGPL
  17. PKG_BUILD_PARALLEL:=1
  18. PYTHON3_PKG_BUILD:=0
  19. include $(INCLUDE_DIR)/package.mk
  20. include ../../lang/python/python3-package.mk
  21. define Package/i2c/Default
  22. URL:=https://i2c.wiki.kernel.org/index.php/I2C_Tools
  23. TITLE:=I2C
  24. endef
  25. define Package/libi2c
  26. $(call Package/i2c/Default)
  27. SECTION:=libs
  28. CATEGORY:=Libraries
  29. TITLE+=library for i2c-tools
  30. endef
  31. define Package/i2c-tools
  32. $(call Package/i2c/Default)
  33. SECTION:=utils
  34. CATEGORY:=Utilities
  35. TITLE+=tools for Linux
  36. DEPENDS:=+libi2c
  37. endef
  38. define Package/python3-smbus
  39. $(call Package/i2c/Default)
  40. SUBMENU:=Python
  41. SECTION:=lang
  42. CATEGORY:=Languages
  43. TITLE:=Python bindings for the SMBUS
  44. DEPENDS:=+libi2c +python3-light
  45. endef
  46. define Package/libi2c/description
  47. This package contains i2c functionality needed by i2c-tools.
  48. endef
  49. define Package/i2c-tools/description
  50. This package contains an heterogeneous set of I2C tools for Linux. These tools
  51. were originally part of the lm-sensors package.
  52. endef
  53. define Package/python3-smbus/description
  54. This package contain the Python3 bindings for Linux SMBus access through i2c-dev.
  55. endef
  56. PYTHON3_PKG_SETUP_ARGS:=
  57. PYTHON3_PKG_SETUP_DIR:=py-smbus
  58. define Build/Compile
  59. $(MAKE) -C $(PKG_BUILD_DIR) \
  60. LINUX="$(LINUX_DIR)" \
  61. CC="$(TARGET_CC)" \
  62. STAGING_DIR="$(STAGING_DIR)" \
  63. LDFLAGS="$(TARGET_LDFLAGS)" \
  64. CFLAGS="$(TARGET_CFLAGS)"
  65. $(call Py3Build/Compile)
  66. endef
  67. define Build/InstallDev
  68. $(INSTALL_DIR) $(1)/usr/include $(1)/usr/lib
  69. $(CP) $(PKG_BUILD_DIR)/include/i2c $(1)/usr/include/
  70. $(CP) $(PKG_BUILD_DIR)/lib/libi2c.{a,so*} $(1)/usr/lib/
  71. endef
  72. define Package/libi2c/install
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_BUILD_DIR)/lib/libi2c.so* $(1)/usr/lib/
  75. endef
  76. define Package/i2c-tools/install
  77. $(INSTALL_DIR) $(1)/usr/sbin
  78. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdetect $(1)/usr/sbin/
  79. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cdump $(1)/usr/sbin/
  80. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cset $(1)/usr/sbin/
  81. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2cget $(1)/usr/sbin/
  82. $(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/i2ctransfer $(1)/usr/sbin/
  83. endef
  84. $(eval $(call BuildPackage,libi2c))
  85. $(eval $(call BuildPackage,i2c-tools))
  86. $(eval $(call Py3Package,python3-smbus))
  87. $(eval $(call BuildPackage,python3-smbus))