| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Instructions on this page are for the old cefpython31 branch. New instructions for newer branches / master are at docs/Build-instructions.md.
The original instructions on building Chromium/CEF can be found on the CEF project Branches and Building wiki page.
Table of contents:
(link seems no more relevant, as Chrome now officially uses VS 2013, but CEF Python probably still requires VS 2010 as it uses an older version of Chrome)
http://www.chromium.org/developers/how-tos/build-instructions-windows#TOC-Build-environment
You have to install Visual Studio 2010 with Service Packs and x64 compiler tools, Windows SDK and DirectX SDK. Do not install the Cygwin.
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
If you do not have git installed download and extract depot_tools from here:
https://src.chromium.org/svn/trunk/tools/depot_tools.zip
Add depot_tools directory to your system PATH (Advanced System Settings > Environment Variables > System variables > PATH).
Run the gclient once command:
gclient once
This will install git, svn and python to the depot_tools directory.
python --version
It should display "Python 2.6.2".
For CEF 1: ../blob/master/cefpython/cef1/BUILD_COMPATIBILITY.txt
For CEF 3: ../blob/master/src/BUILD_COMPATIBILITY.txt
Later we will need the "Chromium release url" and and the "CEF repository url" so keep it in sight.
mkdir chromium
cd chromium/
gclient config {Chromium release url}
"custom_deps": {
"src/content/test/data/layout_tests/LayoutTests": None,
"src/chrome/tools/test/reference_build/chrome_win": None,
"src/chrome_frame/tools/test/reference_build/chrome_win": None,
"src/chrome/tools/test/reference_build/chrome_linux": None,
"src/chrome/tools/test/reference_build/chrome_mac": None,
"src/third_party/hunspell_dictionaries": None,
},
This excludes some directories that contain lots of data (many many gigabytes) that would extend the time significantly when synchronizing Chromium sources with the revision we've selected.
svn ls https://src.chromium.org/chrome
Download the Chromium sources by running the "gclient sync" command. The Chromium sources will be updated to the revision based on the release url we've configured earlier via "gclient config". Read also the "Possible issues" section below in case you encounter errors.
cd chromium/ gclient sync --jobs 8 --force
This can take a while and sometimes it can break with some errors when a download fails. In such case you should run the "gclient sync" command once again. One of the last messages in the console should be:
Updating projects from gyp files...
Download the CEF sources, the repository url can be found in the BUILD_COMPATIBILITY.txt file.
cd chromium/src/
svn checkout {CEF repository url} cef
This will download the CEF sources to the "cef" directory inside the Chromium "src" directory.
Run the "git clone" command for the CEF Python repository. This download can take hundreds of megabytes.
git clone https://github.com/cztomczak/cefpython
This is an optional fix. By default Chromium disables caching when there is certificate error. This patch will fix the HTTPS caching only when ApplicationSettings.ignore_certificate_errors is set to True. Official cefpython binaries have this fix applied, starting with the 31.0 release. See also Issue 125.
Apply the patch in the "~/chromium/src/" directory. Modifications are made in the HttpCache::Transaction::WriteResponseInfoToEntry function.
Index: net/http/http_cache_transaction.cc
===================================================================
--- http_cache_transaction.cc (revision 241641)
+++ http_cache_transaction.cc (working copy)
@@ -2240,7 +2240,8 @@
// reverse-map the cert status to a net error and replay the net error.
if ((cache_->mode() != RECORD &&
response_.headers->HasHeaderValue("cache-control", "no-store")) ||
- net::IsCertStatusError(response_.ssl_info.cert_status)) {
+ (!cache_->GetSession()->params().ignore_certificate_errors &&
+ net::IsCertStatusError(response_.ssl_info.cert_status))) {
DoneWritingToEntry(false);
ReportCacheActionFinish();
if (net_log_.IsLoggingAllEvents())
Set the "GYP_MSVS_VERSION" environment variable depending on version of Visual Studio you are using. For Visual Studio 2010 set it to "2010", for the Express edition set it to "2010e".
Generate the build files based on the GYP configuration by running the "cef_create_projects.bat" script.
cd chromium/src/cef/ cef_create_projects.bat
cd chromium/src/cef/ cef.sln
After it's built you can close the solution.
cd chromium/src/cef/tools/ make_distrib.bat --allow-partial
Go to the "chromium/src/cef/binary_distrib/cef_binary_xxxx_windows/" directory, for the next few steps we will be calling this directory the "cef_binary" directory.
Open the "cef_binary/cefclient2010.sln" solution, change the configuration to Release mode and build it.
Copy the "cef_binary/README.txt" file to the "src/windows/binaries_32bit/" directory.
Go to the "cef_binary/Release/" directory and copy the "libcef.lib" file to the "src/windows/setup/" directory.
Go to the "cef_binary/out/Release/" directory, copy the following files:
Copy them to the "src/windows/binaries_32bit/" directory.
If you already had any binaries in the "binaries_32bit/" directory from the previous build process then delete them first, but do not delete the visual c runtime dlls (msvcm90.dll, msvcp90.dll, msvcr90.dll).
It might be useful to copy also the debug symbols for the CEF library, so that you can debug the stack trace when there is an error in the CEF library. To copy the debug symbols go to the "chromium/src/cef/binary_distrib/cef_binary_3.1650.1646_windows32_release_symbols/" directory and copy the "libcef.dll.pdb" file to the "src/windows/binaries_32bit/" directory.
Install Visual Studio 2008 with Service Pack 1 or the Express edition which is free. Building Python is supported only on VS2008, thus the same requirement stands for Cython.
Install Windows SDK 7.0 to the default location.
GRMSDK_EN_DVD.iso - for Windows 32bit
GRMSDKX_EN_DVD.iso - for Windows 64bit
3. Download Cython 0.19.2 from PYPI. Later version are not supported by cefpython. Extract it and install:
python setup.py install
Build it. Go to the cef_binary/out/Release/lib/ directory and rename "libcef_dll_wrapper.lib" to "libcef_dll_wrapper_mt.lib". Copy it to the src/windows/setup/lib_32bit/ directory.
2b. Change the properties of the "libcef_dll_wrapper" project:
Build it. After it's built, go to the "cef_binary/out/Release/lib/" directory. Rename "libcef_dll_wrapper.lib" to "libcef_dll_wrapper_md.lib" and copy it to the "src/windows/setup/lib_32bit/" directory.
Go to the "src/windows/" directory.
There is one thing to do before building. An up-to-date "cefpython.h" file needs to be generated, signatures of the Cython public functions are there. To generate this file you need to run the compile.bat script and ignore any errors you see. When asked whether to continue press "y" (yes). The compile.bat script expects first argument to be release version number:
compile.bat 31.2
After cefpython.h was generated run the compile.bat script once again.
If everything went fine then the "cefpython_py27.pyd" (or py34.pyd) module should be created in the "src/windows/binaries_32bit/" directory and the "wxpython.py" example should be launched automatically.
The compile.bat script also accepts additional flags that can be passed after the version argument:
To be able to build the inno setup installer you have to install Inno Setup 5. It should be installed to the deafault location "c:\Program Files (x86)\Inno Setup 5\ISCC.exe", otherwise you will have to edit the "make-installer.py" script and change the path. To disable creation of inno setup installer package pass the "--disable-inno-setup" flag after the version number argument.
You will also need the pip package manager, please see here on how to install it on Windows. It needs to be a recent version of pip, so that Python Wheels are supported. The build_all.bat script will install some dependencies (setuptools, wheel) if they are missing. If you have some old versions of pip/setuptools/wheel installed, then you need to upgrade them by typing these commands:
pip install --upgrade pip
pip install --upgrade setuptools
pip install --upgrade wheel
To create multiple packages run the build_all.bat script. The first argument is a version number. There are also optional flags that you can pass after the version argument: --disable-inno-setup, --py27-32bit, --py27-64bit, --py34-32bit, --py34-64bit.
cd src/windows/installer/
build_all.bat win32 31.2
If everything went fine then you should see multiple distributions created in the dist/ directory.
| Back | FazBrowse Home | New Git URL |