1e41f4b71Sopenharmony_ci# Copyright (c) 2020 Huawei Device Co., Ltd. 2e41f4b71Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 3e41f4b71Sopenharmony_ci# you may not use this file except in compliance with the License. 4e41f4b71Sopenharmony_ci# You may obtain a copy of the License at 5e41f4b71Sopenharmony_ci# 6e41f4b71Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 7e41f4b71Sopenharmony_ci# 8e41f4b71Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 9e41f4b71Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 10e41f4b71Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11e41f4b71Sopenharmony_ci# See the License for the specific language governing permissions and 12e41f4b71Sopenharmony_ci# limitations under the License. 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci 15e41f4b71Sopenharmony_ciFROM ubuntu:18.04 16e41f4b71Sopenharmony_ciWORKDIR /home/openharmony 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ciRUN sed -i "s@http://.*archive.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \ 19e41f4b71Sopenharmony_ci && sed -i "s@http://.*security.ubuntu.com@http://repo.huaweicloud.com@g" /etc/apt/sources.list \ 20e41f4b71Sopenharmony_ci && apt-get update -y \ 21e41f4b71Sopenharmony_ci && apt-get install -y apt-utils binutils bison flex bc build-essential make mtd-utils gcc-arm-linux-gnueabi u-boot-tools python3.8 python3-pip git zip unzip curl wget gcc g++ ruby=1:2.5.1 dosfstools mtools default-jre default-jdk scons python3.8-distutils perl openssl libssl-dev cpio git-lfs m4 ccache zlib1g-dev tar rsync liblz4-tool genext2fs binutils-dev device-tree-compiler e2fsprogs git-core gnupg gnutls-bin gperf lib32ncurses5-dev libffi-dev zlib* libelf-dev libx11-dev libgl1-mesa-dev lib32z1-dev xsltproc x11proto-core-dev libc6-dev-i386 libxml2-dev lib32z-dev libdwarf-dev \ 22e41f4b71Sopenharmony_ci && apt-get install -y grsync xxd libglib2.0-dev libpixman-1-dev kmod jfsutils reiserfsprogs xfsprogs squashfs-tools pcmciautils quota ppp libtinfo-dev libtinfo5 libncurses5 libncurses5-dev libncursesw5 libstdc++6 python2.7 gcc-arm-none-eabi \ 23e41f4b71Sopenharmony_ci && apt-get install -y vim ssh locales \ 24e41f4b71Sopenharmony_ci && apt-get install -y doxygen \ 25e41f4b71Sopenharmony_ci && locale-gen "en_US.UTF-8" \ 26e41f4b71Sopenharmony_ci && rm -rf /bin/sh /usr/bin/python /usr/bin/python3 /usr/bin/python3m \ 27e41f4b71Sopenharmony_ci && ln -s /bin/bash /bin/sh \ 28e41f4b71Sopenharmony_ci && ln -s /usr/bin/python3.8 /usr/bin/python3 \ 29e41f4b71Sopenharmony_ci && ln -s /usr/bin/python3.8 /usr/bin/python3m \ 30e41f4b71Sopenharmony_ci && ln -s /usr/bin/python3.8 /usr/bin/python \ 31e41f4b71Sopenharmony_ci && curl https://gitee.com/oschina/repo/raw/fork_flow/repo-py3 > /usr/bin/repo \ 32e41f4b71Sopenharmony_ci && chmod +x /usr/bin/repo \ 33e41f4b71Sopenharmony_ci && pip3 install --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple requests setuptools pymongo kconfiglib pycryptodome ecdsa ohos-build pyyaml prompt_toolkit==1.0.14 redis json2html yagmail python-jenkins \ 34e41f4b71Sopenharmony_ci && pip3 install esdk-obs-python --trusted-host pypi.org \ 35e41f4b71Sopenharmony_ci && pip3 install six --upgrade --ignore-installed six \ 36e41f4b71Sopenharmony_ci && mkdir -p /home/tools \ 37e41f4b71Sopenharmony_ci && mkdir -p /home/tools/gn \ 38e41f4b71Sopenharmony_ci && wget -P /home/tools https://repo.huaweicloud.com/openharmony/compiler/clang/12.0.1-530132/linux/clang-530132-linux-x86_64.tar.bz2 \ 39e41f4b71Sopenharmony_ci && wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/hc-gen/0.65/linux/hc-gen-0.65-linux.tar \ 40e41f4b71Sopenharmony_ci && wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gcc_riscv32/7.3.0/linux/gcc_riscv32-linux-7.3.0.tar.gz \ 41e41f4b71Sopenharmony_ci && wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/ninja/1.9.0/linux/ninja.1.9.0.tar \ 42e41f4b71Sopenharmony_ci && wget -P /home/tools https://repo.huaweicloud.com/harmonyos/compiler/gn/1717/linux/gn-linux-x86-1717.tar.gz \ 43e41f4b71Sopenharmony_ci && wget -P /home/tools https://mirrors.huaweicloud.com/nodejs/v14.15.4/node-v14.15.4-linux-x64.tar.xz \ 44e41f4b71Sopenharmony_ci && wget -P /home/tools https://hm-verify.obs.cn-north-4.myhuaweicloud.com/qemu-5.2.0.tar.xz \ 45e41f4b71Sopenharmony_ci && tar -jxvf /home/tools/clang-530132-linux-x86_64.tar.bz2 -C /home/tools \ 46e41f4b71Sopenharmony_ci && mv /home/tools/clang-530132 /home/tools/llvm \ 47e41f4b71Sopenharmony_ci && tar -xvf /home/tools/hc-gen-0.65-linux.tar -C /home/tools \ 48e41f4b71Sopenharmony_ci && tar -xvf /home/tools/gcc_riscv32-linux-7.3.0.tar.gz -C /home/tools \ 49e41f4b71Sopenharmony_ci && tar -xvf /home/tools/ninja.1.9.0.tar -C /home/tools \ 50e41f4b71Sopenharmony_ci && tar -xvf /home/tools/gn-linux-x86-1717.tar.gz -C /home/tools/gn \ 51e41f4b71Sopenharmony_ci && tar -xJf /home/tools/node-v14.15.4-linux-x64.tar.xz -C /home/tools \ 52e41f4b71Sopenharmony_ci && cp /home/tools/node-v14.15.4-linux-x64/bin/node /usr/local/bin \ 53e41f4b71Sopenharmony_ci && ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm \ 54e41f4b71Sopenharmony_ci && ln -s /home/tools/node-v14.15.4-linux-x64/lib/node_modules/npm/bin/npx-cli.js /usr/local/bin/npx \ 55e41f4b71Sopenharmony_ci && tar -xJf /home/tools/qemu-5.2.0.tar.xz -C /home/tools \ 56e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/llvm/bin:$PATH' /root/.bashrc \ 57e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/hc-gen:$PATH' /root/.bashrc \ 58e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/gcc_riscv32/bin:$PATH' /root/.bashrc \ 59e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/ninja:$PATH' /root/.bashrc \ 60e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/node-v14.15.4-linux-x64/bin:$PATH' /root/.bashrc \ 61e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/home/tools/gn:$PATH' /root/.bashrc \ 62e41f4b71Sopenharmony_ci && sed -i '$aexport PATH=/root/.local/bin:$PATH' /root/.bashrc \ 63e41f4b71Sopenharmony_ci && export PATH=/home/tools/llvm/bin:$PATH \ 64e41f4b71Sopenharmony_ci && export PATH=/home/tools/hc-gen:$PATH \ 65e41f4b71Sopenharmony_ci && export PATH=/home/tools/gcc_riscv32/bin:$PATH \ 66e41f4b71Sopenharmony_ci && export PATH=/home/tools/ninja:$PATH \ 67e41f4b71Sopenharmony_ci && export PATH=/home/tools/node-v12.20.0-linux-x64/bin:$PATH \ 68e41f4b71Sopenharmony_ci && export PATH=/home/tools/gn:$PATH \ 69e41f4b71Sopenharmony_ci && export PATH=/root/.local/bin:$PATH \ 70e41f4b71Sopenharmony_ci && cd /home/tools/qemu-5.2.0 \ 71e41f4b71Sopenharmony_ci && mkdir build \ 72e41f4b71Sopenharmony_ci && cd build \ 73e41f4b71Sopenharmony_ci && ../configure --target-list=arm-softmmu \ 74e41f4b71Sopenharmony_ci && make -j \ 75e41f4b71Sopenharmony_ci && make install \ 76e41f4b71Sopenharmony_ci && cd /home/openharmony \ 77e41f4b71Sopenharmony_ci && rm -rf /home/tools/*.tar \ 78e41f4b71Sopenharmony_ci && rm -rf /home/tools/*.gz \ 79e41f4b71Sopenharmony_ci && rm -rf /home/tools/*.xz \ 80e41f4b71Sopenharmony_ci && rm -rf /home/tools/qemu-5.2.0 \ 81e41f4b71Sopenharmony_ci && npm install -g @ohos/hpm-cli --registry https://mirrors.huaweicloud.com/repository/npm/ 82e41f4b71Sopenharmony_ci 83e41f4b71Sopenharmony_ciENV LANG=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_ALL=en_US.UTF-8 84