From b9b6e5bd6984db8ab33ea1f7d8650113d8c21fd1 Mon Sep 17 00:00:00 2001
From: zhongtao <zhongtao17@huawei.com>
Date: Fri, 27 Sep 2024 17:26:03 +1400
Subject: [PATCH 146/149] upgrade isulad compilation script
 install_iSulad_on_Ubuntu_20_04_LTS

Signed-off-by: zhongtao <zhongtao17@huawei.com>
---
 CI/dockerfiles/Dockerfile-ubuntu              |  2 +-
 .../install_iSulad_on_Ubuntu_20_04_LTS.sh     | 26 +++++++++++++++----
 2 files changed, 22 insertions(+), 6 deletions(-)

diff --git a/CI/dockerfiles/Dockerfile-ubuntu b/CI/dockerfiles/Dockerfile-ubuntu
index 09a20eb5..6420173a 100644
--- a/CI/dockerfiles/Dockerfile-ubuntu
+++ b/CI/dockerfiles/Dockerfile-ubuntu
@@ -83,8 +83,8 @@ RUN apt update -y && apt upgrade -y && \
 			patch \
 			tcpdump
 
+RUN apt install -y ninja-build meson
 RUN apt install -y libncurses-dev && apt autoremove -y
-RUN pip3 install meson ninja
 
 RUN echo "export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH" >> /etc/bashrc && \
     echo "export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH" >> /etc/bashrc && \
diff --git a/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh b/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
index f44bddb4..35995ff4 100755
--- a/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
+++ b/docs/build_docs/guide/script/install_iSulad_on_Ubuntu_20_04_LTS.sh
@@ -7,10 +7,25 @@ set -e
 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
 export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib/x86_64-linux-gnu/:$LD_LIBRARY_PATH
 echo "/usr/local/lib" >> /etc/ld.so.conf
-apt install -y g++ libprotobuf-dev protobuf-compiler protobuf-compiler-grpc libgrpc++-dev libgrpc-dev libtool automake autoconf cmake make pkg-config libyajl-dev zlib1g-dev libselinux1-dev libseccomp-dev libcap-dev libsystemd-dev git libarchive-dev libcurl4-gnutls-dev openssl libdevmapper-dev python3 libtar0 libtar-dev libwebsockets-dev
+
+
+if [ ! -e "/etc/timezone" ]; then
+    export TZ=Asia/Shanghai
+    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
+fi
+
+apt update -y && apt upgrade -y
+apt install -y g++ systemd libprotobuf-dev protobuf-compiler protobuf-compiler-grpc libgrpc++-dev libgrpc-dev libtool automake autoconf cmake make pkg-config libyajl-dev zlib1g-dev libselinux1-dev libseccomp-dev libcap-dev libsystemd-dev git libarchive-dev libcurl4-gnutls-dev openssl libdevmapper-dev python3 libtar0 libtar-dev libwebsockets-dev
+
+apt install -y runc
+
+apt install -y docbook2x ninja-build meson
+apt install -y libncurses-dev
 
 BUILD_DIR=/tmp/build_isulad
 
+git config --global http.sslverify false
+
 rm -rf $BUILD_DIR
 mkdir -p $BUILD_DIR
 
@@ -18,11 +33,12 @@ mkdir -p $BUILD_DIR
 cd $BUILD_DIR
 git clone https://gitee.com/src-openeuler/lxc.git
 cd lxc
+git config --global --add safe.directory $BUILD_DIR/lxc/lxc-5.0.2
 ./apply-patches
-cd lxc-4.0.3
-./autogen.sh
-./configure
-make -j $(nproc)
+cd lxc-5.0.2
+meson setup -Disulad=true \
+    -Dprefix=/usr build
+meson compile -C build
 make install
 
 # build lcr
-- 
2.25.1

