Make sure all dynamic libs are copied to the dist

Solve it dynamically in the Ultimaker-Cura.spec,
Such that we can copy files manually (OpenSSL shared)
to the bin/Script folder after the cura install step.

Contributes to CURA-9342
This commit is contained in:
j.spijker@ultimaker.com 2022-07-18 11:34:21 +02:00 committed by jspijker
parent 798facd63b
commit cd303b4e6f
2 changed files with 8 additions and 8 deletions

View file

@ -12,6 +12,13 @@ hiddenimports = {{ hiddenimports }}
datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2]
{% endfor %} {% endfor %}
# Add dynamic libs in the venv bin/Script Path. This is needed because we might copy some additional libs
# e.q.: OpenSSL 1.1.1l in that directory with a separate:
# `conan install openssl@1.1.1l -g deploy && cp openssl/bin/*.so cura_inst/bin`
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.so*")])
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dll")])
binaries.extend([(str(bin), ".") for bin in Path("{{ venv_script_path }}").glob("*.dylib")])
block_cipher = None block_cipher = None
a = Analysis( a = Analysis(

View file

@ -171,15 +171,7 @@ class CuraConan(ConanFile):
for bin in src_path.glob(binary["binary"]): for bin in src_path.glob(binary["binary"]):
binaries.append((str(bin), binary["dst"])) binaries.append((str(bin), binary["dst"]))
# Add dynamic libs in the venv bin/Script and lib Path. This is needed because we might copy some additional libs
# e.q.: OpenSSL 1.1.1l in that directory with a separate:
# `conan install openssl@1.1.1l -g deploy && cp openssl/bin/*.so cura_inst/bin`
for bin in self._script_dir.glob("*.[so|dll|dylib]"):
binaries.append(str(bin), ".")
for _, dependency in self.dependencies.items(): for _, dependency in self.dependencies.items():
# if dependency.ref.name == "cpython":
# continue
for bin_paths in dependency.cpp_info.bindirs: for bin_paths in dependency.cpp_info.bindirs:
binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dll")]) binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dll")])
binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dylib")]) binaries.extend([(f"{p}", ".") for p in Path(bin_paths).glob("**/*.dylib")])
@ -203,6 +195,7 @@ class CuraConan(ConanFile):
entrypoint = entrypoint_location, entrypoint = entrypoint_location,
datas = datas, datas = datas,
binaries = binaries, binaries = binaries,
venv_script_path = str(self._script_dir),
hiddenimports = pyinstaller_metadata["hiddenimports"], hiddenimports = pyinstaller_metadata["hiddenimports"],
collect_all = pyinstaller_metadata["collect_all"], collect_all = pyinstaller_metadata["collect_all"],
icon = icon_path, icon = icon_path,