Browse Source

sysrepo: add python2 and lua5.1 language bindings

Signed-off-by: Matija Amidzic <matija.amidzic@sartura.hr>
lilik-openwrt-22.03
Matija Amidzic 7 years ago
parent
commit
8feb300d8f
2 changed files with 69 additions and 1 deletions
  1. +23
    -0
      net/sysrepo/Config_libsysrepo.in
  2. +46
    -1
      net/sysrepo/Makefile

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

@ -0,0 +1,23 @@
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

+ 46
- 1
net/sysrepo/Makefile View File

@ -31,13 +31,23 @@ PKG_INSTALL:=1
include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk include $(INCLUDE_DIR)/cmake.mk
ifeq ($(CONFIG_SYSREPO_PYTHON),y)
$(call include_mk, python-package.mk)
endif
define Package/libsysrepo/config
source "$(SOURCE)/Config_libsysrepo.in"
endef
PKG_BUILD_DEPENDS:=+SYSREPO_BINDINGS:swig/host
define Package/libsysrepo define Package/libsysrepo
SECTION:=utils SECTION:=utils
CATEGORY:=Utilities CATEGORY:=Utilities
URL:=$(PKG_SOURCE_URL) URL:=$(PKG_SOURCE_URL)
TITLE:=YANG-based data store library TITLE:=YANG-based data store library
DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt
DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python-base +SYSREPO_LUA:lua
MENU:=1
endef endef
define Package/sysrepo define Package/sysrepo
@ -75,6 +85,8 @@ CMAKE_OPTIONS += \
-DBUILD_EXAMPLES:BOOL=FALSE \ -DBUILD_EXAMPLES:BOOL=FALSE \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \ -DCMAKE_DISABLE_FIND_PACKAGE_SWIG=TRUE \
-DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \ -DGEN_LANGUAGE_BINDINGS:BOOL=FALSE \
-DGEN_PYTHON_BINDINGS=0 \
-DGEN_LUA_BINDINGS=0 \
-DREPOSITORY_LOC:PATH=/etc/sysrepo \ -DREPOSITORY_LOC:PATH=/etc/sysrepo \
-DCMAKE_INSTALL_PREFIX:PATH=/usr \ -DCMAKE_INSTALL_PREFIX:PATH=/usr \
-DENABLE_NACM:BOOL=FALSE \ -DENABLE_NACM:BOOL=FALSE \
@ -86,6 +98,25 @@ CMAKE_OPTIONS += \
-DNOTIF_TIME_WINDOW=20 \ -DNOTIF_TIME_WINDOW=20 \
-DUSE_SR_MEM_MGMT=0 -DUSE_SR_MEM_MGMT=0
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=2
endif
ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
CMAKE_OPTIONS += \
-DCMAKE_DISABLE_FIND_PACKAGE_SWIG=FALSE \
-DGEN_LANGUAGE_BINDINGS:BOOL=TRUE \
-DSWIG_DIR=$(STAGING_DIR)/host/share/swig
endif
define Package/libsysrepo/install define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/usr/lib $(INSTALL_DIR) $(1)/usr/lib
$(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/ $(CP) $(PKG_BUILD_DIR)/src/libsysrepo.so* $(1)/usr/lib/
@ -107,6 +138,20 @@ define Package/libsysrepo/install
$(INSTALL_DIR) $(1)/etc/uci-defaults $(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo $(INSTALL_BIN) ./files/libsysrepo.default $(1)/etc/uci-defaults/95_libsysrepo
ifeq ($(CONFIG_SYSREPO_PYTHON),y)
$(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/python2/libsysrepoPython2.py $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DATA) $(PKG_BUILD_DIR)/swig/python2/_libsysrepoPython2.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
endef endef
define Package/sysrepo/install define Package/sysrepo/install


Loading…
Cancel
Save