2 # Copyright (C) 2018-2019 Michael Heimpold <mhei@heimpold.de>
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
14 PKG_SOURCE
:=$(PKG_NAME
)-$(PKG_VERSION
).
tar.xz
15 PKG_SOURCE_URL
:=@KERNEL
/software
/libs
/libgpiod
/
16 PKG_HASH
:=7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5
18 PKG_MAINTAINER
:=Michael Heimpold
<mhei@heimpold.de
>
19 PKG_LICENSE
:=LGPL-2.1
-or-later
20 PKG_LICENSE_FILES
:=COPYING
26 include $(INCLUDE_DIR
)/package.mk
27 include ..
/..
/lang
/python
/python3-package.mk
29 ifneq ($(CONFIG_PACKAGE_gpiod-tools
),)
30 CONFIGURE_ARGS
+= --enable-tools
33 ifneq ($(CONFIG_PACKAGE_python3-gpiod
),)
34 CONFIGURE_ARGS
+= --enable-bindings-python
36 PYTHON
="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)" \
37 PYTHON_CPPFLAGS
="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \
38 PYTHON_LIBS
="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --libs)"
41 define Package
/libgpiod
44 URL
:=https
://git.kernel.org
/pub
/scm
/libs
/libgpiod
/libgpiod.git
45 TITLE
:=Library for interacting with Linux
's GPIO character device
49 DEPENDS:=@GPIO_SUPPORT
52 define Package/libgpiod/description
53 C library for interacting with the linux GPIO character device
54 (gpiod stands for GPIO device).
57 define Package/gpiod-tools
60 TITLE:=Tools for interacting with GPIO pins
64 define Package/gpiod-tools/description
65 Tools for interacting with the linux GPIO character device
66 (gpiod stands for GPIO device).
69 define Package/python3-gpiod
73 TITLE:=Python bindings for libgpiod
74 URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
75 DEPENDS:=+python3-light +libgpiod
78 define Package/python3-gpiod/description
79 This package contains the Python bindings for libgpiod.
82 define Build/InstallDev
83 $(INSTALL_DIR) $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
89 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
93 define Package/libgpiod/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so.* $(1)/usr/lib/
98 define Package/gpiod-tools/install
99 $(INSTALL_DIR) $(1)/usr/bin
100 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
103 define Package/python3-gpiod/install
104 $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR)
105 $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/gpiod.so $(1)/$(PYTHON3_PKG_DIR)
108 $(eval $(call BuildPackage,libgpiod))
109 $(eval $(call BuildPackage,gpiod-tools))
110 $(eval $(call BuildPackage,python3-gpiod))