Skip to content

Commit 14ecc51

Browse files
authored
Merge pull request #3995 from OpenShot/linux-build-cleanup
Reducing size of AppImage (removing unused and duplicate files during freeze)
2 parents 3b38903 + 0c6606a commit 14ecc51

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

freeze.py

+23
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
# signtool sign /v /f OSStudiosSPC.pfx "OpenShot Video Editor-2.0.0-win32.msi"
5353

5454
import inspect
55+
import glob
5556
import os
5657
import sys
5758
import fnmatch
@@ -469,3 +470,25 @@ def find_files(directory, patterns):
469470
elif frozen_path.endswith(".app"):
470471
fix_rpath(os.path.join(build_path, frozen_path, "Contents", "MacOS"))
471472
print_min_versions(os.path.join(build_path, frozen_path, "Contents", "MacOS"))
473+
474+
elif sys.platform == "linux":
475+
# Linux issues with frozen folder
476+
# We need to remove some excess folders/files that are unneeded bloat
477+
build_path = os.path.join(PATH, "build")
478+
for frozen_path in os.listdir(build_path):
479+
if frozen_path.startswith("exe"):
480+
paths = ["lib/openshot_qt/",
481+
"lib/*opencv*",
482+
"lib/libopenshot*",
483+
"translations/",
484+
"locales/",
485+
"libQt5WebKit.so.5"]
486+
for path in paths:
487+
full_path = os.path.join(build_path, frozen_path, path)
488+
for remove_path in glob.glob(full_path):
489+
if os.path.isfile(remove_path):
490+
log.info("Removing unneeded file: %s" % remove_path)
491+
os.unlink(remove_path)
492+
elif os.path.isdir(remove_path):
493+
log.info("Removing unneeded folder: %s" % remove_path)
494+
rmtree(remove_path)

0 commit comments

Comments
 (0)