croxis / cefpython

Automatically exported from code.google.com/p/cefpython
0 stars 0 forks source link

Update to CEF branch 2171 (Chrome 39) #181

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I've only looked on linux and it's fun because of the switch to aura.

First you copy the new cef header files.

In earlier lincef I built cef with tcmalloc enabled and it was fine, but I 
couldn't figure out a way to make it work here, so instead disable tcmalloc.

> echo -e "{\n 'variables': {\n   'use_allocator': 'none',\n },\n}\n" > 
~/.gyp/include.gypi
> python ../build/gyp_chromium.py cef.gyp -I cef.gypi -D clang=0

Note the 'clang=0' was because I'm building on 32bit linux and chromium's 
supplied clang seems 64bit only. When building on 64bit linux clang works fine.

I applied the (chrome 33) patches in 
https://code.google.com/p/cefpython/issues/detail?id=138 as a starting point.

I had lots of fun building libcef.so as I was pulling down too recent versions 
of depot-tools and Marshall's automate-git.py which broke things, and then 
Marshall changed his branch management stuff in breaking the old 
automate-git.py. These are reasons it might be better to skip chrome 39, but 
chrome 41 doesn't run on my target.

> wget 
https://bitbucket.org/chromiumembedded/cef/raw/6aea0d499afad0aa3651d3e47d4de0217
e43e562/tools/automate/automate-git.py
> git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
> cd depot_tools
> git checkout e480fb766d761acf1559dfe6f0d2a8d0bd69c4e1
> cd ../..
> patch automate-git.py ~/automate-git-branches.patch
> python automate-git.py --download-dir=cef39 --branch=2171 --checkout=2171 
--depot-tools-dir=cef39/depot_tools --no-debug-build

Again I'm building on 32bit linux so specify '--no-debug-build' to avoid the 
linker running out of memory.

You need to copy slightly different things from the cef build. Now need 
cef_100_percent.pak not cef.pak. Now need libpdf.so and icudtl.dat.

icudtl.dat must be in same directory as executable, that means we need it in 
the same directories as both subprocess and python.
https://bitbucket.org/chromiumembedded/java-cef/issue/109

Use 'git am' to apply the patches but note the second one wouldn't apply with 
'git am' I had to use 'git apply' I don't know why, if it won't apply cleanly 
you can always use sed
> find . -type f -name \*.py -print0 | xargs -0 sed -i 
'/release_dcheck_enabled/d'

I haven't added it to pygtk_.py but for my application I needed js alerts to 
work, which now means implementing them yourself. Marshall ditched dependency 
on gtk, and thus ditched the default implementation of the dialog (it's now in 
cefclient).

Original issue reported on code.google.com by finn.hug...@gmail.com on 8 Jun 2015 at 3:03

Attachments:

GoogleCodeExporter commented 9 years ago
Extra notes:

OnBeforeResourceLoad needs updating with the new function prototype, we didn't 
need to implement the async functionality and just exposed the same interface 
in cefpython.

If you have a tabbed browser and close tabs you have a race condition caused by 
async x events. To prevent the X error generated from tearing down your process 
you have to handle the errors in subprocess. I copied Marshall's 
XErrorHandlerImpl and XIOErrorHandlerImpl functions from cefclient and had to 
patch Makefile to add '-lX11'. 

Original comment by finn.hug...@gmail.com on 17 Jun 2015 at 2:22