Windows 上的 WebKit

本指南提供了在 Windows 8.1 上构建 WebKit 的说明。

安装开发工具

首先安装以下程序并设置您的环境

  1. Visual Studio。(确保包含 C++ 支持。)https://www.visualstudio.com/en-us/products/visual-studio-community-vs
  2. ActiveState Perl。64 位版本即可。http://www.activestate.com/activeperl/downloads
  3. ActiveState Python 3.x。64 位版本即可。http://www.activestate.com/activepython/downloads。有人建议从 https://pythonlang.cn/downloads/windows/ 下载 Python 3.x 会更成功。
  4. Ruby。64 位版本即可。https://rubyinstaller.ruby-lang.org.cn/
  5. Gperf。http://gnuwin32.sourceforge.net/packages/gperf.htm
  6. CMake。https://cmake.com.cn/download/
  7. Git。http://www.git-scm.com/download/win 注意:请确保选择“Use Git from the Windows Command Prompt”(在 Windows 命令行中使用 Git)选项。这是因为这会将 sh.exe 安装到您的路径中,如果 sh.exe 的位置包含空格,Make 可能会出现问题。当我安装时,我取消选中了所有选项。
  8. 用于测试的“Ahem”字体。http://www.w3.org/Style/CSS/Test/Fonts/Ahem/
  9. (可选:加速构建过程) Ninja Build。https://github.com/ninja-build/ninja/releases

确保您刚刚安装的所有程序(Visual Studio 除外)都可以通过您的 $PATH 访问 http://www.itechtics.com/customize-windows-environment-variables/。修改 $PATH 后,您可能需要重启才能让新的 shell 看到更新后的变量。

如果您在代理服务器后方,请务必设置 HTTP_PROXYHTTPS_PROXY 环境变量。

设置 Git 仓库

告诉 Git 您的姓名。

> git config --global user.name "John Smith"

告诉 Git 您的电子邮件地址。

> git config --global user.email "johnsmith@example.com"

下载仓库的克隆。

> git clone <git://git.webkit.org/WebKit.git>
> cd WebKit

构建 WebKit

> perl Tools/Scripts/build-webkit