博客文章 移至這裏:http://www.cnso.org/2017/11/21/86.html
在收集Chromium源碼相關資料的時候參考的一些比較有價值的文章和連接,均給出了來源,在自己下載並編譯源碼的時候給了很大的幫助,在這裏給大家列出來,希望其他研究改源碼的同行少走彎路。
源碼版本地址:https://src.chromium.org/svn/releases/
源碼編譯參考:http://blog.csdn.net/skyremember/article/details/3123044
參考一:
文章來源:http://blog.csdn.net/hezhipin610039/article/details/31372619
下載Chromium源碼方法及問題記錄
系統:win7 64bit or ubuntu
官方網址:http://www.chromium.org/developers/how-tos/build-instructions-windows
1、下載depot_tools:
a) windows
地址:https://src.chromium.org/svn/trunk/tools/depot_tools.zip
b) ubuntu
首先安裝git-core:sudo apt-get install git-core
執行命令:git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
2、更新depot_tools環境變量
a) windows
解壓depot_tools.zip, 將depot_tools的路徑(如d:\depot_tools)加入PATH環境變量。
b) ubuntu
vim ~/.bashrc文件,在最後一行加入:export PATH="$PATH:your_depot_tools_dir/depot_tools",
然後保存並運行命令:source ~/.bashrc
3、配置源碼分支版本
cd進入自定義的源碼目錄,執行gclient config http://src.chromium.org/svn/releases/31.0.1620.2
31.0.1620.2 爲版本號,可根據需要下載相應版本,chromium各版本:http://src.chromium.org/viewvc/chrome/releases/
如果不需要check out LayoutTest測試文件,可以打開以版本名稱命名(如31.0.1620.2)的目錄下的DEPS文件,找到下面這行並修改爲:
"src/third_party/WebKit/LayoutTests": None,
4、 第一次執行gclient時會自動安裝git、Python等,等待其安裝完畢。
中間可能會出現連接錯誤,如:Failed connect to chromium.googlesource.com:443
可考慮如下做法:
a)將以下內容複製到C:\Windows\System32\drivers\etc\hosts文件中
74.125.31.82 www.googlesource.com
74.125.31.82 Android.googlesource.com
203.208.46.172 cache.pack.google.com
59.24.3.173 cache.pack.google.com
b)在.gclient文件中的"custom_deps" 節點下加入:
"custom_deps" : {"https://chromium.googlesource.com/chromium/tools":None},
5、執行gclient sync --force,則開始同步代碼。
如若下載過程中出現問題,重新執行此命令。
若在下載源碼過程中出現下載toolchain_win_x86.tar.bz2等文件失敗時,可以考慮如下做法:
a) 用瀏覽器將這些文件下載到本地(可能url會被牆,需要結合goagent與chrome,具體配置goagent的方法見《Linux下配置Goagent》)
b) 在本地搭建tomcat服務器,搭建一個可供本地連接並下載的web服務器。
c) 分別爲每個文件配置目錄,最終url的形式如:http://127.0.0.1/x86_toolchain/r12034/toolchain_win_x86.tar.bz2
d) 修改D:\chromium-src\src\native_client\build\toolchainbinaries.py文件:BASE_DOWNLOAD_URL = ('http://127.0.0.1:8080')
然後重新執行gclient sync --force即可。
問題記錄:
1. 如果在下載源碼過程中,遇到jsoncpp相關的錯誤,如:Error: Command svn update /home/nightelf/chromium/chromium_28/src/third_party/jsoncpp/source/include。
是由於jsoncpp更改了它的 soure location,所以你需要修改以版本爲名稱(如31.0.1620.2)的目錄下的 DEPS 文件,更新jsoncpp的地址。
修改DESP文件中的'jsoncpp':
'http://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp',
將其修改爲:'https://svn.code.sf.net/p/jsoncpp/code',再重新gclient sync --force即可。
參考二:文章來源:http://blog.sina.com.cn/s/blog_797ca61d0100vc0q.html
一、準備工作