Browse Source

sysrepo: Remove Lua bindings, build Python bindings in separate package

This change:

* Removes building of Lua bindings. These bindings were already removed
  upstream[1].

* Fixes building of Python bindings:
  * Fix SWIG_DIR path (note that SWIG_VERSION will need to be updated
    whenever the swig package is upgraded)
  * Fix Python module paths and filenames

* Packages the Python bindings in a new package (python3-sysrepo) and
  builds it by default, instead of depending on a config option.

[1]: https://github.com/sysrepo/sysrepo/pull/1429

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lilik-openwrt-22.03
Jeffery To 5 years ago
parent
commit
47c385eaf9
2 changed files with 27 additions and 69 deletions
  1. +0
    -23
      net/sysrepo/Config_libsysrepo.in
  2. +27
    -46
      net/sysrepo/Makefile

+ 0
- 23
net/sysrepo/Config_libsysrepo.in View File

@ -1,23 +0,0 @@
config SYSREPO_PYTHON
bool "Generate sysrepo Python2 bindings"
depends on PACKAGE_libsysrepo
select SYSREPO_BINDINGS
default n
help
This option generates the Python2 language bindings.
Disabled by default.
config SYSREPO_LUA
bool "Generate sysrepo Lua5.1 bindings"
depends on PACKAGE_libsysrepo
select SYSREPO_BINDINGS
default n
help
This option generates the Lua5.1 language bindings.
Disabled by default.
config SYSREPO_BINDINGS
bool
depends on PACKAGE_libsysrepo
default n

+ 27
- 46
net/sysrepo/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=sysrepo
PKG_VERSION:=0.7.8
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://codeload.github.com/sysrepo/sysrepo/tar.gz/v$(PKG_VERSION)?
@ -21,25 +21,27 @@ PKG_LICENSE_FILES:=LICENSE
CMAKE_INSTALL:=1
PKG_BUILD_PARALLEL:=1
PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host
PKG_BUILD_DEPENDS:=swig/host
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
ifeq ($(CONFIG_SYSREPO_PYTHON),y)
$(call include_mk, python3-package.mk)
endif
define Package/libsysrepo/config
source "$(SOURCE)/Config_libsysrepo.in"
endef
include ../../lang/python/python3-package.mk
define Package/libsysrepo
SECTION:=libs
CATEGORY:=Libraries
TITLE:=YANG-based data store library
URL:=https://www.sysrepo.org/
DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python3-base +SYSREPO_LUA:lua
MENU:=1
DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread
endef
define Package/python3-sysrepo
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=YANG-based data store library - Python 3 bindings
URL:=https://www.sysrepo.org/
DEPENDS:=+libsysrepo +libstdcpp +python3-base
endef
define Package/sysrepo
@ -70,14 +72,12 @@ define Package/sysrepo/description
Sysrepo is an YANG-based configuration and operational state data store for Unix/Linux applications.
endef
SWIG_VERSION:=4.0.1
CMAKE_OPTIONS += \
-DUSE_AVL_LIB:BOOL=FALSE \
-DENABLE_TESTS:BOOL=FALSE \
-DBUILD_EXAMPLES:BOOL=FALSE \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
-DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
-DGEN_PYTHON_BINDINGS=0 \
-DGEN_LUA_BINDINGS=0 \
-DREPOSITORY_LOC:PATH=/etc/sysrepo \
-DENABLE_NACM:BOOL=FALSE \
-DREQUEST_TIMEOUT=6 \
@ -87,29 +87,15 @@ CMAKE_OPTIONS += \
-DNOTIF_AGE_TIMEOUT=120 \
-DNOTIF_TIME_WINDOW=20 \
-DUSE_SR_MEM_MGMT=0 \
-DFILE_FORMAT_EXT:STRING=xml
ifeq ($(CONFIG_SYSREPO_LUA),y)
CMAKE_OPTIONS += \
-DGEN_LUA_BINDINGS:BOOL=TRUE \
-DGEN_LUA_VERSION=5.1
endif
ifeq ($(CONFIG_SYSREPO_PYTHON),y)
CMAKE_OPTIONS += \
-DGEN_PYTHON_BINDINGS:BOOL=TRUE \
-DGEN_PYTHON_VERSION=3 \
-DGEN_PYTHON3_TESTS:BOOL=FALSE
endif
ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
CMAKE_OPTIONS += \
-DFILE_FORMAT_EXT:STRING=xml \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
-DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
-DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig \
-DSWIG_DIR=$(STAGING_DIR_HOSTPKG)/share/swig/$(SWIG_VERSION) \
-DSWIG_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/bin/swig \
-DCALL_TARGET_BINS_DIRECTLY=OFF
endif
-DCALL_TARGET_BINS_DIRECTLY=OFF \
-DGEN_PYTHON_BINDINGS:BOOL=TRUE \
-DGEN_PYTHON_VERSION=3 \
-DGEN_PYTHON3_TESTS:BOOL=FALSE
define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/usr/lib
@ -132,20 +118,14 @@ define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
endef
ifeq ($(CONFIG_SYSREPO_PYTHON),y)
define Package/python3-sysrepo/install
$(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/swig/libSysrepo-cpp.so* $(1)/usr/lib
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python3/libsysrepoPython3.py $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python3/_libsysrepoPython3.so $(1)$(PYTHON_PKG_DIR)
endif
ifeq ($(CONFIG_SYSREPO_LUA),y)
$(INSTALL_DIR) $(1)/usr/lib/lua/
$(CP) $(PKG_BUILD_DIR)/swig/lua/libSysrepo_Lua.so* $(1)/usr/lib
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/lua/libsysrepoLua.so $(1)/usr/lib/lua/libsysrepoLua.so
endif
$(INSTALL_DIR) $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/sysrepo.py $(1)$(PYTHON3_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python/_sysrepo.so $(1)$(PYTHON3_PKG_DIR)
endef
define Package/sysrepo/install
@ -170,6 +150,7 @@ define Package/sysrepocfg/install
endef
$(eval $(call BuildPackage,libsysrepo))
$(eval $(call BuildPackage,python3-sysrepo))
$(eval $(call BuildPackage,sysrepo))
$(eval $(call BuildPackage,sysrepoctl))
$(eval $(call BuildPackage,sysrepocfg))

Loading…
Cancel
Save