diff options
author | Michael Heimpold <mhei@heimpold.de> | 2020-01-25 22:38:15 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-25 22:38:15 +0100 |
commit | 96c244ea67c43f66365f038b2887c8f730deec44 (patch) | |
tree | c49fb6beefc3ab18d6a3c0d5d6ad0f005d0db011 /libs | |
parent | c147ac94bb86c5c6229245c6298667d60a434eb3 (diff) | |
parent | 2fdb8268d3b8144d1aa7c5261f9b18a57061955f (diff) |
Merge pull request #11117 from mhei/libgpiod-python-binding
libgpiod: add package for the Python binding (fixes #11096)
Diffstat (limited to 'libs')
-rw-r--r-- | libs/libgpiod/Makefile | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/libs/libgpiod/Makefile b/libs/libgpiod/Makefile index 5b43ede8f..86604b2de 100644 --- a/libs/libgpiod/Makefile +++ b/libs/libgpiod/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libgpiod PKG_VERSION:=1.4.1 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz PKG_SOURCE_URL:=@KERNEL/software/libs/libgpiod/ @@ -24,11 +24,20 @@ PKG_INSTALL:=1 PKG_BUILD_PARALLEL:=1 include $(INCLUDE_DIR)/package.mk +include ../../lang/python/python3-package.mk ifneq ($(CONFIG_PACKAGE_gpiod-tools),) CONFIGURE_ARGS += --enable-tools endif +ifneq ($(CONFIG_PACKAGE_python3-gpiod),) +CONFIGURE_ARGS += --enable-bindings-python +CONFIGURE_VARS += \ + PYTHON="$(STAGING_DIR_HOSTPKG)/bin/$(PYTHON3)" \ + PYTHON_CPPFLAGS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --includes)" \ + PYTHON_LIBS="$(shell $(STAGING_DIR)/host/bin/$(PYTHON3)-config --libs)" +endif + define Package/libgpiod SECTION:=libs CATEGORY:=Libraries @@ -54,6 +63,19 @@ define Package/gpiod-tools/description (gpiod stands for GPIO device). endef +define Package/python3-gpiod + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python bindings for libgpiod + URL:=https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git + DEPENDS:=+python3-light +libgpiod +endef + +define Package/python3-gpiod/description + This package contains the Python bindings for libgpiod. +endef + define Build/InstallDev $(INSTALL_DIR) $(1)/usr/include $(CP) $(PKG_INSTALL_DIR)/usr/include/gpiod.h $(1)/usr/include/ @@ -75,5 +97,11 @@ define Package/gpiod-tools/install $(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin/ endef +define Package/python3-gpiod/install + $(INSTALL_DIR) $(1)/$(PYTHON3_PKG_DIR) + $(CP) $(PKG_INSTALL_DIR)/$(PYTHON3_PKG_DIR)/gpiod.so $(1)/$(PYTHON3_PKG_DIR) +endef + $(eval $(call BuildPackage,libgpiod)) $(eval $(call BuildPackage,gpiod-tools)) +$(eval $(call BuildPackage,python3-gpiod)) |