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