Tentative moving of dependency libraries over 'program' folder.

This commit is contained in:
emiliano.vavassori 2024-08-23 00:57:21 +02:00
parent d95257dd19
commit b79c47eb7b
1 changed files with 18 additions and 2 deletions

View File

@ -577,11 +577,22 @@ class Build():
r"apt download " + " ".join(debs) r"apt download " + " ".join(debs)
), cwd=downloadpath, check=True) ), cwd=downloadpath, check=True)
# then we install them inside the AppDir # then we install them inside a temporary path
temporary = os.path.abspath(os.path.join(downloadpath, 'temp'))
os.makedirs(temporary)
subprocess.run(shlex.split( subprocess.run(shlex.split(
r"find " + downloadpath + r" -iname \*.deb -exec dpkg -x {} " + self.appimagedir + r" \;" r"find " + downloadpath + r" -iname \*.deb -exec dpkg -x {} " + temporary + r" \;"
), cwd=self.builddir, check=True) ), cwd=self.builddir, check=True)
# We are finally copying the .so files in the same path as main_executable
subprocess.run(shlex.split(
f"cp -r * {os.path.dirname(main_executable)}"
), cwd = os.path.abspath(os.path.join(temporary, '/lib/x86_64-linux-gnu')), shell=True, check=True)
subprocess.run(shlex.split(
f"cp -r * {os.path.dirname(main_executable)}"
), cwd = os.path.abspath(os.path.join(temporary, '/usr/lib/x86_64-linux-gnu')), shell=True, check=True)
# Find the name of the binary called in the desktop file. # Find the name of the binary called in the desktop file.
binaryname = '' binaryname = ''
with open( with open(
@ -605,6 +616,11 @@ class Build():
r"-exec ln -sf {} ./%s \;" % binaryname r"-exec ln -sf {} ./%s \;" % binaryname
), cwd=bindir, check=True) ), cwd=bindir, check=True)
# Cleaning up AppDir
cleanup_dirs = [ 'etc', 'lib', 'lib64', 'usr/lib', 'usr/local' ]
for local in cleanup_dirs:
shutil.rmtree(os.path.abspath(os.path.join(self.appimagedir, local)))
# Download AppRun from github # Download AppRun from github
apprunurl = r"https://github.com/AppImage/AppImageKit/releases/" apprunurl = r"https://github.com/AppImage/AppImageKit/releases/"
apprunurl += f"download/continuous/AppRun-{self.arch}" apprunurl += f"download/continuous/AppRun-{self.arch}"