Merge branch 'CURA-9365_fix_building_cura_main' of github.com:Ultimaker/Cura into CURA-9365_fix_building_cura_main

This commit is contained in:
Ghostkeeper 2022-06-30 17:48:19 +02:00
commit e069946c24
No known key found for this signature in database
GPG key ID: 68F39EA88EEED5FF
9 changed files with 53 additions and 42 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

View file

@ -1,13 +1,11 @@
import os
import subprocess
import shutil
SOURCE_DIR = os.environ.get("SOURCE_DIR", ".")
DIST_DIR = os.environ.get("DIST_DIR", os.path.join(SOURCE_DIR, "dist"))
INSTALLER_FILENAME = "Ultimaker-Cura.dmg"
DMG_PATH = INSTALLER_FILENAME
ULTIMAKER_CURA_APP_PATH = os.path.join("dist/Ultimaker-Cura.app")
DMG_PATH = "Ultimaker-Cura.dmg"
APP_PATH = "Ultimaker-Cura.app"
ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura")
@ -15,58 +13,59 @@ def build_dmg() -> None:
create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg")
arguments = [create_dmg_executable,
"--window-pos", "640", "360",
"--window-size", "690", "503",
"--app-drop-link", "520", "272",
"--volicon", f"{SOURCE_DIR}/packaging/VolumeIcons_Cura.icns",
"--icon-size", "90",
"--icon", "Ultimaker-Cura.app", "169", "272",
"--eula", f"{SOURCE_DIR}/packaging/cura_license.txt",
"--background", f"{SOURCE_DIR}/packaging/cura_background_dmg.png",
DMG_PATH,
DIST_DIR]
"--window-pos", "640", "360",
"--window-size", "690", "503",
"--app-drop-link", "520", "272",
"--volicon", f"{SOURCE_DIR}/packaging/icons/VolumeIcons_Cura.icns",
"--icon-size", "90",
"--icon", "Ultimaker-Cura.app", "169", "272",
"--eula", f"{SOURCE_DIR}/packaging/cura_license.txt",
"--background", f"{SOURCE_DIR}/packaging/icons/cura_background_dmg.png",
DMG_PATH,
APP_PATH]
subprocess.run(arguments)
def sign() -> None:
codesign_executable = os.environ.get("CODESIGN", "/usr/bin/codesign")
codesign_identity = os.environ.get("CODESIGN_IDENTITY", "test")
sign_command = f"""
{codesign_executable}
-s {codesign_identity}
--timestamp
-i {ULTIMAKER_CURA_DOMAIN}.dmg
{DMG_PATH}
"""
def sign(file_path: str) -> None:
codesign_executable = os.environ.get("CODESIGN", "codesign")
codesign_identity = os.environ.get("CODESIGN_IDENTITY", "A831301292FC30F84F3C137F2141401620EE5FA0")
subprocess.Popen(sign_command)
arguments = [codesign_executable,
"-s", codesign_identity,
"--timestamp",
"-i", f"{ULTIMAKER_CURA_DOMAIN}.dmg",
file_path]
subprocess.run(arguments)
def notarize() -> None:
notarize_user = os.environ.get("NOTARIZE_USER")
notarize_password = os.environ.get("NOTARIZE_PASSWORD")
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "/Applications/Xcode.app/Contents/Developer/usr/bin/altool")
notarize_command = f"""
xcrun {altool_executable}
--notarize-app
--primary-bundle-id {ULTIMAKER_CURA_DOMAIN}
--username {notarize_user}
--password {notarize_password}
--file {DMG_PATH}
"""
subprocess.Popen(notarize_command)
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "altool")
arguments = [
"xcrun", altool_executable,
"--notarize-app",
"--primary-bundle-id", ULTIMAKER_CURA_DOMAIN,
"--username", notarize_user,
"--password", notarize_password,
"--file", DMG_PATH
]
subprocess.run(arguments)
if __name__ == "__main__":
try:
os.rename(os.path.join(DIST_DIR, "Ultimaker-Cura"), os.path.join(DIST_DIR, "Ultimaker-Cura.app"))
except:
pass
sign(APP_PATH)
build_dmg()
sign()
sign(DMG_PATH)
# notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
# if notarize_dmg:
# notarize()

View file

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 56 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Before After
Before After

View file

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>