From 59350addd05f33367ab7e2ae4417eb8f74eeae00 Mon Sep 17 00:00:00 2001 From: Michael Heimpold Date: Sun, 11 Feb 2018 18:19:35 +0100 Subject: [PATCH] libgpiod: add package for library and tools libgpiod is a C library with corresponding tools for interacting with the linux GPIO character device (gpiod stands for GPIO device). Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use the character device instead. This library encapsulates the ioctl calls and data structures behind a straightforward API. Signed-off-by: Michael Heimpold --- libs/libgpiod/Makefile | 79 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 libs/libgpiod/Makefile diff --git a/libs/libgpiod/Makefile b/libs/libgpiod/Makefile new file mode 100644 index 000000000..fff1fe55f --- /dev/null +++ b/libs/libgpiod/Makefile @@ -0,0 +1,79 @@ +# +# Copyright (C) 2018 Michael Heimpold +# +# This is free software, licensed under the GNU General Public License v2. +# See /LICENSE for more information. +# + +include $(TOPDIR)/rules.mk + +PKG_NAME:=libgpiod +PKG_VERSION:=1.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz +PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/ +PKG_HASH:=34c76b3730b9d4a1159bcb14000f78b1e890251b8a3823b794fa930654eabdd0 + +PKG_LICENSE:=LGPL-2.1+ +PKG_LICENSE_FILES:=COPYING + +PKG_MAINTAINER:=Michael Heimpold + +PKG_INSTALL:=1 +PKG_BUILD_PARALLEL:=1 + +include $(INCLUDE_DIR)/package.mk + +ifneq ($(CONFIG_PACKAGE_gpiod-tools),) +CONFIGURE_ARGS += --enable-tools +endif + +define Package/libgpiod + SECTION:=libs + CATEGORY:=Libraries + URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git + TITLE:=Library for interacting with Linux's GPIO character device + DEPENDS:=@GPIO_SUPPORT +endef + +define Package/libgpiod/description + C library for interacting with the linux GPIO character device + (gpiod stands for GPIO device). +endef + +define Package/gpiod-tools + SECTION:=utils + CATEGORY:=Utilities + TITLE:=Tools for interacting with GPIO pins + DEPENDS:=+libgpiod +endef + +define Package/gpiod-tools/description + Tools for interacting with the linux GPIO character device + (gpiod stands for GPIO device). +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include + $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/ + + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/ + + $(INSTALL_DIR) $(1)/usr/lib/pkgconfig + $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/ +endef + +define Package/libgpiod/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so* $(1)/usr/lib/ +endef + +define Package/gpiod-tools/install + $(INSTALL_DIR) $(1)/usr/bin + $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ +endef + +$(eval $(call BuildPackage,libgpiod)) +$(eval $(call BuildPackage,gpiod-tools))