From c3a1d1398e9e855738a7847d995720a9dfc59aa5 Mon Sep 17 00:00:00 2001 From: lean Date: Wed, 1 Apr 2020 02:31:46 +0800 Subject: [PATCH] libsearpc: bump version --- libs/libsearpc/Makefile | 84 +++++++++++++------ .../patches/001-fix-memory-leak-GH-48.patch | 19 +++++ .../patches/002-no-future-import.patch | 11 +++ 3 files changed, 87 insertions(+), 27 deletions(-) create mode 100644 libs/libsearpc/patches/001-fix-memory-leak-GH-48.patch create mode 100644 libs/libsearpc/patches/002-no-future-import.patch diff --git a/libs/libsearpc/Makefile b/libs/libsearpc/Makefile index b6cba662..31346034 100644 --- a/libs/libsearpc/Makefile +++ b/libs/libsearpc/Makefile @@ -8,58 +8,88 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libsearpc -PKG_VERSION:=6.2.2 -PKG_RELEASE=$(PKG_SOURCE_VERSION)-1 -PKG_LICENSE:=GPL-3.0 +PKG_VERSION:=3.2.0 +PKG_RELEASE:=1 + +PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz +PKG_SOURCE_URL:=https://codeload.github.com/haiwen/libsearpc/tar.gz/v$(PKG_VERSION)? +PKG_HASH:=c479d85e405674c3450eac040abe143af5a9fafe7f1b74926e2a05280ab5420e + +PKG_MAINTAINER:=Alexandru Ardelean , Jeffery To +PKG_LICENSE:=Apache-2.0 +PKG_LICENSE_FILES:=LICENSE.txt -PKG_SOURCE_PROTO:=git -PKG_SOURCE_URL:=https://github.com/haiwen/libsearpc.git -PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) -PKG_SOURCE_VERSION:=8998e7b2c5587f0b94c48db24e2952d08def5add -PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz -PKG_MIRROR_HASH:=207baa1fc63a60c117cf4985b60a18212b151fa070f208621633c3b53ab679bf PKG_FIXUP:=autoreconf +PKG_BUILD_PARALLEL:=1 PKG_INSTALL:=1 include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/nls.mk include ../../lang/python/python-package.mk +include ../../lang/python/python3-package.mk define Package/libsearpc - SECTION:=libs - CATEGORY:=Libraries - TITLE:=Seafile RPC Library - MAINTAINER:=Gergely Kiss - URL:=http://seafile.com/ - DEPENDS:=+glib2 +jansson +python $(ICONV_DEPENDS) + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Seafile RPC Library + URL:=https://seafile.com + DEPENDS:=+glib2 +jansson $(ICONV_DEPENDS) endef define Package/libsearpc/description - Searpc is a simple C language RPC framework based on GObject system. - Searpc handles the serialization/deserialization part of RPC, - the transport part is left to users. + Searpc is a simple C language RPC framework based on GObject system. + Searpc handles the serialization/deserialization part of RPC, the + transport part is left to users. endef -CONFIGURE_ARGS += --enable-compile-demo=no \ - --disable-server-pkg +define Package/python3-searpc + SECTION:=lang + CATEGORY:=Languages + SUBMENU:=Python + TITLE:=Python bindings for Searpc + DEPENDS:=+libsearpc +python3-light +python3-logging + VARIANT:=python3 +endef -TARGET_LDFLAGS += -Wl,-rpath-link=$(STAGING_DIR)/usr/lib -liconv +define Package/python3-searpc/description +$(call Package/libsearpc/description) + + This package contains the Python bindings for Searpc. +endef + +CONFIGURE_ARGS += \ + --disable-compile-demo \ + --disable-server-pkg define Build/InstallDev $(INSTALL_DIR) $(1)/usr/{bin,include} $(INSTALL_DIR) $(1)/usr/lib/pkgconfig $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)/usr/include/searpc* $(1)/usr/include/ - $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsearpc.pc $(1)/usr/lib/pkgconfig/ - $(CP) $(PKG_INSTALL_DIR)/usr/bin/searpc-codegen.py $(1)/usr/bin/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/ + $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/libsearpc.pc $(1)/usr/lib/pkgconfig/ + $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/searpc-codegen.py $(1)/usr/bin/ endef +# Include Python 2 bindings in this package to maintain compatibility with previous versions define Package/libsearpc/install $(INSTALL_DIR) $(1)/usr/lib - $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR) + $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)/pysearpc $(CP) $(PKG_INSTALL_DIR)/usr/lib/libsearpc.so* $(1)/usr/lib/ - $(CP) $(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/pysearpc $(1)$(PYTHON_PKG_DIR) - find $(1) -name "*\.pyc" -o -name "*\.pyo" | xargs rm -f + $(INSTALL_DATA) $(PKG_BUILD_DIR)/pysearpc/*.py $(1)$(PYTHON_PKG_DIR)/pysearpc/ + rm -f $(1)$(PYTHON_PKG_DIR)/pysearpc/{pygencode,test_pysearpc}.py endef +define Py3Build/Compile + rm -rf $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc + $(INSTALL_DIR) $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc + $(INSTALL_DATA) $(PKG_BUILD_DIR)/pysearpc/*.py $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/ + rm -f $(PKG_INSTALL_DIR)$(PYTHON3_PKG_DIR)/pysearpc/{pygencode,test_pysearpc}.py +endef + +Py3Package/python3-searpc/install:=: + $(eval $(call BuildPackage,libsearpc)) + +$(eval $(call Py3Package,python3-searpc)) +$(eval $(call BuildPackage,python3-searpc)) +$(eval $(call BuildPackage,python3-searpc-src)) diff --git a/libs/libsearpc/patches/001-fix-memory-leak-GH-48.patch b/libs/libsearpc/patches/001-fix-memory-leak-GH-48.patch new file mode 100644 index 00000000..a0ae81fc --- /dev/null +++ b/libs/libsearpc/patches/001-fix-memory-leak-GH-48.patch @@ -0,0 +1,19 @@ +From 9b2e2dc65213fb22ed400dc54e4c2279564df62b Mon Sep 17 00:00:00 2001 +From: ly1217 +Date: Thu, 31 Oct 2019 00:31:38 -0700 +Subject: [PATCH] Fix memory leak. + +--- + lib/searpc-named-pipe-transport.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/lib/searpc-named-pipe-transport.c ++++ b/lib/searpc-named-pipe-transport.c +@@ -377,6 +377,7 @@ void searpc_free_client_with_pipe_transp + close(pipe_client->pipe_fd); + #endif + g_free (pipe_client); ++ g_free (data->service); + g_free (data); + searpc_client_free (client); + } diff --git a/libs/libsearpc/patches/002-no-future-import.patch b/libs/libsearpc/patches/002-no-future-import.patch new file mode 100644 index 00000000..b69c021f --- /dev/null +++ b/libs/libsearpc/patches/002-no-future-import.patch @@ -0,0 +1,11 @@ +--- a/pysearpc/named_pipe.py ++++ b/pysearpc/named_pipe.py +@@ -2,8 +2,6 @@ + RPC client/server implementation based on named pipe transport. + """ + +-from future import standard_library +-standard_library.install_aliases() + from builtins import object + import json + import logging