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.

79 lines
2.0 KiB

  1. #
  2. # Copyright (C) 2018 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.0
  10. PKG_RELEASE:=1
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
  12. PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/
  13. PKG_HASH:=34c76b3730b9d4a1159bcb14000f78b1e890251b8a3823b794fa930654eabdd0
  14. PKG_LICENSE:=LGPL-2.1+
  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. ifneq ($(CONFIG_PACKAGE_gpiod-tools),)
  21. CONFIGURE_ARGS += --enable-tools
  22. endif
  23. define Package/libgpiod
  24. SECTION:=libs
  25. CATEGORY:=Libraries
  26. URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
  27. TITLE:=Library for interacting with Linux's GPIO character device
  28. DEPENDS:=@GPIO_SUPPORT
  29. endef
  30. define Package/libgpiod/description
  31. C library for interacting with the linux GPIO character device
  32. (gpiod stands for GPIO device).
  33. endef
  34. define Package/gpiod-tools
  35. SECTION:=utils
  36. CATEGORY:=Utilities
  37. TITLE:=Tools for interacting with GPIO pins
  38. DEPENDS:=+libgpiod
  39. endef
  40. define Package/gpiod-tools/description
  41. Tools for interacting with the linux GPIO character device
  42. (gpiod stands for GPIO device).
  43. endef
  44. define Build/InstallDev
  45. $(INSTALL_DIR) $(1)/usr/include
  46. $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
  47. $(INSTALL_DIR) $(1)/usr/lib
  48. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
  49. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  50. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
  51. endef
  52. define Package/libgpiod/install
  53. $(INSTALL_DIR) $(1)/usr/lib
  54. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so* $(1)/usr/lib/
  55. endef
  56. define Package/gpiod-tools/install
  57. $(INSTALL_DIR) $(1)/usr/bin
  58. $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
  59. endef
  60. $(eval $(call BuildPackage,libgpiod))
  61. $(eval $(call BuildPackage,gpiod-tools))