diff options
author | j.spijker@ultimaker.com <jelle spijker> | 2022-06-30 18:57:42 +0300 |
---|---|---|
committer | Jelle Spijker <j.spijker@ultimaker.com> | 2022-06-30 18:57:42 +0300 |
commit | cf1e2bd7af3c40337445e36c7c2aa70432e9c595 (patch) | |
tree | 02ec8ee7176a769dc42e2ef6746f0f21d599b007 | |
parent | 83bad98ea3abc13602fb8da7576fc866ce1c0541 (diff) |
Add conan_binaries to pyinstaller
Contributes to CURA-9365
-rw-r--r-- | Ultimaker-Cura.spec.jinja | 8 | ||||
-rw-r--r-- | conanfile.py | 8 |
2 files changed, 13 insertions, 3 deletions
diff --git a/Ultimaker-Cura.spec.jinja b/Ultimaker-Cura.spec.jinja index ae0636a4cf..e6ad23bd91 100644 --- a/Ultimaker-Cura.spec.jinja +++ b/Ultimaker-Cura.spec.jinja @@ -12,9 +12,11 @@ datas += tmp_ret[0]; binaries += tmp_ret[1]; hiddenimports += tmp_ret[2] block_cipher = None +{% for conan_binary in conan_binaries %}binaries += r'{{ conan_binary }}' +{% endfor %} a = Analysis( - ['{{ entrypoint }}'], + [r'{{ entrypoint }}'], pathex=[], binaries=binaries, datas=datas, @@ -35,7 +37,7 @@ exe = EXE( a.scripts, [], exclude_binaries=True, - name='{{ name }}', + name=r'{{ name }}', debug=False, bootloader_ignore_signals=False, strip=False, @@ -56,5 +58,5 @@ coll = COLLECT( strip=False, upx=True, upx_exclude=[], - name='{{ name }}' + name=r'{{ name }}' ) diff --git a/conanfile.py b/conanfile.py index 533b631abf..e5a5a7f41f 100644 --- a/conanfile.py +++ b/conanfile.py @@ -168,6 +168,13 @@ class CuraConan(ConanFile): for bin in src_path.glob(binary["binary"]): binaries.append((str(bin), binary["dst"])) + conan_binaries = [] + for _, dependency in self.dependencies.host.items(): + for bin_paths in dependency.cpp_info.bin_paths: + conan_binaries.extend(Path(bin_paths).glob("**/*.dll")) + conan_binaries.extend(Path(bin_paths).glob("**/*.dylib")) + conan_binaries.extend(Path(bin_paths).glob("**/*.so")) + with open(Path(__file__).parent.joinpath("Ultimaker-Cura.spec.jinja"), "r") as f: pyinstaller = Template(f.read()) @@ -177,6 +184,7 @@ class CuraConan(ConanFile): entrypoint = entrypoint_location, datas = datas, binaries = binaries, + conan_binaries = conan_binaries, hiddenimports = pyinstaller_metadata["hiddenimports"], collect_all = pyinstaller_metadata["collect_all"], icon = icon_path |