Skip to content

Commit

Permalink
Merge pull request OpenShot#3012 from OpenShot/exclude-sys-libs
Browse files Browse the repository at this point in the history
AppImage builds: Exclude more system libs
  • Loading branch information
jonoomph authored Nov 19, 2019
2 parents c9af3a7 + e454178 commit ad1df9e
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def find_files(directory, patterns):
for library in lib_list:
p = subprocess.Popen(["ldd", library], stdout=subprocess.PIPE)
out, err = p.communicate()
depends = str(out).replace("\\t","").replace("\\n","\n").replace("\'","").split("\n")
depends = str(out).replace("\\t", "").replace("\\n", "\n").replace("\'", "").split("\n")

# Loop through each line of output (which outputs dependencies - one per line)
for line in depends:
Expand All @@ -227,13 +227,36 @@ def find_files(directory, patterns):
# Or if the dependency matches one of the following exceptions
# And ignore paths that start with /lib
libpath = libdetailsparts[0].strip()
libpath_folder, libpath_file = os.path.split(libpath)
if (libpath \
and not libpath.startswith("/lib") \
and not "libnvidia-glcore.so" in libpath \
and not libpath_file in ["libstdc++.so.6", "libGL.so.1", "libxcb.so.1", "libX11.so.6", "libasound.so.2", "libgcc_s.so.1 ", "libICE.so.6", "libp11-kit.so.0", "libSM.so.6", "libgobject-2.0.so.0", "libdrm.so.2"]) \
or libpath_file in ["libgcrypt.so.11", "libQt5DBus.so.5", "libpng12.so.0", "libbz2.so.1.0", "libqxcb.so"]:

libpath_file = os.path.basename(libpath)
if (libpath
and not libpath.startswith("/lib")
and "libnvidia-glcore.so" not in libpath
and libpath_file not in [
"libstdc++.so.6",
"libGL.so.1",
"libxcb.so.1",
"libX11.so.6",
"libX11-xcb.so.1",
"libasound.so.2",
"libgcc_s.so.1 ",
"libICE.so.6",
"libp11-kit.so.0",
"libSM.so.6",
"libgobject-2.0.so.0",
"libdrm.so.2",
"libfreetype.so.6",
"libfontconfig.so.1",
"libcairo.so.2",
"libpango-1.0.so.0",
"libpangocairo-1.0.so.0",
"libpangoft2-1.0.so.0",
"libharfbuzz.so.0",
"libthai.so.0",
]
and not libpath_file.startswith("libxcb-")
) \
or libpath_file in ["libgcrypt.so.11", "libQt5DBus.so.5", "libpng12.so.0", "libbz2.so.1.0", "libqxcb.so"]:

# Ignore missing files
if os.path.exists(libpath):
filepath, filename = os.path.split(libpath)
Expand Down

0 comments on commit ad1df9e

Please sign in to comment.