Merge branch 'CURA-9365_fix_building_cura_main' of github.com:Ultimaker/Cura into CURA-9365_fix_building_cura_main
Before Width: | Height: | Size: 35 KiB |
|
@ -1,13 +1,11 @@
|
||||||
import os
|
import os
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import shutil
|
||||||
|
|
||||||
SOURCE_DIR = os.environ.get("SOURCE_DIR", ".")
|
SOURCE_DIR = os.environ.get("SOURCE_DIR", ".")
|
||||||
DIST_DIR = os.environ.get("DIST_DIR", os.path.join(SOURCE_DIR, "dist"))
|
DIST_DIR = os.environ.get("DIST_DIR", os.path.join(SOURCE_DIR, "dist"))
|
||||||
|
DMG_PATH = "Ultimaker-Cura.dmg"
|
||||||
INSTALLER_FILENAME = "Ultimaker-Cura.dmg"
|
APP_PATH = "Ultimaker-Cura.app"
|
||||||
DMG_PATH = INSTALLER_FILENAME
|
|
||||||
ULTIMAKER_CURA_APP_PATH = os.path.join("dist/Ultimaker-Cura.app")
|
|
||||||
|
|
||||||
ULTIMAKER_CURA_DOMAIN = os.environ.get("ULTIMAKER_CURA_DOMAIN", "nl.ultimaker.cura")
|
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")
|
create_dmg_executable = os.environ.get("CREATE_DMG_EXECUTABLE", "create-dmg")
|
||||||
|
|
||||||
arguments = [create_dmg_executable,
|
arguments = [create_dmg_executable,
|
||||||
"--window-pos", "640", "360",
|
"--window-pos", "640", "360",
|
||||||
"--window-size", "690", "503",
|
"--window-size", "690", "503",
|
||||||
"--app-drop-link", "520", "272",
|
"--app-drop-link", "520", "272",
|
||||||
"--volicon", f"{SOURCE_DIR}/packaging/VolumeIcons_Cura.icns",
|
"--volicon", f"{SOURCE_DIR}/packaging/icons/VolumeIcons_Cura.icns",
|
||||||
"--icon-size", "90",
|
"--icon-size", "90",
|
||||||
"--icon", "Ultimaker-Cura.app", "169", "272",
|
"--icon", "Ultimaker-Cura.app", "169", "272",
|
||||||
"--eula", f"{SOURCE_DIR}/packaging/cura_license.txt",
|
"--eula", f"{SOURCE_DIR}/packaging/cura_license.txt",
|
||||||
"--background", f"{SOURCE_DIR}/packaging/cura_background_dmg.png",
|
"--background", f"{SOURCE_DIR}/packaging/icons/cura_background_dmg.png",
|
||||||
DMG_PATH,
|
DMG_PATH,
|
||||||
DIST_DIR]
|
APP_PATH]
|
||||||
|
|
||||||
subprocess.run(arguments)
|
subprocess.run(arguments)
|
||||||
|
|
||||||
|
|
||||||
def sign() -> None:
|
def sign(file_path: str) -> None:
|
||||||
codesign_executable = os.environ.get("CODESIGN", "/usr/bin/codesign")
|
codesign_executable = os.environ.get("CODESIGN", "codesign")
|
||||||
codesign_identity = os.environ.get("CODESIGN_IDENTITY", "test")
|
codesign_identity = os.environ.get("CODESIGN_IDENTITY", "A831301292FC30F84F3C137F2141401620EE5FA0")
|
||||||
|
|
||||||
sign_command = f"""
|
arguments = [codesign_executable,
|
||||||
{codesign_executable}
|
"-s", codesign_identity,
|
||||||
-s {codesign_identity}
|
"--timestamp",
|
||||||
--timestamp
|
"-i", f"{ULTIMAKER_CURA_DOMAIN}.dmg",
|
||||||
-i {ULTIMAKER_CURA_DOMAIN}.dmg
|
file_path]
|
||||||
{DMG_PATH}
|
|
||||||
"""
|
|
||||||
|
|
||||||
subprocess.Popen(sign_command)
|
subprocess.run(arguments)
|
||||||
|
|
||||||
|
|
||||||
def notarize() -> None:
|
def notarize() -> None:
|
||||||
|
|
||||||
notarize_user = os.environ.get("NOTARIZE_USER")
|
notarize_user = os.environ.get("NOTARIZE_USER")
|
||||||
notarize_password = os.environ.get("NOTARIZE_PASSWORD")
|
notarize_password = os.environ.get("NOTARIZE_PASSWORD")
|
||||||
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "/Applications/Xcode.app/Contents/Developer/usr/bin/altool")
|
altool_executable = os.environ.get("ALTOOL_EXECUTABLE", "altool")
|
||||||
|
|
||||||
notarize_command = f"""
|
arguments = [
|
||||||
xcrun {altool_executable}
|
"xcrun", altool_executable,
|
||||||
--notarize-app
|
"--notarize-app",
|
||||||
--primary-bundle-id {ULTIMAKER_CURA_DOMAIN}
|
"--primary-bundle-id", ULTIMAKER_CURA_DOMAIN,
|
||||||
--username {notarize_user}
|
"--username", notarize_user,
|
||||||
--password {notarize_password}
|
"--password", notarize_password,
|
||||||
--file {DMG_PATH}
|
"--file", DMG_PATH
|
||||||
"""
|
]
|
||||||
|
|
||||||
subprocess.Popen(notarize_command)
|
subprocess.run(arguments)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
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()
|
build_dmg()
|
||||||
sign()
|
sign(DMG_PATH)
|
||||||
|
|
||||||
# notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
|
# notarize_dmg = bool(os.environ.get("NOTARIZE_DMG", "TRUE"))
|
||||||
# if notarize_dmg:
|
# if notarize_dmg:
|
||||||
# notarize()
|
# notarize()
|
||||||
|
|
||||||
|
|
Before Width: | Height: | Size: 4.4 KiB After Width: | Height: | Size: 4.4 KiB |
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB |
12
packaging/signing/cura.entitlements
Normal 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>
|