Skip to content

Commit 169a1b2

Browse files
committed
Add docs/ directory and move api/ there.
Add build instructions doc.
1 parent ef401b3 commit 169a1b2

38 files changed

+136
-12
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
[![](https://img.shields.io/badge/pypi-v31.2-blue.png "PyPI latest release")](https://pypi.python.org/pypi/cefpython3/)
66
[![](https://img.shields.io/badge/commits%20since-v31.2-lightgray.png "Commits since v31.2 release")](https://github.com/cztomczak/cefpython/compare/05366f2...master)
77

8-
__NOTES__:
8+
__NOTES__:
99
* Repository rewritten on 2016-02-15 to reduce its size.
1010
Please clone it again.
1111
* Master branch is a work in progress. When building use the cefpython31
@@ -23,10 +23,10 @@ Table of contents:
2323

2424
CEF Python is an open source project founded by [Czarek Tomczak](http://www.linkedin.com/in/czarektomczak) in 2012 to provide python bindings for the [Chromium Embedded Framework](https://bitbucket.org/chromiumembedded/cef). See the growing list of [applications using CEF](http://en.wikipedia.org/wiki/Chromium_Embedded_Framework#Applications_using_CEF) on wikipedia. Examples of embedding CEF browser are available for many popular GUI toolkits including: [wxPython](../../wiki/wxPython), [PyGTK](../../wiki/PyGTK), [PyQt](../../wiki/PyQt), [PySide](../../wiki/PySide), [Kivy](../../wiki/Kivy), [Panda3D](../../wiki/Panda3D) and [PyWin32](src/windows/binaries_32bit/pywin32.py).
2525

26-
Some use cases for CEF:
26+
Some use cases for CEF:
2727

2828
* Embed a web browser control with great HTML5 support (based on Chromium)
29-
* Use it to create a HTML5 based GUI in an application. This can act as a replacement for GUI toolkits like wxWidgets/Qt/Gtk. For native communication between javascript and python use [javascript bindings](../../wiki/JavascriptBindings). Another option is to run an internal python web server and use websockets/XMLHttpRequest for js<>python communication. This way you can write a desktop app in the same way you write web apps.
29+
* Use it to create a HTML5 based GUI in an application. This can act as a replacement for GUI toolkits like wxWidgets/Qt/Gtk. For native communication between javascript and python use [javascript bindings](../../wiki/JavascriptBindings). Another option is to run an internal python web server and use websockets/XMLHttpRequest for js<>python communication. This way you can write a desktop app in the same way you write web apps.
3030
* Render web content off-screen in applications that use custom drawing frameworks. See the [Kivy](../../wiki/Kivy) and [Panda3D](../../wiki/Panda3D) examples.
3131
* Use it for automated testing of existing web applications. Use it for web scraping, or as a web crawler or other kind of internet bots.
3232

@@ -46,13 +46,13 @@ On Win/Mac you can install from PyPI using this command:
4646
* For Linux: see the [Download_CEF3_Linux](../../wiki/Download_CEF3_Linux) wiki page.
4747
* For Mac: see the [Download_CEF3_Mac](../../wiki/Download_CEF3_Mac) wiki page.
4848

49-
__New releases RSS/Atom feed__
49+
__New releases RSS/Atom feed__
5050
To be notified of new releases subscribe to this [Atom feed](https://github.com/cztomczak/cefpython/releases.atom).
5151

5252
## Support
5353

54-
* API docs are in the [api/](api/) directory
55-
* See [Wiki Pages](../../wiki)
54+
* API docs are in the [docs/api/](docs/api/) directory
55+
* See also [Wiki Pages](../../wiki)
5656
* Ask questions and report problems on the
5757
[Forum](https://groups.google.com/group/cefpython)
5858
* Please do not ask questions in the Issue Tracker

docs/Build-instructions.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Build instructions
2+
3+
There are two types of builds you can perform. You can build
4+
PyCEF using the prebuilt CEF binaries. Or you can build both
5+
PyCEF and CEF from sources. Building CEF is a long process that
6+
can take hours. In the tools/ directory there is the automate.py
7+
script that automates building. However before you can run it
8+
you must satisfy some requirements.
9+
10+
11+
Table of contents:
12+
* [Requirements](#requirements)
13+
* [Build PyCEF using prebuilt CEF binaries](#build-pycef-using-prebuilt-cef-binaries)
14+
* [Build both PyCEF and CEF from sources](#build-both-pycef-and-cef-from-sources)
15+
* [Build CEF manually](#build-cef-manually)
16+
* [How to patch](#how-to-patch)
17+
* [Ninja build slows down computer](#ninja-build-slows-down-computer)
18+
19+
20+
## Requirements
21+
22+
Below are platform specific requirements. Do these first before
23+
following instructions in the "All platforms" section that lists
24+
requirements common for all platforms.
25+
26+
__Windows__
27+
28+
* For Python 2.7 - VS2008 compiler is required:
29+
http://www.microsoft.com/en-us/download/details.aspx?id=44266
30+
* For Python 3.4 - VS2010 compiler is required:
31+
https://docs.python.org/3.4/using/windows.html#compiling-python-on-windows
32+
* For Python 3.5 - VS2015 compiler is required:
33+
https://docs.python.org/3.5/using/windows.html#compiling-python-on-windows
34+
* To build CEF from sources:
35+
* Use Win7 x64 or later. 32-bit OS'es are not supported. For more details see [here]
36+
(https://www.chromium.org/developers/how-tos/build-instructions-windows).
37+
* For CEF branch >= 2704 install VS2015 Update 2 or later
38+
* For CEF branch < 2704 install VS2013 Update 4 or later
39+
* Install [CMake](https://cmake.org/) 2.8.12.1 or newer and add cmake.exe
40+
to PATH
41+
* Install [ninja](http://martine.github.io/ninja/) and add ninja.exe
42+
to PATH
43+
* You need about 16 GB of RAM during linking. If there is an error
44+
just add additional virtual memory.
45+
* For Python 2.7 copy "pycef/src/windows/stdint.h" to
46+
"%LocalAppData%\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\include\"
47+
48+
__All platforms__
49+
50+
* Install dependencies for the automate.py tool by executing:
51+
`cd tools/ && pip install -r requirements.txt`. This will install
52+
some PyPI packages including Cython. On Windows installing Cython
53+
requires a VS compiler - see instructions above for Windows.
54+
55+
56+
## Build PyCEF using prebuilt CEF binaries
57+
58+
Run the automate.py tool using the --prebuilt-cef flag:
59+
```
60+
cd tools/
61+
python automate.py --prebuilt-cef
62+
```
63+
64+
You should be fine by running it with the default options, but if you
65+
need to customize the build then use the --help flag to see more.
66+
67+
68+
## Build both PyCEF and CEF from sources
69+
70+
Run the automate.py tool using the --build-cef flag:
71+
```
72+
cd tools/
73+
python automate.py --build-cef --cef-branch 2526
74+
```
75+
76+
You should be fine by running it with the default options, but if you
77+
need to customize the build then use the --help flag to see more.
78+
79+
80+
## Build CEF manually
81+
82+
CEF Python official binaries come with custom CEF binaries with
83+
a few patches applied for our use case. These patches are in the
84+
patches/ directory.
85+
86+
On Linux before running any of CEF tools apply the issue73 patch
87+
first.
88+
89+
To build CEF follow the instructions on the Branches and
90+
Building CEF wiki page:
91+
https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
92+
93+
After it is successfully built - apply patches, rebuild and remake
94+
distribs.
95+
96+
Note that CEF patches must be applied in the "download_dir/chromium/src/cef/"
97+
directory, not in the "download_dir/cef/" directory.
98+
99+
100+
## How to patch
101+
102+
Create a patch from unstaged changes in current directory:
103+
```
104+
cd chromium/src/cef/
105+
git diff --no-prefix --relative > cef.gyp.patch
106+
```
107+
108+
Apply a patch in current directory:
109+
```
110+
cd chromium/src/cef/
111+
git apply cef.gyp.patch
112+
```
113+
114+
115+
## Ninja build slows down computer
116+
117+
If ninja slows down your computer too much (6 parallel jobs by default),
118+
build manually with this command (where -j2 means to run 2 jobs in parallel):
119+
```
120+
cd chromium/src
121+
ninja -v -j2 -Cout\Release cefclient
122+
```
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)