From 51f599433b86405975ba26c6a6d9380cead712a0 Mon Sep 17 00:00:00 2001 From: Ping Mao Date: Thu, 3 Oct 2019 16:58:48 -0700 Subject: [PATCH 1/3] libyang 1.0.70 --- rules/libyang.mk | 24 ++++-- src/libyang/Makefile | 26 ++++--- src/libyang/patch/libyang.patch | 133 ++++++++++++++++++++++++++++++++ src/libyang/patch/series | 1 + 4 files changed, 167 insertions(+), 17 deletions(-) create mode 100644 src/libyang/patch/libyang.patch create mode 100644 src/libyang/patch/series diff --git a/rules/libyang.mk b/rules/libyang.mk index 2561be6b7122..724c3731f23c 100644 --- a/rules/libyang.mk +++ b/rules/libyang.mk @@ -1,23 +1,31 @@ # libyang -LIBYANG_VERSION_BASE = 0.16 -LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).105 +LIBYANG_VERSION_BASE = 1.0 +LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).70 LIBYANG_SUBVERSION = 1 export LIBYANG_VERSION_BASE export LIBYANG_VERSION export LIBYANG_SUBVERSION -LIBYANG = libyang$(LIBYANG_VERSION_BASE)_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb +#LIBYANG = libyang$(LIBYANG_VERSION_BASE)_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb +LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb $(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang $(LIBYANG)_DEPENDS += $(SWIG_BASE) $(SWIG) SONIC_MAKE_DEBS += $(LIBYANG) SONIC_STRETCH_DEBS += $(LIBYANG) -LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DEV))) +#LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb +LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb -LIBYANG_DBG = libyang$(LIBYANG_VERSION_BASE)-dbgsym_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb -$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DBG))) +#LIBYANG_DBG = libyang$(LIBYANG_VERSION_BASE)-dbgsym_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb +LIBYANG_DBG = libyang-dbgsym_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb +LIBYANG_CPP = libyang-cpp_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb +LIBYANG_PY3 = python3-yang_$(LIBYANG_VERSION)_amd64.deb +LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_amd64.deb -export LIBYANG LIBYANG_DEV LIBYANG_DBG +#SONIC_PYTHON_STDEB_DEBS += $(LIBYANG_PY2) + +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DEV)), $(LIBYANG_CPP), $(LIBYANG_PY3), $(LIBYANG_PY2)) + +export LIBYANG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2 diff --git a/src/libyang/Makefile b/src/libyang/Makefile index cb58f7c5128b..62887a281a3a 100644 --- a/src/libyang/Makefile +++ b/src/libyang/Makefile @@ -3,19 +3,27 @@ SHELL = /bin/bash .SHELLFLAGS += -e MAIN_TARGET = $(LIBYANG) -DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) +DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_PY2) $(LIBYANG_CPP) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : + # Obtaining the libyang rm -fr ./libyang-$(LIBYANG_VERSION) - wget -O libyang_$(LIBYANG_VERSION).orig.tar.gz 'https://sonicstorage.blob.core.windows.net/packages/libyang_0.16.105.orig.tar.gz?sv=2015-04-05&sr=b&sig=yTWDhl6B9TTXWAQ46zpLiNxUib61W7U0%2F%2FGvhRibKOc%3D&se=2046-09-30T22%3A10%3A27Z&sp=r' - wget -O libyang_$(LIBYANG_VERSION).dsc 'https://sonicstorage.blob.core.windows.net/packages/libyang_0.16.105-1.dsc?sv=2015-04-05&sr=b&sig=eLkO5wzB1C5oKNIaUPro4gwrgEC3EygIO6eCyTzHmeI%3D&se=2046-09-30T22%3A10%3A12Z&sp=r' - wget -O libyang_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION).debian.tar.xz 'https://sonicstorage.blob.core.windows.net/packages/libyang_0.16.105-1.debian.tar.xz?sv=2015-04-05&sr=b&sig=AH18p7pKK0xIBVxZuA8EMv9%2FhXbCFKmbWAn7Za8%2BZW4%3D&se=2046-09-30T22%3A09%3A36Z&sp=r' - dpkg-source -x libyang_$(LIBYANG_VERSION).dsc + git clone https://github.com/CESNET/libyang.git libyang-$(LIBYANG_VERSION) + pushd libyang-$(LIBYANG_VERSION) + git checkout -b libyang -f bc8fdee622075db48a16edaa66b0df363346cbe6 - pushd ./libyang-$(LIBYANG_VERSION) - dpkg-buildpackage -rfakeroot -b -us -uc -j$(SONIC_CONFIG_MAKE_JOBS) - popd + # Apply patch series + stg init + stg import -s ../patch/series + + mkdir build + pushd build + cmake .. + make build-deb - mv $(DERIVED_TARGETS) $* $(DEST)/ + pushd debs + mv $* $(DEST)/ + mv $(DERIVED_TARGETS) $(DEST)/ + popd $(addprefix $(DEST)/, $(DERIVED_TARGETS)): $(DEST)/% : $(DEST)/$(MAIN_TARGET) diff --git a/src/libyang/patch/libyang.patch b/src/libyang/patch/libyang.patch new file mode 100644 index 000000000000..f539bf55fdb1 --- /dev/null +++ b/src/libyang/patch/libyang.patch @@ -0,0 +1,133 @@ +diff --git a/packages/debian.control.in b/packages/debian.control.in +index da6588b9..fb3ede48 100644 +--- a/packages/debian.control.in ++++ b/packages/debian.control.in +@@ -53,3 +53,15 @@ Depends: python3-yang@PACKAGE_PART_NAME@ (=@LIBYANG_VERSION@) + Section: debug + Architecture: any + Description: Debug symbols of python3 bidings of libyang library. ++ ++Package: python2-yang@PACKAGE_PART_NAME@ ++Depends: @PACKAGE_NAME@ (=@LIBYANG_VERSION@), libyang-cpp@PACKAGE_PART_NAME@ (=@LIBYANG_VERSION@) ++Section: libs ++Architecture: any ++Description: Bindings of libyang library to python2 language. ++ ++Package: python2-yang@PACKAGE_PART_NAME@-dbg ++Depends: python2-yang@PACKAGE_PART_NAME@ (=@LIBYANG_VERSION@) ++Section: debug ++Architecture: any ++Description: Debug symbols of python2 bidings of libyang library. +diff --git a/packages/debian.libyang.install b/packages/debian.libyang.install +index a4448a6d..be906e43 100644 +--- a/packages/debian.libyang.install ++++ b/packages/debian.libyang.install +@@ -2,4 +2,3 @@ usr/bin/yanglint + usr/bin/yangre + usr/share/man/man1 + usr/lib/*/libyang.so.* +-usr/lib/libyang/* +diff --git a/packages/debian.python2-yang.install b/packages/debian.python2-yang.install +new file mode 100644 +index 00000000..14ce2f3c +--- /dev/null ++++ b/packages/debian.python2-yang.install +@@ -0,0 +1 @@ ++usr/lib/python2.7/dist-packages/* +diff --git a/packages/debian.rules.in b/packages/debian.rules.in +index d565819e..a9e02626 100644 +--- a/packages/debian.rules.in ++++ b/packages/debian.rules.in +@@ -10,9 +10,10 @@ override_dh_strip: + dh_strip -plibyang@PACKAGE_PART_NAME@ --dbg-package=libyang@PACKAGE_PART_NAME@-dbg + dh_strip -plibyang-cpp@PACKAGE_PART_NAME@ --dbg-package=libyang-cpp@PACKAGE_PART_NAME@-dbg + dh_strip -ppython3-yang@PACKAGE_PART_NAME@ --dbg-package=python3-yang@PACKAGE_PART_NAME@-dbg ++ dh_strip -ppython2-yang@PACKAGE_PART_NAME@ --dbg-package=python2-yang@PACKAGE_PART_NAME@-dbg + + override_dh_auto_configure: +- cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON . ++ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_VERSION=2 . + + override_dh_auto_test: + ctest --output-on-failure +diff --git a/packages/libyang.dsc.in b/packages/libyang.dsc.in +index fdfa402b..f75ba184 100644 +--- a/packages/libyang.dsc.in ++++ b/packages/libyang.dsc.in +@@ -1,10 +1,10 @@ + Format: 3.0 (quilt) + Source: @PACKAGE_NAME@ +-Binary: @PACKAGE_NAME@, @PACKAGE_NAME@-dbg, @PACKAGE_NAME@-dev, libyang-cpp@PACKAGE_PART_NAME@, libyang-cpp@PACKAGE_PART_NAME@-dev, libyang-cpp@PACKAGE_PART_NAME@-dbg, python3-yang@PACKAGE_PART_NAME@, python3-yang@PACKAGE_PART_NAME@-dbg ++Binary: @PACKAGE_NAME@, @PACKAGE_NAME@-dbg, @PACKAGE_NAME@-dev, libyang-cpp@PACKAGE_PART_NAME@, libyang-cpp@PACKAGE_PART_NAME@-dev, libyang-cpp@PACKAGE_PART_NAME@-dbg, python3-yang@PACKAGE_PART_NAME@, python3-yang@PACKAGE_PART_NAME@-dbg python2-yang@PACKAGE_PART_NAME@, python2-yang@PACKAGE_PART_NAME@-dbg + Maintainer: CESNET + Version: @LIBYANG_VERSION@ + Architecture: any + Standards-Version: 3.8.2 + Homepage: https://github.com/CESNET/libyang + Vcs-Git: https://github.com/CESNET/libyang +-Build-Depends: debhelper (>= 9), make, gcc, doxygen, cmake, pkg-config, libpcre3-dev, libcmocka-dev, python3-dev, g++, swig (>= 3.0.12) ++Build-Depends: debhelper (>= 9), make, gcc, doxygen, cmake, pkg-config, libpcre3-dev, libcmocka-dev, python3-dev, python2-dev, g++, swig (>= 3.0.12) +diff --git a/packages/libyang.spec.in b/packages/libyang.spec.in +index 6a4ac615..24431f1e 100644 +--- a/packages/libyang.spec.in ++++ b/packages/libyang.spec.in +@@ -48,6 +48,13 @@ BuildRequires: python34-devel + %endif + %endif + ++%if 0%{?suse_version} + 0%{?fedora} > 0 ++BuildRequires: python2-devel ++%else ++BuildRequires: python2-devel ++%endif ++%endif ++ + Conflicts: @CONFLICT_PACKAGE_NAME@ = @LIBYANG_MAJOR_VERSION@.@LIBYANG_MINOR_VERSION@ + + %package devel +@@ -70,6 +77,11 @@ Summary: Binding to python + Requires: libyang-cpp@PACKAGE_PART_NAME@ = %{version}-%{release} + Requires: %{name} = %{version}-%{release} + ++%package -n python2-yang@PACKAGE_PART_NAME@ ++Summary: Binding to python ++Requires: libyang-cpp@PACKAGE_PART_NAME@ = %{version}-%{release} ++Requires: %{name} = %{version}-%{release} ++ + %description -n libyang-cpp@PACKAGE_PART_NAME@ + Bindings of libyang library to C++ language. + +@@ -80,6 +92,10 @@ Headers of bindings to c++ language. + Bindings of libyang library to python language. + %endif + ++%description -n python2-yang@PACKAGE_PART_NAME@ ++Bindings of libyang library to python language. ++%endif ++ + %description devel + Headers of libyang library. + +@@ -167,4 +183,9 @@ make DESTDIR=%{buildroot} install + %{_libdir}/python* + %endif + ++%files -n python2-yang@PACKAGE_PART_NAME@ ++%defattr(-,root,root) ++%{_libdir}/python* ++%endif ++ + %changelog +diff --git a/packages/local-deb.sh.in b/packages/local-deb.sh.in +index 057bbc67..61570a46 100755 +--- a/packages/local-deb.sh.in ++++ b/packages/local-deb.sh.in +@@ -18,7 +18,7 @@ fi + cp "@PROJECT_SOURCE_DIR@/packages/debian.libyang-dev.install" debian/@PACKAGE_NAME@-dev.install + cp "@PROJECT_SOURCE_DIR@/packages/debian.libyang-cpp.install" debian/libyang-cpp@PACKAGE_PART_NAME@.install + cp "@PROJECT_SOURCE_DIR@/packages/debian.libyang-cpp-dev.install" debian/libyang-cpp@PACKAGE_PART_NAME@-dev.install +-cp "@PROJECT_SOURCE_DIR@/packages/debian.python3-yang.install" debian/python3-yang@PACKAGE_PART_NAME@.install ++cp "@PROJECT_SOURCE_DIR@/packages/debian.python2-yang.install" debian/python2-yang@PACKAGE_PART_NAME@.install + echo -e "@PACKAGE_NAME@ (@LIBYANG_VERSION@) stable; urgency=low\n" >debian/changelog + git log -10 --pretty=format:' * %s (%aN)%n' 2>/dev/null >>debian/changelog || echo -e " * unknown changes \n" >>debian/changelog + git log -1 --pretty=format:'%n -- %aN <%aE> %aD%n' >>debian/changelog 2>/dev/null || echo " -- ${USER} <${USER}@`hostname`> `date -R`" >>debian/changelog diff --git a/src/libyang/patch/series b/src/libyang/patch/series new file mode 100644 index 000000000000..7b7619424b66 --- /dev/null +++ b/src/libyang/patch/series @@ -0,0 +1 @@ +libyang.patch From 7d9718427097f76a8efa004b9adce873c4629c7c Mon Sep 17 00:00:00 2001 From: Ping Mao Date: Fri, 4 Oct 2019 12:32:56 -0700 Subject: [PATCH 2/3] - libyang plugins - specify YANG 1.1 version in sonic-acl.yang for libyang YANG1.1 support --- src/libyang/patch/libyang.patch | 28 +++++++++++-------- .../yang-models/sonic-acl.yang | 1 + 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/src/libyang/patch/libyang.patch b/src/libyang/patch/libyang.patch index f539bf55fdb1..a370312da7e1 100644 --- a/src/libyang/patch/libyang.patch +++ b/src/libyang/patch/libyang.patch @@ -1,3 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cd03ba5c..97c2389c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,6 +54,7 @@ else() + endif() + option(ENABLE_CALLGRIND_TESTS "Build performance tests to be run with callgrind" OFF) + ++set(CMAKE_INSTALL_PREFIX /usr) + option(ENABLE_CACHE "Enable data caching for schemas and hash tables for data (time-efficient at the cost of increased space-complexity)" ON) + option(ENABLE_LATEST_REVISIONS "Enable reusing of latest revisions of schemas" ON) + option(ENABLE_LYD_PRIV "Add a private pointer also to struct lyd_node (data node structure), just like in struct lys_node, for arbitrary user data" OFF) diff --git a/packages/debian.control.in b/packages/debian.control.in index da6588b9..fb3ede48 100644 --- a/packages/debian.control.in @@ -18,15 +30,6 @@ index da6588b9..fb3ede48 100644 +Section: debug +Architecture: any +Description: Debug symbols of python2 bidings of libyang library. -diff --git a/packages/debian.libyang.install b/packages/debian.libyang.install -index a4448a6d..be906e43 100644 ---- a/packages/debian.libyang.install -+++ b/packages/debian.libyang.install -@@ -2,4 +2,3 @@ usr/bin/yanglint - usr/bin/yangre - usr/share/man/man1 - usr/lib/*/libyang.so.* --usr/lib/libyang/* diff --git a/packages/debian.python2-yang.install b/packages/debian.python2-yang.install new file mode 100644 index 00000000..14ce2f3c @@ -35,10 +38,10 @@ index 00000000..14ce2f3c @@ -0,0 +1 @@ +usr/lib/python2.7/dist-packages/* diff --git a/packages/debian.rules.in b/packages/debian.rules.in -index d565819e..a9e02626 100644 +index d565819e..5488c21b 100644 --- a/packages/debian.rules.in +++ b/packages/debian.rules.in -@@ -10,9 +10,10 @@ override_dh_strip: +@@ -10,9 +10,13 @@ override_dh_strip: dh_strip -plibyang@PACKAGE_PART_NAME@ --dbg-package=libyang@PACKAGE_PART_NAME@-dbg dh_strip -plibyang-cpp@PACKAGE_PART_NAME@ --dbg-package=libyang-cpp@PACKAGE_PART_NAME@-dbg dh_strip -ppython3-yang@PACKAGE_PART_NAME@ --dbg-package=python3-yang@PACKAGE_PART_NAME@-dbg @@ -47,6 +50,9 @@ index d565819e..a9e02626 100644 override_dh_auto_configure: - cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON . + cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_VERSION=2 . ++ ++override_dh_makeshlibs: ++ dh_makeshlibs -Xextensions -Xuser_types override_dh_auto_test: ctest --output-on-failure diff --git a/src/sonic-yang-mgmt/yang-models/sonic-acl.yang b/src/sonic-yang-mgmt/yang-models/sonic-acl.yang index cdd5a53f912e..a515396ebe65 100644 --- a/src/sonic-yang-mgmt/yang-models/sonic-acl.yang +++ b/src/sonic-yang-mgmt/yang-models/sonic-acl.yang @@ -1,4 +1,5 @@ module sonic-acl { + yang-version 1.1; namespace "http://github.com/Azure/sonic-acl"; prefix acl; From 1ce423d8518c2e9d1a0416cb2436da5b3960b8b6 Mon Sep 17 00:00:00 2001 From: Ping Mao Date: Mon, 28 Oct 2019 13:38:16 -0700 Subject: [PATCH 3/3] - libyang source from github with tags/v1.0-r4 - libyang debian package name format from libyang github --- rules/libyang.mk | 21 +++++++++++---------- src/libyang/Makefile | 7 +++---- src/libyang/patch/libyang.patch | 23 ++++++++++------------- 3 files changed, 24 insertions(+), 27 deletions(-) diff --git a/rules/libyang.mk b/rules/libyang.mk index 724c3731f23c..c935cee897de 100644 --- a/rules/libyang.mk +++ b/rules/libyang.mk @@ -1,31 +1,32 @@ # libyang LIBYANG_VERSION_BASE = 1.0 -LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).70 +LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).73 LIBYANG_SUBVERSION = 1 export LIBYANG_VERSION_BASE export LIBYANG_VERSION export LIBYANG_SUBVERSION -#LIBYANG = libyang$(LIBYANG_VERSION_BASE)_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb LIBYANG = libyang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb $(LIBYANG)_SRC_PATH = $(SRC_PATH)/libyang $(LIBYANG)_DEPENDS += $(SWIG_BASE) $(SWIG) SONIC_MAKE_DEBS += $(LIBYANG) SONIC_STRETCH_DEBS += $(LIBYANG) -#LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb LIBYANG_DEV = libyang-dev_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DEV))) + +LIBYANG_DBG = libyang-dbg_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DBG))) -#LIBYANG_DBG = libyang$(LIBYANG_VERSION_BASE)-dbgsym_$(LIBYANG_VERSION)-$(LIBYANG_SUBVERSION)_$(CONFIGURED_ARCH).deb -LIBYANG_DBG = libyang-dbgsym_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb LIBYANG_CPP = libyang-cpp_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb -LIBYANG_PY3 = python3-yang_$(LIBYANG_VERSION)_amd64.deb -LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_amd64.deb +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_CPP))) -#SONIC_PYTHON_STDEB_DEBS += $(LIBYANG_PY2) +LIBYANG_PY3 = python3-yang_$(LIBYANG_VERSION)_amd64.deb +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY3))) -$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_DEV)), $(LIBYANG_CPP), $(LIBYANG_PY3), $(LIBYANG_PY2)) +LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_amd64.deb +$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY2))) -export LIBYANG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2 +export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2 diff --git a/src/libyang/Makefile b/src/libyang/Makefile index 62887a281a3a..a8fe40ebe72d 100644 --- a/src/libyang/Makefile +++ b/src/libyang/Makefile @@ -2,20 +2,19 @@ SHELL = /bin/bash .SHELLFLAGS += -e + MAIN_TARGET = $(LIBYANG) -DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_PY2) $(LIBYANG_CPP) +DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_PY2) $(LIBYANG_PY3) $(LIBYANG_CPP) $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% : # Obtaining the libyang rm -fr ./libyang-$(LIBYANG_VERSION) git clone https://github.com/CESNET/libyang.git libyang-$(LIBYANG_VERSION) pushd libyang-$(LIBYANG_VERSION) - git checkout -b libyang -f bc8fdee622075db48a16edaa66b0df363346cbe6 - + git checkout tags/v1.0-r4 -b libyang # Apply patch series stg init stg import -s ../patch/series - mkdir build pushd build cmake .. diff --git a/src/libyang/patch/libyang.patch b/src/libyang/patch/libyang.patch index a370312da7e1..67702881c8df 100644 --- a/src/libyang/patch/libyang.patch +++ b/src/libyang/patch/libyang.patch @@ -1,15 +1,15 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index cd03ba5c..97c2389c 100644 +index fa562dd3..8635ba15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -54,6 +54,7 @@ else() - endif() - option(ENABLE_CALLGRIND_TESTS "Build performance tests to be run with callgrind" OFF) +@@ -33,6 +33,7 @@ set(LIBYANG_MICRO_SOVERSION 2) + set(LIBYANG_SOVERSION_FULL ${LIBYANG_MAJOR_SOVERSION}.${LIBYANG_MINOR_SOVERSION}.${LIBYANG_MICRO_SOVERSION}) + set(LIBYANG_SOVERSION ${LIBYANG_MAJOR_SOVERSION}) +set(CMAKE_INSTALL_PREFIX /usr) - option(ENABLE_CACHE "Enable data caching for schemas and hash tables for data (time-efficient at the cost of increased space-complexity)" ON) - option(ENABLE_LATEST_REVISIONS "Enable reusing of latest revisions of schemas" ON) - option(ENABLE_LYD_PRIV "Add a private pointer also to struct lyd_node (data node structure), just like in struct lys_node, for arbitrary user data" OFF) + # set default build type if not specified by user + if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE debug) diff --git a/packages/debian.control.in b/packages/debian.control.in index da6588b9..fb3ede48 100644 --- a/packages/debian.control.in @@ -38,18 +38,15 @@ index 00000000..14ce2f3c @@ -0,0 +1 @@ +usr/lib/python2.7/dist-packages/* diff --git a/packages/debian.rules.in b/packages/debian.rules.in -index d565819e..5488c21b 100644 +index d565819e..0dff057b 100644 --- a/packages/debian.rules.in +++ b/packages/debian.rules.in -@@ -10,9 +10,13 @@ override_dh_strip: - dh_strip -plibyang@PACKAGE_PART_NAME@ --dbg-package=libyang@PACKAGE_PART_NAME@-dbg - dh_strip -plibyang-cpp@PACKAGE_PART_NAME@ --dbg-package=libyang-cpp@PACKAGE_PART_NAME@-dbg +@@ -12,7 +12,10 @@ override_dh_strip: dh_strip -ppython3-yang@PACKAGE_PART_NAME@ --dbg-package=python3-yang@PACKAGE_PART_NAME@-dbg -+ dh_strip -ppython2-yang@PACKAGE_PART_NAME@ --dbg-package=python2-yang@PACKAGE_PART_NAME@-dbg override_dh_auto_configure: - cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON . -+ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_VERSION=2 . ++ cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_BUILD_TYPE:String="@BUILD_TYPE@" -DENABLE_LYD_PRIV=ON -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_VERSION=2 . + +override_dh_makeshlibs: + dh_makeshlibs -Xextensions -Xuser_types