Skip to content

Commit de55ed3

Browse files
CzarekCzarek
authored andcommitted
Linux packaging and install for CEF 3.
1 parent ec8c5a8 commit de55ed3

3 files changed

Lines changed: 39 additions & 2 deletions

File tree

cefpython/cef3/linux/installer/__init__.py.template

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import ctypes, os
2-
libcef_so = os.path.join(os.path.dirname(os.path.abspath(__file__)), "libcef.so")
2+
3+
package_dir = os.path.dirname(os.path.abspath(__file__))
4+
5+
# This loads the libcef.so library for the main python executable.
6+
libcef_so = os.path.join(package_dir, "libcef.so")
37
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
8+
# Other .so libraries may also be required
9+
libffmpegsumo_so = os.path.join(package_dir, "libffmpegsumo.so")
10+
ctypes.CDLL(libffmpegsumo_so, ctypes.RTLD_GLOBAL)
11+
12+
# This loads the libcef.so library for the subprocess executable.
13+
os.environ["LD_LIBRARY_PATH"] = package_dir
414

515
import sys
616
if 0x02070000 <= sys.hexversion < 0x03000000:

cefpython/cef3/linux/installer/setup.py.template

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,30 @@ setup(
2525
'*.pak',
2626
]}
2727
)
28+
29+
# ------------------------------------------------------------------------------
30+
# Chmod +x the subprocess and cefclient executables.
31+
# ------------------------------------------------------------------------------
32+
33+
import sys
34+
import os
35+
import subprocess
36+
37+
# Import the cefpython3 module from dist-packages/ directory.
38+
# We do not want to import from the local "cefpython3" directory.
39+
del sys.path[0]
40+
sys.path.append('')
41+
import cefpython3
42+
43+
package_dir = os.path.dirname(cefpython3.__file__)
44+
# Make sure this is not a local package imported.
45+
assert not package_dir.startswith(os.path.dirname(os.path.abspath(__file__)))
46+
47+
subprocess_exe = os.path.join(package_dir, "subprocess")
48+
cefclient_exe = os.path.join(package_dir, "cefclient")
49+
50+
print("chmod +x " + subprocess_exe)
51+
subprocess.call("chmod +x "+subprocess_exe, shell=True)
52+
53+
print("chmod +x " + cefclient_exe)
54+
subprocess.call("chmod +x "+cefclient_exe, shell=True)

cefpython/cef3/subprocess/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ LIB = -L./../linux/setup/lib_64bit -L./../linux/setup/lib_32bit
99
subprocess:
1010
# Cython compiler options:
1111
# -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro
12-
g++ -fPIC $(INC) $(LIB) main.cpp -lcef_dll_wrapper -lcef -o subprocess -Wl,-rpath -Wl,./
12+
g++ -fPIC $(INC) $(LIB) main.cpp -lcef_dll_wrapper -lcef -o subprocess -Wl,-rpath,.

0 commit comments

Comments
 (0)