diff --git a/src/loaih/build.py b/src/loaih/build.py index ba38f6c..861cb33 100644 --- a/src/loaih/build.py +++ b/src/loaih/build.py @@ -585,13 +585,12 @@ class Build(): ), 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 -fr * {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) - + libdirs = [ 'lib/x86_64-linux-gnu', 'usr/lib/x86_64-linux-gnu' ] + for libdir in libdirs: + fulllibdir = os.path.abspath(os.path.join(temporary, libdir)) + subprocess.run(shlex.split( + r"find " + fulllibdir + r" -type f -iname \*.so\* -exec cp {} " + os.path.dirname(main_executable) + r"/ \;" + ), cwd=temporary, check=True) # Find the name of the binary called in the desktop file. binaryname = ''