From: Claudio Cambra Date: Fri, 20 Sep 2024 10:42:32 +0000 (+0800) Subject: Create convenience function to convert architecture string to craft target string X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~11^2~4 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=a73e26a70b869f874e2214ebfa6ad8fdef614fe8;p=nextcloud-desktop.git Create convenience function to convert architecture string to craft target string Signed-off-by: Claudio Cambra --- diff --git a/admin/osx/mac-crafter/Sources/Utils/Craft.swift b/admin/osx/mac-crafter/Sources/Utils/Craft.swift new file mode 100644 index 000000000..738933f0e --- /dev/null +++ b/admin/osx/mac-crafter/Sources/Utils/Craft.swift @@ -0,0 +1,17 @@ +/* + * Copyright (C) 2024 by Claudio Cambra + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + */ + +func archToCraftTarget(_ arch: String) -> String { + return arch == "arm64" ? "macos-clang-arm64" : "macos-64-clang" +} diff --git a/admin/osx/mac-crafter/Sources/main.swift b/admin/osx/mac-crafter/Sources/main.swift index 87bb3e354..fada690b4 100644 --- a/admin/osx/mac-crafter/Sources/main.swift +++ b/admin/osx/mac-crafter/Sources/main.swift @@ -128,7 +128,7 @@ struct Build: ParsableCommand { let craftMasterDir = "\(buildPath)/craftmaster" let craftMasterIni = "\(repoRootDir)/craftmaster.ini" let craftMasterPy = "\(craftMasterDir)/CraftMaster.py" - let craftTarget = arch == "arm64" ? "macos-clang-arm64" : "macos-64-clang" + let craftTarget = archToCraftTarget(arch) let craftCommand = "python3 \(craftMasterPy) --config \(craftMasterIni) --target \(craftTarget) -c"