Skip to content

Commit 9853a1e

Browse files
committed
Fix build on Linux
1 parent b1156d3 commit 9853a1e

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

docs/Build-instructions.md

+3-6
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ requirements common for all platforms.
183183

184184
### Linux
185185

186-
* Install packages: `sudo apt-get install python-dev cmake g++ libgtk2.0-dev libgtkglext1-dev`
186+
* Install packages: `sudo apt-get install cmake g++ libgtk2.0-dev libgtkglext1-dev`
187187
* If building CEF from sources:
188188
* Official binaries are built on Ubuntu 14.04 (cmake 2.8.12, g++ 4.8.4)
189189
* Download [ninja](http://martine.github.io/ninja/) 1.7.1 or later
@@ -200,11 +200,8 @@ requirements common for all platforms.
200200
[cef/BuildingOnDebian7.md](https://bitbucket.org/chromiumembedded/cef/wiki/BuildingOnDebian7.md) and
201201
[cef/#1575](https://bitbucket.org/chromiumembedded/cef/issues/1575),
202202
and [cef/#1697](https://bitbucket.org/chromiumembedded/cef/issues/1697)
203-
* If building CEF from sources, 32-bit on 64-bit machine:
204-
* Follow the configuration [here](https://bitbucket.org/chromiumembedded/cef/wiki/AutomatedBuildSetup.md#markdown-header-linux-configuration)
205-
* To perform a 32-bit Linux build on a 64-bit Linux system see
206-
Linux configuration in upstream cef/AutomatedBuildSetup.md. See also
207-
[cef/#1804](https://bitbucket.org/chromiumembedded/cef/issues/1804).
203+
* Building CEF 32-bit is only possible using cross-compiling on
204+
64-bit machine. See [Issue #328](https://github.com/cztomczak/cefpython/issues/328).
208205
* Sometimes it is also required to install these packages (eg. chroot):
209206
`sudo apt-get install libnss3 libnspr4 libxss1 libgconf-2-4`
210207

src/subprocess/cefpython_app.cpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
#include "common/cefpython_public_api.h"
1010
#endif
1111

12-
#if defined(OS_LINUX)
12+
#ifdef BROWSER_PROCESS
13+
#ifdef OS_LINUX
1314
#include <gtk/gtk.h>
15+
#include <gdk/gdk.h>
1416
#include <gdk/gdkx.h>
1517
#include "print_handler_gtk.h"
1618
#endif
19+
#endif
1720

1821
#include "cefpython_app.h"
1922
#include "util.h"
@@ -133,6 +136,7 @@ void CefPythonApp::OnRenderProcessThreadCreated(
133136
}
134137

135138
CefRefPtr<CefPrintHandler> CefPythonApp::GetPrintHandler() {
139+
#ifdef BROWSER_PROCESS
136140
#if defined(OS_LINUX)
137141
// For print handler to work GTK must be initialized. This is
138142
// required for some of the examples.
@@ -141,6 +145,7 @@ CefRefPtr<CefPrintHandler> CefPythonApp::GetPrintHandler() {
141145
LOG_DEBUG << "Initialize GTK";
142146
gtk_init(0, NULL);
143147
}
148+
#endif
144149
#endif
145150
return print_handler_;
146151
}

tools/automate.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
[--force-chromium-update FORCE_CHROMIUM_UPDATE]
3131
[--no-cef-update NO_CEF_UPDATE]
3232
[--cef-branch BRANCH] [--cef-commit COMMIT]
33-
[--build-dir BUILD_DIR] [--cef-build-dir CEF_BUIL_DDIR]
33+
[--build-dir BUILD_DIR] [--cef-build-dir CEF_BUILD_DIR]
3434
[--ninja-jobs JOBS] [--gyp-generators GENERATORS]
3535
[--gyp-msvs-version MSVS]
3636
automate.py (-h | --help) [type -h to show full description for options]
@@ -900,7 +900,7 @@ def run_command(command, working_dir, env=None):
900900
env = getenv()
901901
# When passing list of args shell cannot be True on eg. Linux, read
902902
# notes in build.py
903-
shell=(platform.system() == "Windows")
903+
shell = (platform.system() == "Windows")
904904
return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)
905905

906906

0 commit comments

Comments
 (0)