Skip to content

Commit e3dfa6a

Browse files
committed
Fixed debian packages on Linux to work with the new CEF which requires the .so libraries
to be in the same directory in which the subprocess executable resides.
1 parent 37a3c2d commit e3dfa6a

4 files changed

Lines changed: 318 additions & 60 deletions

File tree

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

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,30 @@
11
import ctypes, os
22

33
# If this is a debian package then package_dir is a symlink:
4-
# /usr/lib/pymodules/python2.7/cefpython3
5-
# Cefpython3 files including executables are located in:
6-
# /usr/share/pyshared/cefpython3
7-
# Cefpython3 .so libraries are located in:
8-
# /usr/lib/pyshared/python2.7/cefpython3
4+
# /usr/lib/pymodules/python2.7/cefpython3/
5+
# The real directory in which cefpython files are located is:
6+
# /usr/share/pyshared/cefpython3/
97

8+
# Package dir will be /usr/lib/pymodules/python2.7/cefpython3/
9+
# when using the debian package. For the distutils setup it
10+
# will be /usr/local/lib/python2.7/dist-packages/cefpython3/.
1011
package_dir = os.path.dirname(os.path.abspath(__file__))
1112

12-
# This loads the libcef.so library for the main python executable.
13+
# This loads the libcef.so library for the python process.
1314
libcef_so = os.path.join(package_dir, "libcef.so")
1415
ctypes.CDLL(libcef_so, ctypes.RTLD_GLOBAL)
1516

16-
# Other .so libraries may also be required
17+
# Other .so libraries may also be required.
18+
# Loading the libffmpegsumo.so library is probably redundant to
19+
# load for the python process, as it shows from testing. It is
20+
# only loaded by the subprocess executable with the use of the
21+
# LD_LIBRARY_PATH env variable. But just to be sure let's load
22+
# it as well for future proof.
1723
libffmpegsumo_so = os.path.join(package_dir, "libffmpegsumo.so")
1824
ctypes.CDLL(libffmpegsumo_so, ctypes.RTLD_GLOBAL)
1925

20-
# This loads the libcef.so library for the subprocess executable.
26+
# This will allow the subprocess executable to load the libcef.so
27+
# and libffmpeg.so libraries.
2128
os.environ["LD_LIBRARY_PATH"] = package_dir
2229

2330
# This env variable will be returned by cefpython.GetModuleDirectory().
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/bin/sh
2+
3+
# Exit immediately if a command exits with a non-zero status
4+
set -e
5+
6+
# Permissions for the executable files
7+
chmod 755 /usr/share/pyshared/cefpython3/cefclient
8+
chmod 755 /usr/share/pyshared/cefpython3/subprocess
9+
10+
# Permissions for the examples - debug.log is created.
11+
# If you want to run the cefclient executable you may
12+
# also have to chmod 777 /usr/share/pyshared/cefpython3/.
13+
chmod 777 /usr/share/pyshared/cefpython3/examples/
14+
chmod 777 /usr/share/pyshared/cefpython3/examples/wx/
15+
16+
# This creates symbolic links in /usr/lib/pymodules/.../cefpython3/
17+
# for all the files. This is no more required, as in make-deb.py
18+
# we're modify the deb archive and moving the /usr/lib/pyshared/.../
19+
# .so files to the /usr/share/pyshared/.../ directory. Read the
20+
# comments in make-deb.py why it needs to be done so.
21+
# Let's keep the creation of symlinks for backwards compatibility.
22+
if which update-python-modules >/dev/null 2>&1; then
23+
update-python-modules python-cefpython3.public
24+
fi

0 commit comments

Comments
 (0)