From 9fa27752f3284e09a9236adc1ad262a16f07a71f Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 16 Jul 2024 15:51:00 +0800 Subject: [PATCH] Allow setting of osx archs craft option in mac-crafter Signed-off-by: Claudio Cambra --- admin/osx/mac-crafter/Sources/main.swift | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 2ae6379fa..8d0e4cdd7 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -36,6 +36,9 @@ struct MacCrafter: ParsableCommand { @Option(name: [.short, .customLong("buildPath")], help: "Path for build files to be written.") var buildPath = "\(FileManager.default.currentDirectoryPath)/build" + @Option(name: [.short, .long], help: "Architecture.") + var arch = "arm64" + @Option(name: [.long], help: "Brew installation script URL.") var brewInstallShUrl = "https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh" @@ -106,7 +109,7 @@ struct MacCrafter: ParsableCommand { let craftMasterDir = "\(buildPath)/craftmaster" let craftMasterIni = "\(repoRootDir)/craftmaster.ini" let craftMasterPy = "\(craftMasterDir)/CraftMaster.py" - let craftTarget = "macos-clang-arm64" + let craftTarget = arch == "arm64" ? "macos-clang-arm64" : "macos-64-clang" let craftCommand = "python3 \(craftMasterPy) --config \(craftMasterIni) --target \(craftTarget) -c" @@ -140,6 +143,7 @@ struct MacCrafter: ParsableCommand { var craftOptions = [ "\(craftBlueprintName).srcDir=\(repoRootDir)", + "\(craftBlueprintName).osxArchs=\(arch)", "\(craftBlueprintName).buildTests=\(buildTests ? "True" : "False")", "\(craftBlueprintName).buildMacOSBundle=\(disableAppBundle ? "False" : "True")", "\(craftBlueprintName).buildFileProviderModule=\(buildFileProviderModule ? "True" : "False")" @@ -193,8 +197,6 @@ struct MacCrafter: ParsableCommand { } print("Code-signing Nextcloud Desktop Client libraries and frameworks...") - - let clientAppDir = "\(clientBuildDir)/image-\(buildType)-master/\(appName).app" try codesignClientAppBundle(at: clientAppDir, withCodeSignIdentity: codeSignIdentity)