Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compile libyang 1.0.184 #6284

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion platform/vs/docker-sonic-vs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ $(DOCKER_SONIC_VS)_DEPENDS += $(SWSS) \
$(SONIC_DEVICE_DATA) \
$(LIBYANG) \
$(LIBYANG_CPP) \
$(LIBYANG_PY2) \
$(LIBYANG_PY3) \
$(SONIC_UTILITIES_DATA) \
$(SONIC_HOST_SERVICES_DATA)
Expand Down
8 changes: 2 additions & 6 deletions rules/libyang.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# libyang

LIBYANG_VERSION_BASE = 1.0
LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).73
LIBYANG_VERSION = $(LIBYANG_VERSION_BASE).184
LIBYANG_SUBVERSION = 1

export LIBYANG_VERSION_BASE
Expand All @@ -26,8 +26,4 @@ LIBYANG_PY3 = python3-yang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBYANG_PY3)_DEPENDS += $(LIBYANG) $(LIBYANG_CPP)
$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY3)))

LIBYANG_PY2 = python2-yang_$(LIBYANG_VERSION)_$(CONFIGURED_ARCH).deb
$(LIBYANG_PY2)_DEPENDS += $(LIBYANG) $(LIBYANG_CPP)
$(eval $(call add_derived_package,$(LIBYANG),$(LIBYANG_PY2)))

export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3 LIBYANG_PY2
export LIBYANG LIBYANG_DBG LIBYANG_DEV LIBYANG_CPP LIBYANG_PY3
2 changes: 1 addition & 1 deletion rules/sonic-yang-models-py3.mk
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ SONIC_YANG_MODELS_PY3 = sonic_yang_models-1.0-py3-none-any.whl
$(SONIC_YANG_MODELS_PY3)_SRC_PATH = $(SRC_PATH)/sonic-yang-models
$(SONIC_YANG_MODELS_PY3)_PYTHON_VERSION = 3
$(SONIC_YANG_MODELS_PY3)_DEBS_DEPENDS = $(LIBYANG) $(LIBYANG_CPP) \
$(LIBYANG_PY2) $(LIBYANG_PY3)
$(LIBYANG_PY3)

SONIC_PYTHON_WHEELS += $(SONIC_YANG_MODELS_PY3)
export SONIC_YANG_MODELS_PY3
4 changes: 2 additions & 2 deletions src/libyang/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ SHELL = /bin/bash
.SHELLFLAGS += -e

MAIN_TARGET = $(LIBYANG)
DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_PY2) $(LIBYANG_PY3) $(LIBYANG_CPP)
DERIVED_TARGETS = $(LIBYANG_DEV) $(LIBYANG_DBG) $(LIBYANG_CPP) $(LIBYANG_PY3)

$(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 tags/v1.0-r4 -b libyang
git checkout tags/v1.0.184 -b libyang
# Apply patch series
stg init
stg import -s ../patch/series
Expand Down
85 changes: 85 additions & 0 deletions src/libyang/patch/enable-python3-yang-debian.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
enable python3-yang debian package

From: Guohan Lu <lguohan@gmail.com>


---
packages/CMakeLists.txt | 5 ++---
packages/debian.control.in | 12 ++++++++++++
packages/debian.rules.in | 4 ++--
packages/libyang.dsc.in | 4 ++++
4 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/packages/CMakeLists.txt b/packages/CMakeLists.txt
index 982be91d..79b92d38 100644
--- a/packages/CMakeLists.txt
+++ b/packages/CMakeLists.txt
@@ -23,9 +23,8 @@ configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${CPP_PACKAGE}.install
${PROJECT_BINARY_DIR}/build-packages/debian.${CPP_PACKAGE}.install COPYONLY)
configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${CPP_PACKAGE}-dev.install
${PROJECT_BINARY_DIR}/build-packages/debian.${CPP_PACKAGE}-dev.install COPYONLY)
-# no python package for Debian because there is only SWIG 3.10 on Debian 9 :-/
-#configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PYTHON_PACKAGE}.install
-# ${PROJECT_BINARY_DIR}/build-packages/debian.${PYTHON_PACKAGE}.install COPYONLY)
+configure_file(${PROJECT_SOURCE_DIR}/packages/debian.${PYTHON_PACKAGE}.install
+ ${PROJECT_BINARY_DIR}/build-packages/debian.${PYTHON_PACKAGE}.install COPYONLY)

if(NOT DEB_BUILDER)
message(STATUS "Missing tools (devscripts, debhelper package) for building DEB package.")
diff --git a/packages/debian.control.in b/packages/debian.control.in
index a5a6a698..565a625d 100644
--- a/packages/debian.control.in
+++ b/packages/debian.control.in
@@ -49,3 +49,15 @@ Depends: @CPP_PACKAGE@ (=@LIBYANG_VERSION@)
Section: debug
Architecture: any
Description: Debug symbols of C++ bidings of libyang library.
+
+Package: @PYTHON_PACKAGE@
+Depends: @PACKAGE@ (=@LIBYANG_VERSION@), @CPP_PACKAGE@ (=@LIBYANG_VERSION@)
+Section: libs
+Architecture: any
+Description: Bindings of libyang library to python3 language.
+
+Package: @PYTHON_PACKAGE@-dbg
+Depends: @PYTHON_PACKAGE@ (=@LIBYANG_VERSION@)
+Section: debug
+Architecture: any
+Description: Debug symbols of python3 bidings of libyang library.
diff --git a/packages/debian.rules.in b/packages/debian.rules.in
index 86ea390f..e2e39b94 100644
--- a/packages/debian.rules.in
+++ b/packages/debian.rules.in
@@ -9,11 +9,11 @@ export DH_VERBOSE=1
override_dh_strip:
dh_strip -p@PACKAGE@ --dbg-package=@PACKAGE@-dbg
dh_strip -p@CPP_PACKAGE@ --dbg-package=@CPP_PACKAGE@-dbg
-# dh_strip -p@PYTHON_PACKAGE@ --dbg-package=@PYTHON_PACKAGE@-dbg
+ dh_strip -p@PYTHON_PACKAGE@ --dbg-package=@PYTHON_PACKAGE@-dbg

override_dh_auto_configure:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DFORCE_INSRC_BUILD=ON -DCMAKE_BUILD_TYPE="Package" -DENABLE_LYD_PRIV=ON \
- -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_BINDINGS=OFF .
+ -DGEN_LANGUAGE_BINDINGS=ON -DGEN_PYTHON_BINDINGS=ON .

override_dh_auto_test:
ctest --output-on-failure
diff --git a/packages/libyang.dsc.in b/packages/libyang.dsc.in
index bd1890ce..ed679b7a 100644
--- a/packages/libyang.dsc.in
+++ b/packages/libyang.dsc.in
@@ -7,6 +7,8 @@ Binary:
@CPP_PACKAGE@,
@CPP_PACKAGE@-dev,
@CPP_PACKAGE@-dbg,
+ @PYTHON_PACKAGE@,
+ @PYTHON_PACKAGE@-dbg,
Maintainer: CESNET <mvasko@cesnet.cz>
Version: @LIBYANG_VERSION@
Architecture: any
@@ -23,3 +25,5 @@ Build-Depends:
pkg-config,
libpcre3-dev,
libcmocka-dev,
+ python3-dev,
+ swig (>= 3.0.12),
153 changes: 26 additions & 127 deletions src/libyang/patch/libyang.patch
Original file line number Diff line number Diff line change
@@ -1,134 +1,33 @@
compile libyang

From: Guohan Lu <lguohan@gmail.com>


---
CMakeLists.txt | 2 ++
packages/debian.libyang.install | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa562dd3..8635ba15 100644
index 28769720..577115ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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})
@@ -42,6 +42,8 @@ if(NOT UNIX)
message(FATAL_ERROR "Only *nix like systems are supported.")
endif()

+set(CMAKE_INSTALL_PREFIX /usr)
+
# 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
+++ 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.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..e92fe4a1 100644
--- a/packages/debian.rules.in
+++ b/packages/debian.rules.in
@@ -9,10 +9,14 @@ export DH_VERBOSE=1
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 -ppython2-yang@PACKAGE_PART_NAME@ --dbg-package=python2-yang@PACKAGE_PART_NAME@-dbg
dh_strip -ppython3-yang@PACKAGE_PART_NAME@ --dbg-package=python3-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@" -DENABLE_LYD_PRIV=ON -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/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 <rkrejci@cesnet.cz>
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..6939f028 100644
--- a/packages/libyang.spec.in
+++ b/packages/libyang.spec.in
@@ -46,6 +46,8 @@ BuildRequires: python3-devel
%else
BuildRequires: python34-devel
%endif
+
+BuildRequires: python2-devel
%endif

Conflicts: @CONFLICT_PACKAGE_NAME@ = @LIBYANG_MAJOR_VERSION@.@LIBYANG_MINOR_VERSION@
@@ -70,6 +72,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 +87,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 +178,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..4318a49d 100755
--- a/packages/local-deb.sh.in
+++ b/packages/local-deb.sh.in
@@ -18,6 +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.python2-yang.install" debian/python2-yang@PACKAGE_PART_NAME@.install
cp "@PROJECT_SOURCE_DIR@/packages/debian.python3-yang.install" debian/python3-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
diff --git a/packages/debian.libyang.install b/packages/debian.libyang.install
index 57a5e8ad..71e0ae37 100644
--- a/packages/debian.libyang.install
+++ b/packages/debian.libyang.install
@@ -2,4 +2,4 @@ usr/bin/yanglint
usr/bin/yangre
usr/share/man/man1
usr/lib/*/libyang.so.*
-usr/lib/*/libyang1/*
+usr/lib/libyang1/*
2 changes: 1 addition & 1 deletion src/libyang/patch/series
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
libyang.patch
swig.patch
enable-python3-yang-debian.patch
large_file_support_arm32.patch
Loading