Skip to content

Commit

Permalink
Fix build on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
cztomczak committed Apr 5, 2017
1 parent b1156d3 commit 9853a1e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
9 changes: 3 additions & 6 deletions docs/Build-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ requirements common for all platforms.

### Linux

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

Expand Down
7 changes: 6 additions & 1 deletion src/subprocess/cefpython_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
#include "common/cefpython_public_api.h"
#endif

#if defined(OS_LINUX)
#ifdef BROWSER_PROCESS
#ifdef OS_LINUX
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <gdk/gdkx.h>
#include "print_handler_gtk.h"
#endif
#endif

#include "cefpython_app.h"
#include "util.h"
Expand Down Expand Up @@ -133,6 +136,7 @@ void CefPythonApp::OnRenderProcessThreadCreated(
}

CefRefPtr<CefPrintHandler> CefPythonApp::GetPrintHandler() {
#ifdef BROWSER_PROCESS
#if defined(OS_LINUX)
// For print handler to work GTK must be initialized. This is
// required for some of the examples.
Expand All @@ -141,6 +145,7 @@ CefRefPtr<CefPrintHandler> CefPythonApp::GetPrintHandler() {
LOG_DEBUG << "Initialize GTK";
gtk_init(0, NULL);
}
#endif
#endif
return print_handler_;
}
Expand Down
4 changes: 2 additions & 2 deletions tools/automate.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
[--force-chromium-update FORCE_CHROMIUM_UPDATE]
[--no-cef-update NO_CEF_UPDATE]
[--cef-branch BRANCH] [--cef-commit COMMIT]
[--build-dir BUILD_DIR] [--cef-build-dir CEF_BUIL_DDIR]
[--build-dir BUILD_DIR] [--cef-build-dir CEF_BUILD_DIR]
[--ninja-jobs JOBS] [--gyp-generators GENERATORS]
[--gyp-msvs-version MSVS]
automate.py (-h | --help) [type -h to show full description for options]
Expand Down Expand Up @@ -900,7 +900,7 @@ def run_command(command, working_dir, env=None):
env = getenv()
# When passing list of args shell cannot be True on eg. Linux, read
# notes in build.py
shell=(platform.system() == "Windows")
shell = (platform.system() == "Windows")
return subprocess.check_call(args, cwd=working_dir, env=env, shell=shell)


Expand Down

0 comments on commit 9853a1e

Please sign in to comment.