From 76f78369d087156e4846876cd9f9948eda515659 Mon Sep 17 00:00:00 2001
From: gifrerenom <lluis.gifre@cttc.es>
Date: Fri, 22 Dec 2023 13:08:06 +0000
Subject: [PATCH] Common:

- Added installation of libyang to install_requirements script
---
 install_requirements.sh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/install_requirements.sh b/install_requirements.sh
index 74db1cb34..c59ea7f13 100755
--- a/install_requirements.sh
+++ b/install_requirements.sh
@@ -24,6 +24,22 @@ ALL_COMPONENTS="${ALL_COMPONENTS} dbscanserving opticalattackmitigator opticalat
 ALL_COMPONENTS="${ALL_COMPONENTS} l3_attackmitigator l3_centralizedattackdetector l3_distributedattackdetector"
 TFS_COMPONENTS=${TFS_COMPONENTS:-$ALL_COMPONENTS}
 
+# Some components require libyang built from source code
+# - Ref: https://github.com/CESNET/libyang
+# - Ref: https://github.com/CESNET/libyang-python/
+echo "Installing libyang..."
+sudo apt-get --yes --quiet --quiet update
+sudo apt-get --yes --quiet --quiet install build-essential cmake libpcre2-dev python3-dev python3-cffi
+mkdir libyang
+git clone https://github.com/CESNET/libyang.git libyang
+mkdir libyang/build
+cd libyang/build
+cmake -D CMAKE_BUILD_TYPE:String="Release" ..
+make
+sudo make install
+sudo ldconfig
+cd ../..
+
 echo "Updating PIP, SetupTools and Wheel..."
 pip install --upgrade pip               # ensure next packages get the latest versions
 pip install --upgrade setuptools wheel  # bring basic tooling for other requirements
-- 
GitLab