Revert "libgpiod: update to 2.0"
[feed/packages.git] / libs / libgpiod / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=libgpiod
11 PKG_VERSION:=1.6.4
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/
16 PKG_HASH:=7b146e12f28fbca3df7557f176eb778c5ccf952ca464698dba8a61b2e1e3f9b5
17
18 PKG_MAINTAINER:=Michael Heimpold <mhei@heimpold.de>
19 PKG_LICENSE:=LGPL-2.1-or-later
20 PKG_LICENSE_FILES:=COPYING
21
22 PKG_INSTALL:=1
23 PKG_BUILD_PARALLEL:=1
24 PYTHON3_PKG_BUILD:=0
25
26 include $(INCLUDE_DIR)/package.mk
27 include ../../lang/python/python3-package.mk
28
29 ifneq ($(CONFIG_PACKAGE_gpiod-tools),)
30 CONFIGURE_ARGS += --enable-tools
31 endif
32
33 ifneq ($(CONFIG_PACKAGE_python3-gpiod),)
34 CONFIGURE_ARGS += --enable-bindings-python
35 CONFIGURE_VARS += \
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)"
39 endif
40
41 define Package/libgpiod
42 SECTION:=libs
43 CATEGORY:=Libraries
44 URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
45 TITLE:=Library for interacting with Linux's GPIO character device
46 KCONFIG:= \
47 CONFIG_GPIO_CDEV=y \
48 CONFIG_GPIO_CDEV_V1=y
49 DEPENDS:=@GPIO_SUPPORT
50 endef
51
52 define Package/libgpiod/description
53 C library for interacting with the linux GPIO character device
54 (gpiod stands for GPIO device).
55 endef
56
57 define Package/gpiod-tools
58 SECTION:=utils
59 CATEGORY:=Utilities
60 TITLE:=Tools for interacting with GPIO pins
61 DEPENDS:=+libgpiod
62 endef
63
64 define Package/gpiod-tools/description
65 Tools for interacting with the linux GPIO character device
66 (gpiod stands for GPIO device).
67 endef
68
69 define Package/python3-gpiod
70 SECTION:=lang
71 CATEGORY:=Languages
72 SUBMENU:=Python
73 TITLE:=Python bindings for libgpiod
74 URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git
75 DEPENDS:=+python3-light +libgpiod
76 endef
77
78 define Package/python3-gpiod/description
79 This package contains the Python bindings for libgpiod.
80 endef
81
82 define Build/InstallDev
83 $(INSTALL_DIR) $(1)/usr/include
84 $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/
85
86 $(INSTALL_DIR) $(1)/usr/lib
87 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.{so*,a} $(1)/usr/lib/
88
89 $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
90 $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libgpiod.pc $(1)/usr/lib/pkgconfig/
91 endef
92
93 define Package/libgpiod/install
94 $(INSTALL_DIR) $(1)/usr/lib
95 $(CP) $(PKG_INSTALL_DIR)/usr/lib/libgpiod.so.* $(1)/usr/lib/
96 endef
97
98 define Package/gpiod-tools/install
99 $(INSTALL_DIR) $(1)/usr/bin
100 $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/
101 endef
102
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)
106 endef
107
108 $(eval $(call BuildPackage,libgpiod))
109 $(eval $(call BuildPackage,gpiod-tools))
110 $(eval $(call BuildPackage,python3-gpiod))