Skip to content

Commit 2e9928d

Browse files
committed
Create patch for CEF (cztomczak#231) and update build instructions and automate.py
1 parent 8a61ffe commit 2e9928d

File tree

13 files changed

+348
-87
lines changed

13 files changed

+348
-87
lines changed

docs/Build-instructions.md

Lines changed: 103 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ listed on this page.
1818

1919

2020
Table of contents:
21+
* [Build CEF Python 51 BETA](#build-cef-python-51-beta)
2122
* [Requirements](#requirements)
2223
* [Build CEF Python using prebuilt CEF binaries](#build-cef-python-using-prebuilt-cef-binaries)
2324
* [Build both CEF Python and CEF from sources](#build-both-cef-python-and-cef-from-sources)
@@ -28,38 +29,55 @@ Table of contents:
2829

2930
## Build CEF Python 51 BETA
3031

31-
1. Works fine on Ubuntu 14.04 64-bit (cmake 2.8.12 and g++ 4.8.4)
32-
2. Download 64-bit Linux standard distribution from Spotify builds:
32+
Complete steps for building CEF Python 51 using prebuilt
33+
binaries from Spotify Automated Builds.
34+
35+
1) Tested and works fine on Ubuntu 14.04 64-bit (cmake 2.8.12 and g++ 4.8.4)
36+
37+
2) Download 64-bit Linux standard distribution from Spotify builds:
3338
http://opensource.spotify.com/cefbuilds/index.html
34-
* As of writing the proper file is:
35-
"cef_binary_3.2704.1432.g60b3718_linux64.tar.bz2"
36-
* Check CEF version in "cefpython/src/version/cef_version_linux.h"
37-
to make sure you're downloading the right file
38-
3. Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
39+
40+
* As of writing the proper file is:
41+
"cef_binary_3.2704.1432.g60b3718_linux64.tar.bz2"
42+
* Check CEF version in "cefpython/src/version/cef_version_linux.h"
43+
to make sure you're downloading the right file
44+
45+
3) Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
3946
and copy it to /usr/bin and chmod 755.
40-
4. Install packages: `sudo apt-get install python-dev cmake g++`
41-
5. Create projects to build:
47+
48+
4) Install packages: `sudo apt-get install python-dev cmake g++`
49+
50+
5) Configure projects in the build/ directory:
4251
```
4352
cd cef_binary/
4453
mkdir build
4554
cd build/
4655
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..
4756
```
48-
6. To build type: `ninja libcef_dll_wrapper`. You may also build cefclient
49-
by typing `nincja cefclient`, but this will require installing
50-
additional packages, read Requirements further on this page.
51-
7. Copy "cef_binary/Resources/*" to "cefpython/src/linux/binaries_64bit/"
52-
8. Copy "cef_binary/Release/*" to "cefpython/src/linux/binaries_64bit/"
53-
9. Copy "cef_binary/build/libcef_dll_wrapper/*"
57+
58+
6) To build type: `ninja libcef_dll_wrapper`.
59+
60+
You may also build cefclient by typing `nincja cefclient`, but
61+
this will require installing additional packages - see Requirements
62+
further down on this page.
63+
64+
7) Copy "cef_binary/Resources/*" to "cefpython/src/linux/binaries_64bit/"
65+
66+
8) Copy "cef_binary/Release/*" to "cefpython/src/linux/binaries_64bit/"
67+
68+
9) Copy "cef_binary/build/libcef_dll_wrapper/*"
5469
to "cefpython/src/linux/setup/lib_64bit/" (create dir)
55-
10. Temporary fix for Isue #231 - copy icudtl.dat and natives_blob.bin
70+
71+
10) Temporary fix for Isue #231 - copy icudtl.dat and natives_blob.bin
5672
to /usr/bin (where the python executable resides)
57-
11. Build cefpython:
73+
74+
11) Build cefpython:
5875
```
5976
cd cefpython/src/linux/
6077
python compile.py 51.0
6178
```
62-
12. As of writing only "pygtk_.py" and "kivy_.py" examples work.
79+
80+
12) As of writing only "pygtk_.py" and "kivy_.py" examples work.
6381

6482

6583
## Requirements
@@ -94,24 +112,27 @@ __Windows__
94112
__Linux__
95113

96114
* Install packages: `sudo apt-get install python-dev cmake g++`
97-
* To build upstream cefclient/cefsimple you need to install these packages:
98-
`sudo apt-get install libgtk2.0-dev libgtkglext1-dev`
99115
* If building CEF from sources:
100116
* Official binaries are built on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4)
101117
* Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
102118
and copy it to /usr/bin and chmod 755.
103-
* Install required packages using one of the methods below:
104-
1. See Linux configuration for CEF automated
105-
builds on the [cef/AutomatedBuildSetup.md](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
106-
wiki page.
107-
2. Run the install-build-deps.sh script - instructions provided
108-
further down on this page.
109-
* To build on Debian 7 see
110-
[cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and
111-
[cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575),
112-
and [cef/#1697](https://bitbucket.org/chromiumembedded/cef/issues/1697)
113-
* To perform a 32-bit Linux build on a 64-bit Linux system see
114-
[cef/#1804](https://bitbucket.org/chromiumembedded/cef/issues/1804)
119+
* Install required packages using one of the three methods below:
120+
1. Type command: `sudo apt-get install bison build-essential cdbs curl devscripts dpkg-dev elfutils fakeroot flex g++ git-core git-svn gperf libapache2-mod-php5 libasound2-dev libav-tools libbrlapi-dev libbz2-dev libcairo2-dev libcap-dev libcups2-dev libcurl4-gnutls-dev libdrm-dev libelf-dev libexif-dev libffi-dev libgconf2-dev libgl1-mesa-dev libglib2.0-dev libglu1-mesa-dev libgnome-keyring-dev libgtk2.0-dev libkrb5-dev libnspr4-dev libnss3-dev libpam0g-dev libpci-dev libpulse-dev libsctp-dev libspeechd-dev libsqlite3-dev libssl-dev libudev-dev libwww-perl libxslt1-dev libxss-dev libxt-dev libxtst-dev mesa-common-dev openbox patch perl php5-cgi pkg-config python python-cherrypy3 python-crypto python-dev python-psutil python-numpy python-opencv python-openssl python-yaml rpm ruby subversion ttf-dejavu-core ttf-indic-fonts ttf-kochi-gothic ttf-kochi-mincho fonts-thai-tlwg wdiff zip`
121+
2. See the list of packages on the
122+
[cef/AutomatedBuildSetup.md](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
123+
wiki page.
124+
2. Run the install-build-deps.sh script -
125+
instructions provided further down on this page.
126+
* To build on Debian 7 see
127+
[cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and
128+
[cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575),
129+
and [cef/#1697](https://bitbucket.org/chromiumembedded/cef/issues/1697)
130+
* To perform a 32-bit Linux build on a 64-bit Linux system see
131+
Linux configuration in upstream cef/AutomatedBuildSetup.md. See also
132+
[cef/#1804](https://bitbucket.org/chromiumembedded/cef/issues/1804).
133+
* If using prebuilt binaries from Spotify automated builds and want to
134+
build cefclient/cefsimple you need to install these packages:
135+
`sudo apt-get install libgtk2.0-dev libgtkglext1-dev`
115136

116137

117138
__All platforms__
@@ -124,15 +145,16 @@ __All platforms__
124145

125146
## Build CEF Python using prebuilt CEF binaries
126147

148+
__NOT WORKING YET__
149+
127150
Prebuilt binaries are available on
128151
[GitHub Releases](https://github.com/cztomczak/cefpython/releases)
129-
and tagged eg. 'v47-upstream'.
152+
and tagged eg. 'v51-upstream'.
130153

131154
Run the automate.py tool using the --prebuilt-cef flag that will download
132155
prebuilt binaries from GitHub Releases using version information from
133-
src/version/.
156+
the "src/version/" directory.
134157

135-
__NOTE__: The --prebuilt-cef flag is not implemented yet.
136158
```
137159
cd tools/
138160
python automate.py --prebuilt-cef
@@ -144,32 +166,49 @@ need to customize the build then use the --help flag to see more.
144166

145167
## Build both CEF Python and CEF from sources
146168

147-
Run the automate.py tool using the --build-cef flag. Specify cef branch
148-
and optionally how many parallel ninja jobs to run (by default cores/2).
149-
If building on Linux see the Important note futher down.
169+
Run the automate.py tool using the --build-cef flag. You can optionally
170+
set how many parallel ninja jobs to run (by default cores/2) with
171+
the --ninja-jobs flag.
172+
173+
The automate script will use version information from the "src/version/"
174+
directory. If you would like to use a custom CEF branch then you can
175+
use the --cef-branch flag - but note that this is only for advanced
176+
users as this will require updating cefpython's C++/Cython code.
177+
178+
If building on Linux and there are errors, see the MISSING PACKAGES
179+
note futher down.
180+
181+
You should be fine by running automate.py with the default options, but if you
182+
need to customize the build then use the --help flag to see more.
150183

151184
```
152-
cd tools/
153-
python automate.py --build-cef --cef-branch 2526 --ninja-jobs 6
185+
cd ~/cefpython/
186+
mkdir build/ && cd build
187+
python ../tools/automate.py --build-cef --ninja-jobs 6
188+
cd cef*_*_linux64/
189+
cp bin/* ../../../src/linux/binaries_64bit/
190+
mkdir ../../../src/linux/setup/lib_64bit/
191+
cp lib/* ../../../src/linux/setup/lib_64bit/
192+
cd ../../../src/linux/
193+
python compile.py 51.0
154194
```
155195

156-
__IMPORTANT NOTE (Linux)__: On Linux it will fail on first run. After the chromium
157-
sources are downloaded, it will try to build cef projects and fail
158-
due to missing packages. You will need to run the install-build-deps.sh
159-
script (intended for Ubuntu systems). When the "ttf-mscorefonts-installer"
196+
__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,
197+
it will try to build cef projects and if it fails due to missing packages
198+
make sure you've installed all the required packages listed in the
199+
Requirements section further up on this page. If it still fails, you
200+
can fix it by running the install-build-deps.sh script (intended for
201+
Ubuntu systems, but you could edit it). When the "ttf-mscorefonts-installer"
160202
graphical installer pops up don't install it - deny EULA.
161203

162204
```
163205
cd build/chromium/src/build/
164206
chmod 755 install-build-deps.sh
165-
sudo ./install-build-deps.sh --no-arm --no-chromeos-fonts --no-nacl
207+
sudo ./install-build-deps.sh --no-lib32 --no-arm --no-chromeos-fonts --no-nacl
166208
```
167209

168210
After dependencies are satisifed re-run automate.py.
169211

170-
You should be fine by running automate.py with the default options, but if you
171-
need to customize the build then use the --help flag to see more.
172-
173212

174213
## Build CEF manually
175214

@@ -195,19 +234,30 @@ directory, not in the "download_dir/cef/" directory.
195234

196235
There are two sites that provide latest builds of CEF:
197236
* Spotify - http://opensource.spotify.com/cefbuilds/index.html
198-
* This is a new build system
199-
* Since 07/06/2016 all builds are without tcmalloc, see
237+
* This is the new build system
238+
* Since June 2016 all builds are without tcmalloc, see
200239
[cefpython/#73](https://github.com/cztomczak/cefpython/issues/73)
201240
and [cef/#1827](https://bitbucket.org/chromiumembedded/cef/issues/1827)
202241
* Adobe - https://cefbuilds.com/
203-
* This is an old build system. It probably still builds with tcmalloc
204-
(see above)
242+
* This is the old build system. Not tested whether it builds without
243+
tcmalloc.
244+
245+
To build the "libcef_dll_wrapper" library type these commands:
246+
```
247+
cd cef_binary/
248+
mkdir build
249+
cd build/
250+
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release ..
251+
ninja libcef_dll_wrapper
252+
```
253+
254+
To build CEF sample applications type `ninja cefclient cefsimple`.
205255

206256
Official CEF Python binaries come with additional patches to CEF/Chromium,
207257
see the [patches/](../../../tree/master/patches) directory. Whether you
208258
need these patches depends on your use case, they may not be required
209259
and thus you could use the Spotify binaries. Spotify builds have the
210-
issue73 patch (tcmalloc) applied.
260+
issue73 patch (no tcmalloc) applied.
211261

212262

213263
## How to patch

patches/issue125.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
diff --git http_cache_transaction.cc http_cache_transaction.cc
2-
index 9dd8458..e61f1f0 100644
2+
index 178df98..85dc6d1 100644
33
--- http_cache_transaction.cc
44
+++ http_cache_transaction.cc
5-
@@ -2661,7 +2661,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
5+
@@ -2489,7 +2489,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
66
// blocking page is shown. An alternative would be to reverse-map the cert
77
// status to a net error and replay the net error.
88
if ((response_.headers->HasHeaderValue("cache-control", "no-store")) ||

patches/issue218_linux

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)