sysrepo: Switch to Python 3 9491/head
authorRosen Penev <rosenp@gmail.com>
Mon, 4 Nov 2019 20:24:07 +0000 (12:24 -0800)
committerRosen Penev <rosenp@gmail.com>
Mon, 4 Nov 2019 20:24:07 +0000 (12:24 -0800)
Python 2 will be EOL by the end of the year. Switch to Python 3 as there
is already support for it.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
net/sysrepo/Makefile

index a5578ef6b98ce6d8445da52e91806dcfbf00090a..c5ef604f39a142487031e673035464e065e3a50d 100644 (file)
@@ -26,7 +26,7 @@ PKG_BUILD_DEPENDS:=SYSREPO_BINDINGS:swig/host
 include $(INCLUDE_DIR)/package.mk
 include $(INCLUDE_DIR)/cmake.mk
 ifeq ($(CONFIG_SYSREPO_PYTHON),y)
-$(call include_mk, python-package.mk)
+$(call include_mk, python3-package.mk)
 endif
 
 define Package/libsysrepo/config
@@ -38,7 +38,7 @@ define Package/libsysrepo
   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:python-base +SYSREPO_LUA:lua
+  DEPENDS:=+libyang +libprotobuf-c +libev +libredblack +librt +libpthread +SYSREPO_BINDINGS:libstdcpp +SYSREPO_PYTHON:python3-base +SYSREPO_LUA:lua
   MENU:=1
 endef
 
@@ -98,7 +98,8 @@ endif
 ifeq ($(CONFIG_SYSREPO_PYTHON),y)
 CMAKE_OPTIONS += \
        -DGEN_PYTHON_BINDINGS:BOOL=TRUE \
-       -DGEN_PYTHON_VERSION=2
+       -DGEN_PYTHON_VERSION=3 \
+       -DGEN_PYTHON3_TESTS:BOOL=FALSE
 endif
 
 ifeq ($(CONFIG_SYSREPO_BINDINGS),y)
@@ -136,8 +137,8 @@ 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)
+       $(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)