Windows下获取Chromium源码
来源:互联网 发布:matlab矩阵乘法运算 编辑:程序博客网 时间:2024/06/05 04:42
先配置好ShadowSocks和depot_tools
配置GIT
#用户名
git config --global user.name
"Your Name"
#邮箱
git config --global user.email
"your-name@your-mail.domain"
#自动CRLF
git config --global core.autocrlf
false
#文件模式
git config --global core.filemode
false
#自动大写
git config --global branch.autosetuprebase always
#设置代理
git config --global http.proxy socks5:
//127
.0.0.1:1080
git config --global https.proxy socks5:
//127
.0.0.1:1080
设置环境变量,这里包括了VS,NINJA,BOTO和depot_tools的环境变量
#设置只使用本地Visual Studio
DEPOT_TOOLS_WIN_TOOLCHAIN = 0
#设置编译选项
GYP_DEFINES = branding=Chromium buildtype=Official target_arch=x64 disable_nacl=1 windows_sdk_path=
"C:\Program Files (x86)\Windows Kits\8.1"
# 这是编译Release版本的,如果需要Debug版本则
# GYP_DEFINES = component=shared_library target_arch=x64 disable_nacl=1 windows_sdk_path="C:\Program Files (x86)\Windows Kits\8.1"
# 如果需要编译Chrome 则需要登录Google员工账号并设置为
# GYP_DEFINES = branding=Chrome buildtype=Official target_arch=x64 disable_nacl=1 windows_sdk_path="C:\Program Files (x86)\Windows Kits\8.1"
#设置ninja编译器
GYP_GENERATORS = msvs-ninja,ninja
#设置VS版本
GYP_MSVS_VERSION = 2015
#设置代理
NO_AUTH_BOTO_CONFIG = D:\WebKit\boto.cfg
#路径环境变量,必须将depot_tools设置在所有已安装的python和git安装目录之前。
#这样的话调用git和python会优先采用depot_tools里的git.bat和python.bat
#如果需要调用已安装的版本,使用git.exe和python.exe即可
Path = %Path%;D:\WebKit\depot_tools;D:\Python36\;D:\Python36\Scripts\
然后打开CMD窗口并执行
D:
cd
WebKit
mkdir
Chromium
cd
Chromium
set
https_proxy=https:
//127
.0.0.1:1080
set
http_proxy=http:
//127
.0.0.1:1080
set
socks5_proxy=socks5:
//127
.0.0.1:1080
set
NO_AUTH_BOTO_CONFIG=D:\WebKit\boto.cfg
D:\WebKit\boto.cfg
内容为
[Boto]
proxy = 127.0.0.1
proxy_port = 1080
在D:\WebKit\Chromium
执行
gclient root
然后,本该在D:\WebKit\Chromium
执行
gclient config --spec 'solutions = [
{
"url"
:
"https://chromium.googlesource.com/chromium/src.git"
,
"managed"
: False,
"name"
:
"src"
,
"deps_file"
:
".DEPS.git"
,
"custom_deps"
: {},
},
]
target_os = [
"win"
]
target_os_only = True
'
但这样会出现问题
因为该命令本该由fetch命令自动执行但此处使用了--dry-run
指令显示出来并手动一步步执行
所以在D:\WebKit\Chromium
手动创建文件D:\WebKit\Chromium\.gclient
内容为
solutions = [
{
"url"
:
"https://chromium.googlesource.com/chromium/src.git"
,
"managed"
: False,
"name"
:
"src"
,
"deps_file"
:
".DEPS.git"
,
"custom_deps"
: {},
},
]
target_os = [
"win"
]
target_os_only = True
开始下载代码,sync
可能需要数个小时
可以使用--jobs
设置线程数
比如gclient sync --nohooks --no-history --jobs 16
如果下载出错或中断,则继续使用sync即可,可以执行多次来保证下载成功
gclient
sync
--nohooks --no-
history
cd
D:\WebKit\Chromium\src
git submodule foreach
'git config -f $toplevel/.git/config submodule.$name.ignore all'
git config --add remote.origin.fetch
'+refs/tags/*:refs/tags/*'
git config
diff
.ignoreSubmodules all
在经历6小时(200KB/s)左右的主分支下载
接下来就需要获取tags了
加了--no-history
和--nohooks
后源码的下载大概耗时2-16小时
本人的服务器只有2M所以下载了6小时
接下来需要获取tags来切换到稳定版分支
tags的获取也需要2-16小时
当然,也可以下载指定的tags,但这里不做说明了
之前下载主分支sync的时候如果遇到错误和中断可以断点续传
但tags就必须保证一次性下载完毕了,否则就要重新下载了。
git fetch --tags
git checkout -b 新建的本地分支名称 你需要的版本号
删除D:\WebKit\Chromium\src
目录下除.git
目录以外的所有文件夹
和文件
这样删除是为了防止出现Reference is not a tree
为了防止出错,建议将这些文件从原处剪切到D:\WebKit\Chromium\backup
文件夹
然后执行下面的命令,也需要数个小时
git reset --hard 你刚刚新建的本地分支名字
gclient
sync
--with_branch_heads --jobs 16
执行完毕后,代码就获取完了
至于runhooks
,因为第一次执行的代码要删除所以才加了--nohooks
但这里没有加,所以应该是自己执行了的
如果没有执行,那就再执行一次gclient runhooks
然后编译
- Windows下获取Chromium源码
- windows chromium源码获取和编译
- windows 7 下 chromium 代码获取过程
- Windows下编译Chromium
- 如何获取chromium的源码
- windows下获取Android源码
- ubuntu下chromium代码获取
- 在Windows下学习chromium
- 在windows下编译chromium
- Windows下vs2015编译Chromium
- Chromium for android 1 源码获取
- 如何快速获取Chromium源码和编译
- Windows下获取Android 源码方法
- Windows环境下,Msysgit获取Android源码
- windows下配置android源码获取环境
- windows下配置android源码获取环境
- Windows下获取Android系统源码
- windows下使用Git获取Android源码
- 让自己膨胀扩张是世界万物的本性
- OSG学习笔记2:地形构建和模型加载
- 如何解决桌面全部是缩略图?
- OpenGL环境配置
- 史上最全Android Studio的快捷键
- Windows下获取Chromium源码
- Git学习笔记 Windows使用TortoiseGit从安装到上传第一个项目
- Android开发笔记: Android Studio设置app全屏
- 多线程基础学习四:线程间的通信
- request,response (转发和重定向之间的比较)
- js判断访问者操作系统
- 【python】NLTK-01-入门
- 宏(#define)、枚举(enum)、常变量(const)
- 每个程序员都该知道的五大定理