同步操作将从 OpenHarmony/docs 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Setting up a Ubuntu Build Environment Using a Docker Environment
Setting up a Ubuntu Build Environment Using an Installation Package
You can use either the Docker environment or installation package provided by OpenHarmony to set up a Ubuntu build environment. This section describes the two methods.
The standard OpenHarmony system provides a Docker environment which encapsulates build tools. To use the Docker environment, perform the following steps:
For details, see Source Code Acquisition.
For details, see Installing and Using Docker.
The procedure is as follows:
For details, see Source Code Acquisition.
The installation command is as follows:
sudo apt-get install binutils git-core git-lfs gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip m4 python2.7 python-minimal
Go to the OpenHarmony working directory.
cd OpenHarmony
Download the script.
curl https://gitee.com/landwind/script-tools/raw/master/Shell/OpenHarmony/OpenHarmony_2.0_canary_prebuilts_download.sh >./prebuilts_download.sh
Download and decompress the prebuilts package in a specified directory.
bash ./prebuilts_download.sh
By default, binary files are stored in the OpenHarmony_2.0_canary_prebuilts directory, which is in the same directory as OpenHarmony. To change the storage path, change the value of bin_dir in prebuilts_download.sh.
Return to the previous directory.
cd -
To build the JS framework, you need to download and configure Node.js on a Linux server. The procedure is as follows:
Download Node.js on a Linux server.
mkdir -p OpenHarmony/prebuilts/build-tools/common/nodejs # Create the nodejs directory.
cd OpenHarmony/prebuilts/build-tools/common/nodejs # Go to the nodejs directory.
wget --no-check-certificate https://nodejs.org/download/release/v12.18.4/node-v12.18.4-linux-x64.tar.gz # Download the Node.js package.
Decompress the Node.js package and configure the Node.js environment.
tar -zxvf node-v12.18.4-linux-x64.tar.gz # Decompress the Node.js package.
echo "export PATH=`pwd`/node-v12.18.4-linux-x64/bin:${PATH}" >> ~/.bashrc;source ~/.bashrc # Set a Node.js environment variable.
cd - # Return to the previous directory.
Go to the third_party/jsframework directory of the OpenHarmony code and download the node_modules package.
cd OpenHarmony/third_party/jsframework # Go to the jsframework directory.
npm install # Download the node_modules package.
cd - # Return to the previous directory.
Store the node_modules package in the prebuilts/build-tools/common/js-framework directory of the OpenHarmony code.
mkdir -p OpenHarmony/prebuilts/build-tools/common/js-framework # Create the js-framework directory.
cp -rp OpenHarmony/third_party/jsframework/node_modules OpenHarmony/prebuilts/build-tools/common/js-framework/
hc-gen is used to compile the driver. To install hc-gen, perform the following steps:
Start a Linux server.
Download hc-gen.
Decompress the hc-gen installation package to ~/hc-gen on the Linux server.
tar -xvf hc-gen-0.65-linux.tar -C ~/
Set an environment variable.
vim ~/.bashrc
Copy the following command to the last line of the .bashrc file, save the file, and exit.
export PATH=~/hc-gen:$PATH
Validate the environment variable.
source ~/.bashrc
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。