构建步骤(Linux)
至少 25GB 硬盘空间 和 8GB 内存.
Node.js. 有多种方法安装 Node.js。 您可以从 下载源代码并进行编译。 也可以作为一个标准的用户在 home 目录下安装 node. 或者尝试使用 NodeSource 仓库
3.4 或更高版本。
在 Ubuntu, 安装下面的库:
$ sudo apt-get install build-essential clang libdbus-1-dev libgtk-3-dev \
libnotify-dev libgnome-keyring-dev \
libasound2-dev libcap-dev libcups2-dev libxtst-dev \
libxss1 libnss3-dev gcc-multilib g++-multilib curl \
gperf bison python-dbusmock openjdk-8-jre
在 RHEL / CentOS, 安装下面的库:
$ sudo yum install clang dbus-devel gtk3-devel libnotify-devel \
cups-devel libXtst-devel alsa-lib-devel libXrandr-devel \
nss-devel python-dbusmock openjdk-8-jre
在 Fedora, 安装下面的库:
On Arch Linux / Manjaro, install the following libraries:
libgnome-keyring alsa-lib libcap libcups libxtst \
libxss nss gcc-multilib curl gperf bison \
python2 python-dbusmock jdk8-openjdk
Other distributions may offer similar packages for installation via package managers such as pacman. Or one can compile from source code.
如果想创建一个 arm
target ,应当还要下载下面的依赖:
$ sudo apt-get install libc6-dev-armhf-cross linux-libc-dev-armhf-cross \
g++-arm-linux-gnueabihf
并为 arm
或 ia32
目标交叉编译 您应该将 target_cpu
参数传递给 gn gen
:
$ gn gen out/Testing --args='import(...) target_cpu="arm"'
Prebuilt will try to link to libtinfo.so.5
. Depending on the host architecture, symlink to appropriate libncurses
:
The default building configuration is targeted for major desktop Linux distributions. To build for a specific distribution or device, the following information may help you.
默认情况下, Electron 是由 Chromium 项目提供的预生成的 二进制文件构建的。 如果出于某些原因你想用你系统已安装的 clang
来构建,你可以在GN的参数中指定clang_base_path
例如如果你的 clang
安装在 /usr/local/bin/clang
下: