Skip to content

Commit 03e9515

Browse files
committed
Feed cefpythonapp before cef/cef_dll_wrapper to the linker (cztomczak#230)...
Update automate.py - disable NACL and use sysroot, as per instructions in cef/AutomatedBuildSetup.md. Disable sandboxing for the subprocesses. Update build-instructions for Linux.
1 parent bc3b9aa commit 03e9515

File tree

6 files changed

+21
-28
lines changed

6 files changed

+21
-28
lines changed

docs/Build-instructions.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,18 +52,7 @@ __Linux__
5252

5353
* Install packages: `sudo apt-get install cmake g++`
5454
* If building CEF from sources:
55-
* Download and install cmake 2.8.12 or later (unless you already have a
56-
proper version, check with cmake --version):
57-
```
58-
cd build/
59-
wget http://www.cmake.org/files/v2.8/cmake-2.8.12.2.tar.gz
60-
tar xzf cmake-2.8.12.2.tar.gz
61-
cd cmake-2.8.12.2
62-
./configure
63-
make
64-
sudo make install
65-
# restart terminal, so that new cmake is used
66-
```
55+
* Official binaries are build on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4)
6756
* Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
6857
and copy it to /usr/bin and chmod 755.
6958
* When building CEF from sources you will need to install many more packages
@@ -72,8 +61,6 @@ proper version, check with cmake --version):
7261
* See also the Linux configuration for CEF automated
7362
builds on the [cef/AutomatedBuildSetup.md](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
7463
wiki page.
75-
* Building on Ubuntu 12.04 is supported up to branch 2526 (Chrome 47).
76-
For branches 2623 (Chrome 49) or later Ubuntu 14.04+ is required.
7764
* To build on Debian 7 see
7865
[cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and
7966
[cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575),

src/cefpython.pyx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -572,9 +572,8 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
572572
if not "single_process" in applicationSettings:
573573
applicationSettings["single_process"] = False
574574

575-
cdef CefRefPtr[CefApp] cefApp
575+
cdef CefRefPtr[CefApp] cefApp = <CefRefPtr[CefApp]?>new CefPythonApp()
576576

577-
cefApp = <CefRefPtr[CefApp]?>new CefPythonApp()
578577
IF UNAME_SYSNAME == "Windows":
579578
cdef HINSTANCE hInstance = GetModuleHandle(NULL)
580579
cdef CefMainArgs cefMainArgs = CefMainArgs(hInstance)
@@ -598,6 +597,8 @@ def Initialize(applicationSettings=None, commandLineSwitches=None):
598597
g_applicationSettings[key] = copy.deepcopy(applicationSettings[key])
599598

600599
cdef CefSettings cefApplicationSettings
600+
# No sandboxing for the subprocesses
601+
cefApplicationSettings.no_sandbox = 1
601602
SetApplicationSettings(applicationSettings, &cefApplicationSettings)
602603

603604
if commandLineSwitches:

src/cython_includes/cef_types.pxd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ cdef extern from "include/internal/cef_types.h":
4747
int persist_user_preferences
4848
cef_string_t user_data_path
4949
int windowless_rendering_enabled
50+
int no_sandbox
5051

5152
ctypedef struct CefBrowserSettings:
5253
cef_string_t accept_language_list

src/linux/setup/setup.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,22 @@ def CompileTimeConstants():
6868

6969
# http_authentication not implemented on Linux.
7070
library_dirs=[
71+
r'./../binaries_%s' % BITS,
7172
r'./lib_%s' % BITS,
7273
r'./../../client_handler/',
7374
r'./../../subprocess/', # libcefpythonapp
7475
r'./../../cpp_utils/'
7576
],
7677

7778
libraries=[
78-
'cef_dll_wrapper',
79-
# 'v8function_handler',
80-
'client_handler',
79+
# Feed cefpythonapp before cef/cef_dll_wrapper to the linker,
80+
# otherwise an "undefined symbol" error may occur when importing
81+
# the cefpython .so module (Issue #230).
8182
'cefpythonapp',
83+
'client_handler',
8284
'cpp_utils',
85+
'cef',
86+
'cef_dll_wrapper',
8387
'gtk-x11-2.0',
8488
],
8589

src/subprocess/Makefile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,11 @@ INC = -I./../ -I/usr/include/gtk-2.0 \
1616
-I/usr/lib/glib-2.0/include -I/usr/lib/gtk-2.0/include
1717

1818
ifeq ($(UNAME_S), Linux)
19-
LIB = -L./../linux/setup/lib_64bit -L./../linux/setup/lib_32bit \
20-
-L./../linux/binaries_64bit -L./../linux/binaries_32bit
19+
LIB = -L./../linux/binaries_64bit -L./../linux/binaries_32bit \
20+
-L./../linux/setup/lib_64bit -L./../linux/setup/lib_32bit
2121
else ifeq ($(UNAME_S), Darwin)
22-
LIB = -L./../mac/setup/lib_64bit -L./../mac/setup/lib_32bit \
23-
-L./../mac/binaries_64bit/ \
24-
-L./../mac/binaries_32bit/
22+
LIB = -L./../mac/binaries_64bit/ -L./../mac/binaries_32bit/ \
23+
-L./../mac/setup/lib_64bit -L./../mac/setup/lib_32bit
2524
endif
2625

2726
CCFLAGS = -g -Wall -Werror -DRENDERER_PROCESS $(CEF_CCFLAGS)
@@ -31,4 +30,4 @@ subprocess:
3130
# -fPIC is required only for libraries included by Cython.
3231
g++ $(CCFLAGS) $(INC) $(LIB) main.cpp cefpython_app.cpp \
3332
v8function_handler.cpp v8utils.cpp javascript_callback.cpp \
34-
-lcef_dll_wrapper -lcef -o subprocess -Wl,-rpath,.
33+
-lcef -lcef_dll_wrapper -o subprocess -Wl,-rpath,.

tools/automate.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Copyright (c) 2016 CEF Python, see the Authors file. All rights reserved.
22

3-
# TODO: add GYP_DEFINES: disable_nacl=1 use_sysroot=1 (AutomatedBuildSetup)
43
# TODO: run automate-git.py using Python 2.7 from depot_tools
54

65
"""Build CEF Python and use prebuilt CEF binaries or build CEF from sources.
@@ -447,8 +446,10 @@ def getenv():
447446
env["GYP_GENERATORS"] = Options.gyp_generators
448447
if platform.system() == "Windows":
449448
env["GYP_MSVS_VERSION"] = Options.gyp_msvs_version
450-
# Issue73 patch applied
451-
env["GYP_DEFINES"] = "use_allocator=none"
449+
# See cef/AutomatedBuildSetup.md for reference.
450+
# Issue73 patch applied with "use_allocator=none"
451+
# TODO: 32-bit gyp defines: host_arch=x86_64 target_arch=ia32
452+
env["GYP_DEFINES"] = "disable_nacl=1 use_sysroot=1 use_allocator=none"
452453
# To perform an official build set GYP_DEFINES=buildtype=Official.
453454
# This will disable debugging code and enable additional link-time
454455
# optimizations in Release builds.

0 commit comments

Comments
 (0)