Skip to content

Commit

Permalink
Update to Chromium v56 on Linux (#276)...
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cztomczak committed Mar 13, 2017
1 parent 94f2c05 commit 3681c59
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 37 deletions.
33 changes: 26 additions & 7 deletions docs/Build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Table of contents:
* [Build using prebuilt CEF binaries and libraries](#build-using-prebuilt-cef-binaries-and-libraries)
* [Build using CEF binaries from Spotify Automated Builds](#build-using-cef-binaries-from-spotify-automated-builds)
* [Build upstream CEF from sources](#build-upstream-cef-from-sources)
* [Possible errors](#possible-errors)
* [Build CEF manually](#build-cef-manually)
* [CEF Automated Builds (Spotify and Adobe)](#cef-automated-builds-spotify-and-adobe)
* [Notes](#notes)
Expand Down Expand Up @@ -191,8 +192,9 @@ requirements common for all platforms.
* Official binaries are built on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4)
* Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
and copy it to /usr/bin and chmod 755.
* Install required packages using one of the three methods below:
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`
* Install/upgrade required packages using one of the three methods below
(these packages should be upgraded each time you update to newer CEF):
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`
2. See the list of packages on the
[cef/AutomatedBuildSetup.md](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
wiki page.
Expand Down Expand Up @@ -298,13 +300,16 @@ a custom CEF branch
then use the --cef-branch flag, but note that this is only for advanced
users as this will require updating cefpython's C++/Cython code.

If building on Linux and there are errors, see the
"MISSING PACKAGES (Linux)" note futher down.

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

Remember to always upgrade packages listed in Requirements section each
time you update to newer CEF.

On Linux if there are errors about missing packages or others,
then see solutions in the [Possible errors](#possible-errors) section.

The commands below will build CEF from sources with custom CEF Python
patches applied and then build the CEF Python package (xx.x is version
number):
Expand All @@ -323,6 +328,15 @@ module, make installer package, install the package and run unit tests
and examples. See the notes for commands for creating package installer
and/or wheel package for distribution.

### Possible errors

__Debug_GN_arm/ configuration error (Linux)__: Even though building
on Linux for Linux, Chromium still runs ARM configuration files. If
there is an error showing that pkg-config fails with GTK 3 library
then see solution in the third post in this topic on CEF Forum:
[Debug_GN_arm error when building on Linux, *not* arm]
(https://magpcss.org/ceforum/viewtopic.php?f=6&t=14976).

__MISSING PACKAGES (Linux)__: After the chromium sources are downloaded,
it will try to build cef projects and if it fails due to missing packages
make sure you've installed all the required packages listed in the
Expand All @@ -334,7 +348,7 @@ graphical installer pops up don't install it - deny EULA.
```
cd build/chromium/src/build/
chmod 755 install-build-deps.sh
sudo ./install-build-deps.sh --no-lib32 --no-arm --no-chromeos-fonts --no-nacl
sudo ./install-build-deps.sh --no-chromeos-fonts --no-nacl
```

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

Apply a patch in current directory:
Apply a patch in current directory and ignore git index:
```
patch -p0 < issue251.patch
```

Apply a patch in current directory and do not ignore git index:
```
cd chromium/src/cef/
git apply -v -p0 issue251.patch
Expand Down
4 changes: 2 additions & 2 deletions patches/issue125.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git http_cache_transaction.cc http_cache_transaction.cc
index 45f3db6aed3c..373b1e3c5b45 100644
index 717522eb6951..e92ba22a9ca9 100644
--- http_cache_transaction.cc
+++ http_cache_transaction.cc
@@ -2552,7 +2552,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
@@ -2554,7 +2554,8 @@ int HttpCache::Transaction::WriteResponseInfoToEntry(bool truncated) {
// blocking page is shown. An alternative would be to reverse-map the cert
// status to a net error and replay the net error.
if ((response_.headers->HasHeaderValue("cache-control", "no-store")) ||
Expand Down
8 changes: 4 additions & 4 deletions patches/issue231.patch
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,10 @@ index 6a759309..ad620d7f 100644
+ return PathService::Override(pref_key, file_path);
+}
diff --git libcef_dll/libcef_dll.cc libcef_dll/libcef_dll.cc
index cc1aafe5..bde00c09 100644
index 1f037f92..b0274ad8 100644
--- libcef_dll/libcef_dll.cc
+++ libcef_dll/libcef_dll.cc
@@ -930,6 +930,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
@@ -927,6 +927,23 @@ CEF_EXPORT int cef_get_path(cef_path_key_t key, cef_string_t* path) {
return _retval;
}

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

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

Expand Down
36 changes: 18 additions & 18 deletions patches/issue251.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git include/capi/cef_drag_data_capi.h include/capi/cef_drag_data_capi.h
index 5f86225..1684de2 100644
index 2e84df8f..5b17e212 100644
--- include/capi/cef_drag_data_capi.h
+++ include/capi/cef_drag_data_capi.h
@@ -39,6 +39,7 @@
Expand Down Expand Up @@ -34,7 +34,7 @@ index 5f86225..1684de2 100644


diff --git include/cef_drag_data.h include/cef_drag_data.h
index 8f8094b..8b4602b 100644
index 8f8094b4..8b4602b1 100644
--- include/cef_drag_data.h
+++ include/cef_drag_data.h
@@ -39,6 +39,7 @@
Expand Down Expand Up @@ -70,21 +70,21 @@ index 8f8094b..8b4602b 100644
};

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

#include "libcef/browser/browser_host_impl.h"
+#include "libcef/browser/image_impl.h"
#include "libcef/browser/osr/render_widget_host_view_osr.h"
#include "libcef/browser/osr/web_contents_view_osr.h"
#include "libcef/common/drag_data_impl.h"

@@ -230,7 +231,9 @@ void CefWebContentsViewOSR::StartDragging(
if (browser.get())
handler = browser->GetClient()->GetRenderHandler();
@@ -393,7 +394,9 @@ void CefBrowserPlatformDelegateOsr::StartDragging(
CefRefPtr<CefRenderHandler> handler =
browser_->GetClient()->GetRenderHandler();
if (handler.get()) {
- CefRefPtr<CefDragDataImpl> drag_data(new CefDragDataImpl(drop_data));
+ CefRefPtr<CefImage> cef_image(new CefImageImpl(image));
Expand All @@ -94,7 +94,7 @@ index c39a29c..8b3c30a 100644
base::MessageLoop::ScopedNestableTaskAllower allow(
base::MessageLoop::current());
diff --git libcef/common/drag_data_impl.cc libcef/common/drag_data_impl.cc
index 6b632ab..2f12b92 100644
index 6b632ab2..2f12b928 100644
--- libcef/common/drag_data_impl.cc
+++ libcef/common/drag_data_impl.cc
@@ -20,6 +20,13 @@ CefDragDataImpl::CefDragDataImpl(const content::DropData& data)
Expand Down Expand Up @@ -142,7 +142,7 @@ index 6b632ab..2f12b92 100644
+ else return false;
+}
diff --git libcef/common/drag_data_impl.h libcef/common/drag_data_impl.h
index 64f29ed..9870726 100644
index 64f29ed3..98707262 100644
--- libcef/common/drag_data_impl.h
+++ libcef/common/drag_data_impl.h
@@ -7,6 +7,7 @@
Expand Down Expand Up @@ -181,7 +181,7 @@ index 64f29ed..9870726 100644
// True if this object is read-only.
bool read_only_;
diff --git libcef_dll/cpptoc/drag_data_cpptoc.cc libcef_dll/cpptoc/drag_data_cpptoc.cc
index c36069e..ddb5729 100644
index ffad1755..70a6c5c2 100644
--- libcef_dll/cpptoc/drag_data_cpptoc.cc
+++ libcef_dll/cpptoc/drag_data_cpptoc.cc
@@ -11,6 +11,7 @@
Expand Down Expand Up @@ -256,7 +256,7 @@ index c36069e..ddb5729 100644

template<> CefRefPtr<CefDragData> CefCppToC<CefDragDataCppToC, CefDragData,
diff --git libcef_dll/ctocpp/drag_data_ctocpp.cc libcef_dll/ctocpp/drag_data_ctocpp.cc
index c6b0ee8..3873e9f 100644
index ab27df2e..0b37224a 100644
--- libcef_dll/ctocpp/drag_data_ctocpp.cc
+++ libcef_dll/ctocpp/drag_data_ctocpp.cc
@@ -11,6 +11,7 @@
Expand Down Expand Up @@ -320,7 +320,7 @@ index c6b0ee8..3873e9f 100644
// CONSTRUCTOR - Do not edit by hand.

diff --git libcef_dll/ctocpp/drag_data_ctocpp.h libcef_dll/ctocpp/drag_data_ctocpp.h
index 225f57a..2f0b67d 100644
index 85ea3e58..24283697 100644
--- libcef_dll/ctocpp/drag_data_ctocpp.h
+++ libcef_dll/ctocpp/drag_data_ctocpp.h
@@ -53,6 +53,9 @@ class CefDragDataCToCpp
Expand All @@ -332,4 +332,4 @@ index 225f57a..2f0b67d 100644
+ bool HasImage() OVERRIDE;
};

#endif // USING_CEF_SHARED
#endif // CEF_LIBCEF_DLL_CTOCPP_DRAG_DATA_CTOCPP_H_
37 changes: 31 additions & 6 deletions tools/automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,33 +813,58 @@ def get_vcvars_for_python():


def getenv():
"""Env variables passed to shell when running commands."""
"""Env variables passed to shell when running commands.
See cef/AutomatedBuildSetup.md for reference."""
env = os.environ

# PATH
if Options.build_cef:
if os.path.exists(Options.depot_tools_dir):
env["PATH"] = Options.depot_tools_dir + os.pathsep + env["PATH"]

# Generators: ninja, msvs
env["GYP_GENERATORS"] = Options.gyp_generators

# VS version
if platform.system() == "Windows":
env["GYP_MSVS_VERSION"] = Options.gyp_msvs_version
# See cef/AutomatedBuildSetup.md for reference.
# Issue73 patch applied with "use_allocator=none"
# TODO: 32-bit gyp defines: host_arch=x86_64 target_arch=ia32

# GN configuration
env["CEF_USE_GN"] = "1"
# Issue #73 patch applied here with "use_allocator=none"
# TODO: 32-bit GN defines: host_arch=x86_64 target_arch=ia32
env["GN_DEFINES"] = "use_sysroot=true use_allocator=none symbol_level=1"
# env["GN_DEFINES"] += " use_gtk3=false"
# To perform an official build set GYP_DEFINES=buildtype=Official.
# This will disable debugging code and enable additional link-time
# optimizations in Release builds.
if Options.release_build and not Options.fast_build:
env["GN_DEFINES"] += " is_official_build=true"
# Modifications to automate-git.py

# GYP configuration is DEPRECATED, however it is still set in
# upstream Linux configuration on AutomatedBuildSetup wiki page,
# so setting it here as well.
env["GYP_DEFINES"] = "disable_nacl=1 use_sysroot=1 use_allocator=none"
# Note: 32-bit GYP defines: host_arch=x86_64 target_arch=ia32
if Options.release_build and not Options.fast_build:
env["GYP_DEFINES"] += " buildtype=Official"

# Modifications to upstream automate-git.py introduced
# CEFPYTHON_NINJA_JOBS env key.
env["CEFPYTHON_NINJA_JOBS"] = str(Options.ninja_jobs)

return env


def run_command(command, working_dir, env=None):
"""Run command in a given directory with env variables set.
On Linux multiple commands on one line with the use of && are not allowed.
"""
print("[automate.py] Running '"+" ".join(command)+"' in '" +
if isinstance(command, list):
command_str = " ".join(command)
else:
command_str = command
print("[automate.py] Running '"+command_str+"' in '" +
working_dir+"'...")
if isinstance(command, str):
args = shlex.split(command.replace("\\", "\\\\"))
Expand Down

1 comment on commit 3681c59

@cztomczak
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rushed a bit, the build is still running. The src/version/cef_version_linux.h still needs to be updated.

Please sign in to comment.