-
-
Notifications
You must be signed in to change notification settings - Fork 575
Build on Linux
This page provides step by step instructions on how to build PHP Desktop Chrome for Linux from sources.
Table of Contents
- Requirements
- Download PHP Desktop sources
- Download CEF sources / prebuilt binaries
- Build cefclient and copy CEF files to phpdesktop
- Build PHP from sources
- Build phpdesktop-linux project
These instructions are for building the "linux70" branch (Chrome v70, CEF branch 3538).
Tested on Ubuntu 14.04 64-bit. Should work with newer versions as well.
Requirements:
- CMake 2.8.12.1
- G++ 4.8.4
- Ninja 1.7.2
Newer versions of tools should work, but if there are issues try downgrading.
Clone git repository and checkout the "linux70" branch.
If you would like to use CEF prebuilt binaries then go to Chromium Embedded Framework (CEF) Automated Builds. You have to download CEF for the same branch and revision that phpdesktop uses, see the CEF.Readme.txt
file that includes version details. Choose the "Standard Distribution" binaries.
If you would like to build CEF from sources then see CEF Branches and building (external) wiki page.
The CEF binaries downloaded from Spotify after extracting have the cef_binary_*
directory. From now on we will refer to this directory as "cef_binary/" directory.
- Install CMake 2.8.12.1 or newer from http://www.cmake.org/ .
- Download Ninja from https://github.com/ninja-build/ninja/releases . Put ninja in your PATH or copy it to the build/ directory you will be creating in the next step.
- In "cef_binary/" directory create a "build" subdirectory directory and enter it
- Execute
cmake -G "Ninja" -DCMAKE_BUILD_TYPE=Release -DUSE_SANDBOX=OFF ../
- Execute
ninja cefclient
- Go to the "cef_binary/build/tests/cefclient/Release/" directory and run cefclient executable to see if it works fine
- Create "phpdesktop/build/bin/" directory and copy files and subdirectories from the "cef_binary/Release/" and "cef_binary/Resources/" directories. Exclude "chrome-sandbox" file.
- Copy "cef_binary/build/libcef_dll_wrapper/libcef_dll_wrapper.a" library to the "phpdesktop/build/lib/" directory (create it).
- To clean the build directory just delete it. To only clean ninja build and keep cmake files intact type
ninja -t clean cefclient
. If you need DEBUG binaries re-run commands starting from step 6 withDCMAKE_BUILD_TYPE=Debug
and replace any "Release" directories mentioned with a "Debug" directory.
If you're building with version of CEF different from "CEF.Readme.txt" (eg. upgrading to a newer CEF) then delete the "phpdesktop/include/" directory and copy the "cef_binary/include/" directory there instead (ignore the "capi" subdirectory). Also overwrite "phpdesktop/CEF.Readme.txt" file with "cef_binary/README.txt".
- Go to http://php.net/downloads.php and download PHP sources
- Extract them to
build/php*/
directory - Run the
phpdesktop/build-php.sh
script. After script completes it will copy thephp-cgi
executable to thebuild/bin/
directory.
- Go to the
phpdesktop/
directory - Execute the
./build.sh
command - The
phpdesktop
executable will be created in thebuild/bin/
directory