| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,8 +15,8 @@ Table of contents: | |||
| 15 | 15 | * [Build CEF Python using prebuilt CEF binaries](#build-cefpython-using-prebuilt-cef-binaries) | |
| 16 | 16 | * [Build both CEF Python and CEF from sources](#build-both-cefpython-and-cef-from-sources) | |
| 17 | 17 | * [Build CEF manually](#build-cef-manually) | |
| 18 | + * [CEF automated builds](#cef-automated-builds) | ||
| 18 | 19 | * [How to patch](#how-to-patch) | |
| 19 | - * [Ninja build slows down computer](#ninja-build-slows-down-computer) | ||
| 20 | 20 | ||
| 21 | 21 | ||
| 22 | 22 | ## Requirements | |
@@ -50,9 +50,18 @@ __Windows__ | |||
| 50 | 50 | ||
| 51 | 51 | __Linux__ | |
| 52 | 52 | ||
| 53 | - * Install required packages using apt-get or similar: | ||
| 53 | + * Install packages: cmake, g++ 4.6.3+, libgtkglext1-dev | ||
| 54 | + * Download and install cmake 2.8.12 or later (unless you already have a | ||
| 55 | + proper version, check with cmake --version): | ||
| 54 | 56 | ``` | |
| 55 | - sudo apt-get install cmake g++ pkg-config gtk+-2.0 libgtkglext1-dev | ||
| 57 | + cd build/ | ||
| 58 | + wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz | ||
| 59 | + tar xzf cmake-2.8.12.2.tar.gz | ||
| 60 | + cd cmake-2.8.12.2 | ||
| 61 | + ./configure | ||
| 62 | + make | ||
| 63 | + sudo make install | ||
| 64 | + # restart terminal, so that new cmake is used | ||
| 56 | 65 | ``` | |
| 57 | 66 | * Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later | |
| 58 | 67 | and copy it to /usr/bin and chmod 755. | |
@@ -63,7 +72,8 @@ sudo apt-get install cmake g++ pkg-config gtk+-2.0 libgtkglext1-dev | |||
| 63 | 72 | For branches 2623 (Chrome 49) or later Ubuntu 14.04+ is required. | |
| 64 | 73 | * To build on Debian 7 see | |
| 65 | 74 | [cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and | |
| 66 | - [cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575) | ||
| 75 | + [cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575), | ||
| 76 | + and [cef/#1697](https://bitbucket.org/chromiumembedded/cef/issues/1697) | ||
| 67 | 77 | * To perform a 32-bit Linux build on a 64-bit Linux system see | |
| 68 | 78 | [cef/#1804](https://bitbucket.org/chromiumembedded/cef/issues/1804) | |
| 69 | 79 | ||
@@ -78,32 +88,42 @@ __All platforms__ | |||
| 78 | 88 | ||
| 79 | 89 | ## Build CEF Python using prebuilt CEF binaries | |
| 80 | 90 | ||
| 81 | - Run the automate.py tool using the --prebuilt-cef flag: | ||
| 91 | + Prebuilt binaries are available on | ||
| 92 | + [GitHub Releases](https://github.com/cztomczak/cefpython/releases) | ||
| 93 | + tagged 'cefXX'. | ||
| 94 | + | ||
| 95 | + Run the automate.py tool using the --prebuilt-cef flag that will download | ||
| 96 | + prebuilt binaries from GitHub Releases using version information from | ||
| 97 | + src/version/. | ||
| 98 | + | ||
| 99 | + __NOTE__: The --prebuilt-cef flag is not implemented yet - you need to | ||
| 100 | + download manually from GitHub Releases and put files to | ||
| 101 | + cefpython/build/linux64/ (rename cef47_xxx_linux64/ to linux64/). | ||
| 82 | 102 | ``` | |
| 83 | 103 | cd tools/ | |
| 84 | 104 | python automate.py --prebuilt-cef | |
| 85 | 105 | ``` | |
| 86 | 106 | ||
| 87 | - You should be fine by running it with the default options, but if you | ||
| 107 | + You should be fine by running automate.py with the default options, but if you | ||
| 88 | 108 | need to customize the build then use the --help flag to see more. | |
| 89 | 109 | ||
| 90 | 110 | ||
| 91 | 111 | ## Build both CEF Python and CEF from sources | |
| 92 | 112 | ||
| 93 | 113 | Run the automate.py tool using the --build-cef flag. Specify cef branch | |
| 94 | 114 | and optionally how many parallel ninja jobs to run (by default cores/2). | |
| 115 | + If building on Linux see the Important note futher down. | ||
| 95 | 116 | ||
| 96 | 117 | ``` | |
| 97 | 118 | cd tools/ | |
| 98 | 119 | python automate.py --build-cef --cef-branch 2526 --ninja-jobs 6 | |
| 99 | 120 | ``` | |
| 100 | 121 | ||
| 101 | - __IMPORTANT__: On Linux it will fail on first run. After the chromium | ||
| 122 | + __IMPORTANT NOTE (Linux)__: On Linux it will fail on first run. After the chromium | ||
| 102 | 123 | sources are downloaded, it will try to build cef projects and fail | |
| 103 | 124 | due to missing packages. You will need to run the install-build-deps.sh | |
| 104 | 125 | script (intended for Ubuntu systems). When the "ttf-mscorefonts-installer" | |
| 105 | - graphical installer pops up you can deny EULA and not install these fonts | ||
| 106 | - (might deteriorate UX on some systems, experienced on Ubuntu 12.04 32-bit). | ||
| 126 | + graphical installer pops up don't install it - deny EULA. | ||
| 107 | 127 | ||
| 108 | 128 | ``` | |
| 109 | 129 | cd build/chromium/src/build/ | |
@@ -113,7 +133,7 @@ sudo ./install-build-deps.sh --no-arm --no-chromeos-fonts --no-nacl | |||
| 113 | 133 | ||
| 114 | 134 | After dependencies are satisifed re-run automate.py. | |
| 115 | 135 | ||
| 116 | - You should be fine by running it with the default options, but if you | ||
| 136 | + You should be fine by running automate.py with the default options, but if you | ||
| 117 | 137 | need to customize the build then use the --help flag to see more. | |
| 118 | 138 | ||
| 119 | 139 | ||
@@ -137,6 +157,28 @@ Note that CEF patches must be applied in the "download_dir/chromium/src/cef/" | |||
| 137 | 157 | directory, not in the "download_dir/cef/" directory. | |
| 138 | 158 | ||
| 139 | 159 | ||
| 160 | + ## CEF automated builds | ||
| 161 | + | ||
| 162 | + There are two sites that provide latest builds of CEF: | ||
| 163 | + * Spotify - http://opensource.spotify.com/cefbuilds/index.html | ||
| 164 | + * This is a new build system | ||
| 165 | + * Since 07/06/2016 all builds are without tcmalloc, see | ||
| 166 | + [cefpython/#76](https://github.com/cztomczak/cefpython/issues/73) | ||
| 167 | + and [cef/#1827](https://bitbucket.org/chromiumembedded/cef/issues/1827) | ||
| 168 | + * Adobe - https://cefbuilds.com/ | ||
| 169 | + * This is an old build system. It probably still builds with tcmalloc | ||
| 170 | + (see above) | ||
| 171 | + | ||
| 172 | + Official CEF Python binaries come with additional patches to CEF/Chromium, | ||
| 173 | + see the [patches/](../../../tree/master/patches) directory. Whether you | ||
| 174 | + need these patches depends on your use case, they may not be required | ||
| 175 | + and thus you could use the Spotify binaries. As of this writing there are | ||
| 176 | + three patches: | ||
| 177 | + * issue73 patch - tcmalloc issues, Spotify builds already apply it | ||
| 178 | + * issue125 patch - for https cache problems when using private certificates | ||
| 179 | + * issue218 patch - not required when running GTK or Kivy examples | ||
| 180 | + | ||
| 181 | + | ||
| 140 | 182 | ## How to patch | |
| 141 | 183 | ||
| 142 | 184 | Create a patch from unstaged changes in current directory: | |
@@ -150,13 +192,3 @@ Apply a patch in current directory: | |||
| 150 | 192 | cd chromium/src/cef/ | |
| 151 | 193 | git apply cef.gyp.patch | |
| 152 | 194 | ``` | |
| 153 | - | ||
| 154 | - | ||
| 155 | - ## Ninja build slows down computer | ||
| 156 | - | ||
| 157 | - If ninja slows down your computer too much (6 parallel jobs by default), | ||
| 158 | - build manually with this command (where -j2 means to run 2 jobs in parallel): | ||
| 159 | - ``` | ||
| 160 | - cd chromium/src | ||
| 161 | - ninja -v -j2 -Cout\Release cefclient | ||
| 162 | - ``` | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,41 @@ | |||
| 1 | + diff --git CMakeLists.txt.in CMakeLists.txt.in | ||
| 2 | + index 54d6c2d..7d9f923 100644 | ||
| 3 | + --- CMakeLists.txt.in | ||
| 4 | + +++ CMakeLists.txt.in | ||
| 5 | + @@ -204,7 +204,7 @@ if(OS_LINUX) | ||
| 6 | + # -fvisibility-inlines-hidden = Give hidden visibility to inlined class member functions | ||
| 7 | + # -std=gnu++11 = Use the C++11 language standard including GNU extensions | ||
| 8 | + # -Wsign-compare = Warn about mixed signed/unsigned type comparisons | ||
| 9 | + - set(CEF_CXX_COMPILER_FLAGS "-fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -std=gnu++11 -Wsign-compare") | ||
| 10 | + + set(CEF_CXX_COMPILER_FLAGS "-fno-exceptions -fno-rtti -fno-threadsafe-statics -fvisibility-inlines-hidden -Wsign-compare") | ||
| 11 | + # -O0 = Disable optimizations | ||
| 12 | + # -g = Generate debug information | ||
| 13 | + set(CEF_COMPILER_FLAGS_DEBUG "-O0 -g") | ||
| 14 | + @@ -237,18 +237,6 @@ if(OS_LINUX) | ||
| 15 | + set(CEF_C_COMPILER_FLAGS "${CEF_C_COMPILER_FLAGS} -Wno-unused-local-typedefs") | ||
| 16 | + endif() | ||
| 17 | + | ||
| 18 | + - # -Wno-literal-suffix = Don't warn about invalid suffixes on literals | ||
| 19 | + - CHECK_CXX_COMPILER_FLAG(-Wno-literal-suffix COMPILER_SUPPORTS_NO_LITERAL_SUFFIX) | ||
| 20 | + - if(COMPILER_SUPPORTS_NO_LITERAL_SUFFIX) | ||
| 21 | + - set(CEF_CXX_COMPILER_FLAGS "${CEF_CXX_COMPILER_FLAGS} -Wno-literal-suffix") | ||
| 22 | + - endif() | ||
| 23 | + - | ||
| 24 | + - # -Wno-narrowing = Don't warn about type narrowing | ||
| 25 | + - CHECK_CXX_COMPILER_FLAG(-Wno-narrowing COMPILER_SUPPORTS_NO_NARROWING) | ||
| 26 | + - if(COMPILER_SUPPORTS_NO_NARROWING) | ||
| 27 | + - set(CEF_CXX_COMPILER_FLAGS "${CEF_CXX_COMPILER_FLAGS} -Wno-narrowing") | ||
| 28 | + - endif() | ||
| 29 | + - | ||
| 30 | + if(PROJECT_ARCH STREQUAL "x86_64") | ||
| 31 | + # 64-bit architecture. | ||
| 32 | + set(CEF_COMPILER_FLAGS "${CEF_COMPILER_FLAGS} -m64 -march=x86-64") | ||
| 33 | + @@ -333,7 +321,7 @@ if(OS_MACOSX) | ||
| 34 | + # -O3 = Optimize for maximum speed plus a few extras | ||
| 35 | + set(CEF_COMPILER_FLAGS_RELEASE "-O3") | ||
| 36 | + # -Wl,-search_paths_first = Search for static or shared library versions in the same pass | ||
| 37 | + - # -Wl,-ObjC = Support creation of creation of ObjC static libraries | ||
| 38 | + + # -Wl,-ObjC = Support creation of creation of ObjC static libraries | ||
| 39 | + # -Wl,-pie = Generate position-independent code suitable for executables only | ||
| 40 | + set(CEF_LINKER_FLAGS "-Wl,-search_paths_first -Wl,-ObjC -Wl,-pie") | ||
| 41 | + # -Wl,-dead_strip = Strip dead code | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,3 +2,4 @@ Patch to CEF. Fixes tcmalloc issue on Linux: | |||
| 2 | 2 | https://github.com/cztomczak/cefpython/issues/73 | |
| 3 | 3 | ||
| 4 | 4 | Copy the "include.gypi" file to the ~/.gyp/ directory. | |
| 5 | + The automate.py script applies this patch by setting GYP_DEFINES env var. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,10 +9,22 @@ | |||
| 9 | 9 | "linux" if platform.system() == "Linux" else | |
| 10 | 10 | "mac" if platform.system() == "Darwin" else "unknown") | |
| 11 | 11 | ||
| 12 | + # ALL PLATFORMS | ||
| 12 | 13 | patches.append( | |
| 13 | 14 | { | |
| 14 | - # Fixes HTTPS cache problems on sites with certificate errors | ||
| 15 | - 'name': 'issue125_win_mac_linux', | ||
| 15 | + # Fixes HTTPS cache problems with private certificates | ||
| 16 | + 'name': 'issue125', | ||
| 16 | 17 | 'path': '../net/http/', | |
| 17 | 18 | }, | |
| 18 | 19 | ) | |
| 20 | + | ||
| 21 | + # LINUX | ||
| 22 | + if OS_POSTFIX == "linux": | ||
| 23 | + patches.append( | ||
| 24 | + { | ||
| 25 | + # Fix compile error on Ubuntu 12: | ||
| 26 | + # cc1plus: error: unrecognized command line option '-std=gnu++11' | ||
| 27 | + 'name': 'CMakeLists.txt.in_linux', | ||
| 28 | + 'path': './', | ||
| 29 | + }, | ||
| 30 | + ) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments