Skip to content

Commit 3681c59

Browse files
committed
Update to Chromium v56 on Linux (cztomczak#276)...
Update build instructions for Linux. Requirements changed, install-build-deps command changed, there is one error during build and a solution for that problem was added. Update patches. Minor fixes to automate.py.
1 parent 94f2c05 commit 3681c59

File tree

5 files changed

+81
-37
lines changed

5 files changed

+81
-37
lines changed

docs/Build-instructions.md

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Table of contents:
1212
* [Build using prebuilt CEF binaries and libraries](#build-using-prebuilt-cef-binaries-and-libraries)
1313
* [Build using CEF binaries from Spotify Automated Builds](#build-using-cef-binaries-from-spotify-automated-builds)
1414
* [Build upstream CEF from sources](#build-upstream-cef-from-sources)
15+
* [Possible errors](#possible-errors)
1516
* [Build CEF manually](#build-cef-manually)
1617
* [CEF Automated Builds (Spotify and Adobe)](#cef-automated-builds-spotify-and-adobe)
1718
* [Notes](#notes)
@@ -191,8 +192,9 @@ requirements common for all platforms.
191192
* Official binaries are built on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4)
192193
* Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
193194
and copy it to /usr/bin and chmod 755.
194-
* Install required packages using one of the three methods below:
195-
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`
195+
* Install/upgrade required packages using one of the three methods below
196+
(these packages should be upgraded each time you update to newer CEF):
197+
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 wget zip`
196198
2. See the list of packages on the
197199
[cef/AutomatedBuildSetup.md](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
198200
wiki page.
@@ -298,13 +300,16 @@ a custom CEF branch
298300
then use the --cef-branch flag, but note that this is only for advanced
299301
users as this will require updating cefpython's C++/Cython code.
300302

301-
If building on Linux and there are errors, see the
302-
"MISSING PACKAGES (Linux)" note futher down.
303-
304303
You should be fine by running automate.py with the default options,
305304
but if you need to customize the build then use the --help flag to
306305
see more options.
307306

307+
Remember to always upgrade packages listed in Requirements section each
308+
time you update to newer CEF.
309+
310+
On Linux if there are errors about missing packages or others,
311+
then see solutions in the [Possible errors](#possible-errors) section.
312+
308313
The commands below will build CEF from sources with custom CEF Python
309314
patches applied and then build the CEF Python package (xx.x is version
310315
number):
@@ -323,6 +328,15 @@ module, make installer package, install the package and run unit tests
323328
and examples. See the notes for commands for creating package installer
324329
and/or wheel package for distribution.
325330

331+
### Possible errors
332+
333+
__Debug_GN_arm/ configuration error (Linux)__: Even though building
334+
on Linux for Linux, Chromium still runs ARM configuration files. If
335+
there is an error showing that pkg-config fails with GTK 3 library
336+
then see solution in the third post in this topic on CEF Forum:
337+
[Debug_GN_arm error when building on Linux, *not* arm]
338+
(https://magpcss.org/ceforum/viewtopic.php?f=6&t=14976).
339+
326340
__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,
327341
it will try to build cef projects and if it fails due to missing packages
328342
make sure you've installed all the required packages listed in the
@@ -334,7 +348,7 @@ graphical installer pops up don't install it - deny EULA.
334348
```
335349
cd build/chromium/src/build/
336350
chmod 755 install-build-deps.sh
337-
sudo ./install-build-deps.sh --no-lib32 --no-arm --no-chromeos-fonts --no-nacl
351+
sudo ./install-build-deps.sh --no-chromeos-fonts --no-nacl
338352
```
339353

340354
After dependencies are satisifed re-run automate.py.
@@ -442,7 +456,12 @@ cd chromium/src/cef/
442456
git diff --no-prefix --relative > issue251.patch
443457
```
444458

445-
Apply a patch in current directory:
459+
Apply a patch in current directory and ignore git index:
460+
```
461+
patch -p0 < issue251.patch
462+
```
463+
464+
Apply a patch in current directory and do not ignore git index:
446465
```
447466
cd chromium/src/cef/
448467
git apply -v -p0 issue251.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 45f3db6aed3c..373b1e3c5b45 100644
2+
index 717522eb6951..e92ba22a9ca9 100644
33
--- http_cache_transaction.cc
44
+++ http_cache_transaction.cc
5-
@@ -2552,7 +2552,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
5+
@@ -2554,7 +2554,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/issue231.patch

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,10 @@ index 6a759309..ad620d7f 100644
8383
+ return PathService::Override(pref_key, file_path);
8484
+}
8585
diff --git libcef_dll/libcef_dll.cc libcef_dll/libcef_dll.cc
86-
index cc1aafe5..bde00c09 100644
86+
index 1f037f92..b0274ad8 100644
8787
--- libcef_dll/libcef_dll.cc
8888
+++ libcef_dll/libcef_dll.cc
89-
@@ -930,6 +930,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
89+
@@ -927,6 +927,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
9090
return _retval;
9191
}
9292

@@ -111,10 +111,10 @@ index cc1aafe5..bde00c09 100644
111111
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
112112

113113
diff --git libcef_dll/wrapper/libcef_dll_wrapper.cc libcef_dll/wrapper/libcef_dll_wrapper.cc
114-
index 08ddbd83..42e7dca1 100644
114+
index c4a1b559..a0b7765b 100644
115115
--- libcef_dll/wrapper/libcef_dll_wrapper.cc
116116
+++ libcef_dll/wrapper/libcef_dll_wrapper.cc
117-
@@ -851,6 +851,23 @@ CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) {
117+
@@ -848,6 +848,23 @@ CEF_GLOBAL bool CefGetPath(PathKey key, CefString& path) {
118118
return _retval?true:false;
119119
}
120120

patches/issue251.patch

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git include/capi/cef_drag_data_capi.h include/capi/cef_drag_data_capi.h
2-
index 5f86225..1684de2 100644
2+
index 2e84df8f..5b17e212 100644
33
--- include/capi/cef_drag_data_capi.h
44
+++ include/capi/cef_drag_data_capi.h
55
@@ -39,6 +39,7 @@
@@ -34,7 +34,7 @@ index 5f86225..1684de2 100644
3434

3535

3636
diff --git include/cef_drag_data.h include/cef_drag_data.h
37-
index 8f8094b..8b4602b 100644
37+
index 8f8094b4..8b4602b1 100644
3838
--- include/cef_drag_data.h
3939
+++ include/cef_drag_data.h
4040
@@ -39,6 +39,7 @@
@@ -70,21 +70,21 @@ index 8f8094b..8b4602b 100644
7070
};
7171

7272
#endif // CEF_INCLUDE_CEF_DRAG_DATA_H_
73-
diff --git libcef/browser/osr/web_contents_view_osr.cc libcef/browser/osr/web_contents_view_osr.cc
74-
index c39a29c..8b3c30a 100644
75-
--- libcef/browser/osr/web_contents_view_osr.cc
76-
+++ libcef/browser/osr/web_contents_view_osr.cc
77-
@@ -6,6 +6,7 @@
78-
#include "libcef/browser/osr/web_contents_view_osr.h"
73+
diff --git libcef/browser/osr/browser_platform_delegate_osr.cc libcef/browser/osr/browser_platform_delegate_osr.cc
74+
index 2cf44f6d..2e6b8c32 100644
75+
--- libcef/browser/osr/browser_platform_delegate_osr.cc
76+
+++ libcef/browser/osr/browser_platform_delegate_osr.cc
77+
@@ -7,6 +7,7 @@
78+
#include <utility>
7979

8080
#include "libcef/browser/browser_host_impl.h"
8181
+#include "libcef/browser/image_impl.h"
8282
#include "libcef/browser/osr/render_widget_host_view_osr.h"
83+
#include "libcef/browser/osr/web_contents_view_osr.h"
8384
#include "libcef/common/drag_data_impl.h"
84-
85-
@@ -230,7 +231,9 @@ void CefWebContentsViewOSR::StartDragging(
86-
if (browser.get())
87-
handler = browser->GetClient()->GetRenderHandler();
85+
@@ -393,7 +394,9 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
86+
CefRefPtr<CefRenderHandler> handler =
87+
browser_->GetClient()->GetRenderHandler();
8888
if (handler.get()) {
8989
- CefRefPtr<CefDragDataImpl> drag_data(new CefDragDataImpl(drop_data));
9090
+ CefRefPtr<CefImage> cef_image(new CefImageImpl(image));
@@ -94,7 +94,7 @@ index c39a29c..8b3c30a 100644
9494
base::MessageLoop::ScopedNestableTaskAllower allow(
9595
base::MessageLoop::current());
9696
diff --git libcef/common/drag_data_impl.cc libcef/common/drag_data_impl.cc
97-
index 6b632ab..2f12b92 100644
97+
index 6b632ab2..2f12b928 100644
9898
--- libcef/common/drag_data_impl.cc
9999
+++ libcef/common/drag_data_impl.cc
100100
@@ -20,6 +20,13 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
@@ -142,7 +142,7 @@ index 6b632ab..2f12b92 100644
142142
+ else return false;
143143
+}
144144
diff --git libcef/common/drag_data_impl.h libcef/common/drag_data_impl.h
145-
index 64f29ed..9870726 100644
145+
index 64f29ed3..98707262 100644
146146
--- libcef/common/drag_data_impl.h
147147
+++ libcef/common/drag_data_impl.h
148148
@@ -7,6 +7,7 @@
@@ -181,7 +181,7 @@ index 64f29ed..9870726 100644
181181
// True if this object is read-only.
182182
bool read_only_;
183183
diff --git libcef_dll/cpptoc/drag_data_cpptoc.cc libcef_dll/cpptoc/drag_data_cpptoc.cc
184-
index c36069e..ddb5729 100644
184+
index ffad1755..70a6c5c2 100644
185185
--- libcef_dll/cpptoc/drag_data_cpptoc.cc
186186
+++ libcef_dll/cpptoc/drag_data_cpptoc.cc
187187
@@ -11,6 +11,7 @@
@@ -256,7 +256,7 @@ index c36069e..ddb5729 100644
256256

257257
template<> CefRefPtr<CefDragData> CefCppToC<CefDragDataCppToC, CefDragData,
258258
diff --git libcef_dll/ctocpp/drag_data_ctocpp.cc libcef_dll/ctocpp/drag_data_ctocpp.cc
259-
index c6b0ee8..3873e9f 100644
259+
index ab27df2e..0b37224a 100644
260260
--- libcef_dll/ctocpp/drag_data_ctocpp.cc
261261
+++ libcef_dll/ctocpp/drag_data_ctocpp.cc
262262
@@ -11,6 +11,7 @@
@@ -320,7 +320,7 @@ index c6b0ee8..3873e9f 100644
320320
// CONSTRUCTOR - Do not edit by hand.
321321

322322
diff --git libcef_dll/ctocpp/drag_data_ctocpp.h libcef_dll/ctocpp/drag_data_ctocpp.h
323-
index 225f57a..2f0b67d 100644
323+
index 85ea3e58..24283697 100644
324324
--- libcef_dll/ctocpp/drag_data_ctocpp.h
325325
+++ libcef_dll/ctocpp/drag_data_ctocpp.h
326326
@@ -53,6 +53,9 @@ class CefDragDataCToCpp
@@ -332,4 +332,4 @@ index 225f57a..2f0b67d 100644
332332
+ bool HasImage() OVERRIDE;
333333
};
334334

335-
#endif // USING_CEF_SHARED
335+
#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_

tools/automate.py

Lines changed: 31 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -813,33 +813,58 @@ def get_vcvars_for_python():
813813

814814

815815
def getenv():
816-
"""Env variables passed to shell when running commands."""
816+
"""Env variables passed to shell when running commands.
817+
See cef/AutomatedBuildSetup.md for reference."""
817818
env = os.environ
819+
820+
# PATH
818821
if Options.build_cef:
819822
if os.path.exists(Options.depot_tools_dir):
820823
env["PATH"] = Options.depot_tools_dir + os.pathsep + env["PATH"]
824+
825+
# Generators: ninja, msvs
821826
env["GYP_GENERATORS"] = Options.gyp_generators
827+
828+
# VS version
822829
if platform.system() == "Windows":
823830
env["GYP_MSVS_VERSION"] = Options.gyp_msvs_version
824-
# See cef/AutomatedBuildSetup.md for reference.
825-
# Issue73 patch applied with "use_allocator=none"
826-
# TODO: 32-bit gyp defines: host_arch=x86_64 target_arch=ia32
831+
832+
# GN configuration
833+
env["CEF_USE_GN"] = "1"
834+
# Issue #73 patch applied here with "use_allocator=none"
835+
# TODO: 32-bit GN defines: host_arch=x86_64 target_arch=ia32
827836
env["GN_DEFINES"] = "use_sysroot=true use_allocator=none symbol_level=1"
837+
# env["GN_DEFINES"] += " use_gtk3=false"
828838
# To perform an official build set GYP_DEFINES=buildtype=Official.
829839
# This will disable debugging code and enable additional link-time
830840
# optimizations in Release builds.
831841
if Options.release_build and not Options.fast_build:
832842
env["GN_DEFINES"] += " is_official_build=true"
833-
# Modifications to automate-git.py
843+
844+
# GYP configuration is DEPRECATED, however it is still set in
845+
# upstream Linux configuration on AutomatedBuildSetup wiki page,
846+
# so setting it here as well.
847+
env["GYP_DEFINES"] = "disable_nacl=1 use_sysroot=1 use_allocator=none"
848+
# Note: 32-bit GYP defines: host_arch=x86_64 target_arch=ia32
849+
if Options.release_build and not Options.fast_build:
850+
env["GYP_DEFINES"] += " buildtype=Official"
851+
852+
# Modifications to upstream automate-git.py introduced
853+
# CEFPYTHON_NINJA_JOBS env key.
834854
env["CEFPYTHON_NINJA_JOBS"] = str(Options.ninja_jobs)
855+
835856
return env
836857

837858

838859
def run_command(command, working_dir, env=None):
839860
"""Run command in a given directory with env variables set.
840861
On Linux multiple commands on one line with the use of && are not allowed.
841862
"""
842-
print("[automate.py] Running '"+" ".join(command)+"' in '" +
863+
if isinstance(command, list):
864+
command_str = " ".join(command)
865+
else:
866+
command_str = command
867+
print("[automate.py] Running '"+command_str+"' in '" +
843868
working_dir+"'...")
844869
if isinstance(command, str):
845870
args = shlex.split(command.replace("\\", "\\\\"))

0 commit comments

Comments
 (0)