Install: Fix MacOs; Previous Windows fixes caused Mac build to fail.

part of CURA-11622
This commit is contained in:
Remco Burema 2024-12-11 16:17:18 +01:00
parent bec87b88dd
commit cca70d83da
2 changed files with 14 additions and 6 deletions

View file

@ -100,8 +100,6 @@ pyinstaller:
- "pyDulcificum" - "pyDulcificum"
- "pynest2d" - "pynest2d"
- "PyQt6" - "PyQt6"
- "PyQt6.Qt"
- "PyQt6.Qt6"
- "PyQt6.QtNetwork" - "PyQt6.QtNetwork"
- "PyQt6.sip" - "PyQt6.sip"
- "logging.handlers" - "logging.handlers"
@ -112,6 +110,9 @@ pyinstaller:
- "win32cred" - "win32cred"
- "win32timezone" - "win32timezone"
- "pkgutil" - "pkgutil"
hiddenimports_WINDOWS_ONLY:
- "PyQt6.Qt"
- "PyQt6.Qt6"
collect_all: collect_all:
- "cura" - "cura"
- "UM" - "UM"
@ -120,12 +121,13 @@ pyinstaller:
- "sqlite3" - "sqlite3"
- "trimesh" - "trimesh"
- "win32ctypes" - "win32ctypes"
- "PyQt6.Qt"
- "PyQt6.Qt6"
- "PyQt6.QtNetwork" - "PyQt6.QtNetwork"
- "PyQt6.sip" - "PyQt6.sip"
- "stl" - "stl"
- "keyrings.alt" - "keyrings.alt"
collect_all_WINDOWS_ONLY:
- "PyQt6.Qt"
- "PyQt6.Qt6"
icon: icon:
Windows: "./icons/Cura.ico" Windows: "./icons/Cura.ico"
Macos: "./icons/cura.icns" Macos: "./icons/cura.icns"

View file

@ -310,6 +310,12 @@ class CuraConan(ConanFile):
except Exception as ex: except Exception as ex:
print(f"WARNING: Attempt to delete binary {unwanted_path} results in: {str(ex)}") print(f"WARNING: Attempt to delete binary {unwanted_path} results in: {str(ex)}")
hiddenimports = pyinstaller_metadata["hiddenimports"]
collect_all = pyinstaller_metadata["collect_all"]
if self.settings.os == "Windows":
hiddenimports += pyinstaller_metadata["hiddenimports_WINDOWS_ONLY"]
collect_all += pyinstaller_metadata["collect_all_WINDOWS_ONLY"]
# Write the actual file: # Write the actual file:
with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f: with open(os.path.join(location, "UltiMaker-Cura.spec"), "w") as f:
f.write(pyinstaller.render( f.write(pyinstaller.render(
@ -319,8 +325,8 @@ class CuraConan(ConanFile):
datas = datas, datas = datas,
binaries = filtered_binaries, binaries = filtered_binaries,
venv_script_path = str(self._script_dir), venv_script_path = str(self._script_dir),
hiddenimports = pyinstaller_metadata["hiddenimports"], hiddenimports = hiddenimports,
collect_all = pyinstaller_metadata["collect_all"], collect_all = collect_all,
icon = icon_path, icon = icon_path,
entitlements_file = entitlements_file, entitlements_file = entitlements_file,
osx_bundle_identifier = "'nl.ultimaker.cura'" if self.settings.os == "Macos" else "None", osx_bundle_identifier = "'nl.ultimaker.cura'" if self.settings.os == "Macos" else "None",