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.

107 lines
2.9 KiB

  1. #
  2. # Copyright (C) 2018-2019 Michael Heimpold <mhei@heimpold.de>
  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:=libgpiod
  9. PKG_VERSION:=1.6.3
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/
  13. PKG_HASH:=841be9d788f00bab08ef22c4be5c39866f0e46cb100a3ae49ed816ac9c5dddc7
  14. PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
  15. PKG_LICENSE:=LGPL-2.1-or-later
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_INSTALL:=1
  18. PKG_BUILD_PARALLEL:=1
  19. PYTHON3_PKG_BUILD:=0
  20. include $(INCLUDE_DIR)/package.mk
  21. include ../../lang/python/python3-package.mk
  22. ifneq ($(CONFIG_PACKAGE_gpiod-tools),)
  23. CONFIGURE_ARGS += --enable-tools
  24. endif
  25. ifneq ($(CONFIG_PACKAGE_python3-gpiod),)
  26. CONFIGURE_ARGS += --enable-bindings-python
  27. CONFIGURE_VARS += \
  28. PYTHON="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)" \
  29. PYTHON_CPPFLAGS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \
  30. PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --libs)"
  31. endif
  32. define Package/libgpiod
  33. SECTION:=libs
  34. CATEGORY:=Libraries
  35. URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
  36. TITLE:=Library for interacting with Linux's GPIO character device
  37. DEPENDS:=@GPIO_SUPPORT
  38. endef
  39. define Package/libgpiod/description
  40. C library for interacting with the linux GPIO character device
  41. (gpiod stands for GPIO device).
  42. endef
  43. define Package/gpiod-tools
  44. SECTION:=utils
  45. CATEGORY:=Utilities
  46. TITLE:=Tools for interacting with GPIO pins
  47. DEPENDS:=+libgpiod
  48. endef
  49. define Package/gpiod-tools/description
  50. Tools for interacting with the linux GPIO character device
  51. (gpiod stands for GPIO device).
  52. endef
  53. define Package/python3-gpiod
  54. SECTION:=lang
  55. CATEGORY:=Languages
  56. SUBMENU:=Python
  57. TITLE:=Python bindings for libgpiod
  58. URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
  59. DEPENDS:=+python3-light +libgpiod
  60. endef
  61. define Package/python3-gpiod/description
  62. This package contains the Python bindings for libgpiod.
  63. endef
  64. define Build/InstallDev
  65. $(INSTALL_DIR) $(1)/usr/include
  66. $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
  67. $(INSTALL_DIR) $(1)/usr/lib
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
  69. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
  71. endef
  72. define Package/libgpiod/install
  73. $(INSTALL_DIR) $(1)/usr/lib
  74. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so.* $(1)/usr/lib/
  75. endef
  76. define Package/gpiod-tools/install
  77. $(INSTALL_DIR) $(1)/usr/bin
  78. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  79. endef
  80. define Package/python3-gpiod/install
  81. $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
  82. $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/gpiod.so $(1)/$(PYTHON3_PKG_DIR)
  83. endef
  84. $(eval $(call BuildPackage,libgpiod))
  85. $(eval $(call BuildPackage,gpiod-tools))
  86. $(eval $(call BuildPackage,python3-gpiod))