Allow setting of osx archs craft option in mac-crafter

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2024-07-16 15:51:00 +08:00
parent 2eaffc3b43
commit 9fa27752f3

View file

@ -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)