From 3366763f2d5c42d7153190ff7d4f4388df466004 Mon Sep 17 00:00:00 2001 From: xieyijun Date: Thu, 6 Jul 2023 18:01:39 +0800 Subject: [PATCH 1/2] Avoid repeatedly compiling gn Signed-off-by: x30034819 Signed-off-by: xieyijun --- build/builder/common/prebuild.py | 45 +++++++++++++++++++------------- 1 file changed, 27 insertions(+), 18 deletions(-) diff --git a/build/builder/common/prebuild.py b/build/builder/common/prebuild.py index c392c16..9f5989d 100755 --- a/build/builder/common/prebuild.py +++ b/build/builder/common/prebuild.py @@ -26,24 +26,33 @@ def build_deps(output_dir): shutil.rmtree(output_dir) if not os.path.exists(abs_copy_path): os.makedirs(abs_copy_path) - # build gn - gn_dir = os.path.join(output_dir, "gn-build") - cmd = ['git', 'clone', 'https://gitee.com/src-openeuler/gn.git', '-b', 'openEuler-22.03-LTS-SP1', gn_dir] - is_success, _output = exec_sys_command(cmd) - if is_success: - cur_work_dir = os.getcwd() - exec_sys_command(['tar', 'xf', os.path.join(gn_dir, 'gn-e1ac69b17da0c6d4f5e34e686690ff70c6a43e6f.tar.gz'), '-C', gn_dir]) - os.chdir(gn_dir) - #exec_sys_command(['patch', '-p1 Date: Thu, 6 Jul 2023 20:12:01 +0800 Subject: [PATCH 2/2] Avoid repeatedly downloading rpm Signed-off-by: x30034819 Signed-off-by: xieyijun3 --- build/prebuild.sh | 44 +++++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/build/prebuild.sh b/build/prebuild.sh index 2c4d3c6..e7e2010 100755 --- a/build/prebuild.sh +++ b/build/prebuild.sh @@ -67,37 +67,39 @@ python3 ${PROJECT_DIR}/build/builder.py check --install-packages $* # ============================================================================= # # download prebuild files +cd $home +PREBUILD_DIR="ft_prebuild" +if [ ! -d ${PREBUILD_DIR} ]; then +mkdir ${PREBUILD_DIR} +fi +cd ${PREBUILD_DIR} +FT_PREBUILD_DIR=$(pwd) # install prebuild library -if [ ! -d ${PROJECT_DIR}/prebuilts/libs ]; then -git clone https://gitee.com/yanansong/ft_engine_prebuild.git -b rpms ${PROJECT_DIR}/prebuilts/libs +if [ ! -d ${FT_PREBUILD_DIR}/libs ]; then +git clone https://gitee.com/yanansong/ft_engine_prebuild.git -b rpms ${FT_PREBUILD_DIR}/libs fi ARCHNAME=`uname -m` -cd ${PROJECT_DIR}/prebuilts/libs/rpms/${ARCHNAME} +cd ${FT_PREBUILD_DIR}/libs/rpms/${ARCHNAME} sudo ./installRPM -cd ${PROJECT_DIR} -rm -fr ${PROJECT_DIR}/prebuilts/libs - -# install prebuild include. delete download files -if [ ! -d ${PROJECT_DIR}/prebuilts/inc ]; then -git clone https://gitee.com/yanansong/devel_inc.git ${PROJECT_DIR}/prebuilts/inc +# install prebuild include. +if [ ! -d ${FT_PREBUILD_DIR}/inc ]; then +git clone https://gitee.com/yanansong/devel_inc.git ${FT_PREBUILD_DIR}/inc fi -# copy include files to /usr/include. delete download files -cd ${PROJECT_DIR}/prebuilts/inc +# copy include files to /usr/include. +cd ${FT_PREBUILD_DIR}/inc sudo cp -fr * /usr/local/include -cd ${PROJECT_DIR} -rm -fr ${PROJECT_DIR}/prebuilts/inc # install ft_surface_wrapper -if [ ! -d ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper ]; then - git clone https://gitee.com/ShaoboFeng/ft_surface_wrapper.git ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper +if [ ! -d ${FT_PREBUILD_DIR}/rpm/ft_surface_wrapper ]; then + git clone https://gitee.com/ShaoboFeng/ft_surface_wrapper.git ${FT_PREBUILD_DIR}/rpm/ft_surface_wrapper fi -cd ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper/ -if [ ! -d ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper/build ]; then +cd ${FT_PREBUILD_DIR}/rpm/ft_surface_wrapper/ +if [ ! -d ${FT_PREBUILD_DIR}/rpm/ft_surface_wrapper/build ]; then mkdir build fi @@ -105,14 +107,14 @@ cd build cmake .. make -j6 sudo make install -rm -fr ${PROJECT_DIR}/prebuilts/rpm/ft_surface_wrapper +rm -fr ${FT_PREBUILD_DIR}/rpm/ft_surface_wrapper cd ${PROJECT_DIR} # install mesa_fangtian -if [ ! -d ${PROJECT_DIR}/prebuilts/rpm/binary ]; then - git clone https://gitee.com/ShaoboFeng/rpm-fangtian.git ${PROJECT_DIR}/prebuilts/rpm/binary +if [ ! -d ${FT_PREBUILD_DIR}/rpm/binary ]; then + git clone https://gitee.com/ShaoboFeng/rpm-fangtian.git ${FT_PREBUILD_DIR}/rpm/binary fi -cd ${PROJECT_DIR}/prebuilts/rpm/binary +cd ${FT_PREBUILD_DIR}/rpm/binary ./install.sh cd ${PROJECT_DIR} -- Gitee