/**************************************************************************** ** ** Copyright (C) 2024 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the release tools of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:GPL-EXCEPT$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and The Qt Company. For licensing terms ** and conditions see https://www.qt.io/terms-conditions. For further ** information use the contact form at https://www.qt.io/contact-us. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3 as published by the Free Software ** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT ** included in the packaging of this file. Please review the following ** information to ensure the GNU General Public License requirements will ** be met: https://www.gnu.org/licenses/gpl-3.0.html. ** ** $QT_END_LICENSE$ ** ****************************************************************************/ // constructor function Component() { // Add dynamic dependency for mingw TC for Android packages on Windows. if (installer.value("os") == "win") { var mingw_tc_component = "qt.tools.win64_mingw900" component.addDependency(mingw_tc_component); } // add automatic dependency to Android main node if it's selected dependencyStr = "qt.qt6.663.android" // For release builds set the dependency directly to the host binary var hostDependencyStr = ""; if (installer.value("os") == "x11") { // Linux on ARM supported from Qt 6.7 onward if ("663" == "dev" || 66 >= 67) { if (systemInfo.currentCpuArchitecture == "arm64") { hostDependencyStr = "qt.qt6.663.linux_gcc_arm64" } else { hostDependencyStr = "qt.qt6.663.linux_gcc_64" } } else { hostDependencyStr = "qt.qt6.663.gcc_64" } } else if (installer.value("os") == "mac") { hostDependencyStr = "qt.qt6.663.clang_64" } else if (installer.value("os") == "win") { hostDependencyStr = "qt.qt6.663.win64_mingw" } component.addDependency(hostDependencyStr); // Set automatic dependencies // - for release builds add dependency to the main Android node component.addAutoDependOn(dependencyStr); } Component.prototype.createOperations = function() { component.createOperations(); // Set path to QT to a variable var pathToQt = qtPathUnixSeparators("/6.6.3/android_arm64_v8a"); // patch qmake (.bat) component.addOperation("Replace", pathToQt + qmakeScript_663(), originalQmakePath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQmakePath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); // patch qt-cmake(.bat) component.addOperation("Replace", pathToQt + qtCMakeScript_663(), originalSetCmakePath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newSetCMakePath_663(), "regex"); // Patch build time CMAke paths from qt-cmake-private(.bat) script component.addOperation("Replace", pathToQt + qtCMakePrivateScript_663(), originalSetCmakePath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newSetCMakePath_663(), "regex"); // Patch qt-configure-module if (installer.value("os") === "x11") { component.addOperation("Replace", pathToQt + qtConfigureModuleScript_663(), original_QtProcessConfigureArgsCmakePath_663(), new_QtProcessConfigureArgsCmakePath_663()); } // If we are using executables from windows in unix environment we need to add // execute rights for those; windows doesn't set it automatically at creating phase. if (fromWindowsToUnixFlag_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64") == true) { console.log("Setting execute rights for needed files."); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qmakeScript_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtCMakeScript_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtPathsScript_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtCMakePrivateScript_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtCMakeStandaloneTestScript_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtConfigureModuleScript_663()); // scripts with '6' are available only from Qt 6.4.0 -> if ("663" == "dev" || 66 >= 64) { component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qmake6Script_663()); component.addOperation("Execute", "{0}", "chmod", "+x", pathToQt + qtPaths6Script_663()); } } // Patch Host Prefix, Host Data and Host Spec paths from target_qt.conf component.addOperation("Replace", pathToQt + targetQtConf_663(), originalHostPrefix_663(), newHostPrefix_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); component.addOperation("Replace", pathToQt + targetQtConf_663(), originalHostData_663(), newHostData_663("arm64_v8a")); component.addOperation("Replace", pathToQt + targetQtConf_663(), originalHostSpec_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newHostSpec_663()); // Patch HostLibraryExecutables from target_qt.conf component.addOperation("LineReplace", pathToQt + targetQtConf_663(), "HostLibraryExecutables=", "HostLibraryExecutables=" + newHostLibExecutables_663()); // Append target_qt.conf with relative paths to documentation and examples component.addOperation("AppendFile", pathToQt + targetQtConf_663(), targetQtConfDocumentation_663("6.6.3")); // Add a new line to targetQtConf which AppendFile operation doesn't add automatically if (installer.value("os") == "win") { // \r\n = CR + LF used as a new line character in Windows component.addOperation("AppendFile", pathToQt + targetQtConf_663(), "\r\n"); } else { // \n = LF (Line Feed) used as a new line character in Unix/macOS component.addOperation("AppendFile", pathToQt + targetQtConf_663(), "\n"); } component.addOperation("AppendFile", pathToQt + targetQtConf_663(), targetQtConfExamples_663("6.6.3")); // Patch Qt install path from qt.toolchain.cmake component.addOperation("Replace", pathToQt + qtToolchainCmake_663(), originalQtHostPath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQtHostPath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); // Patch Qt install paths from QtBuildInternalsExtra.cmake component.addOperation("Replace", pathToQt + qtBuildInternalsExtraCmake_663(), originalBIPrefix_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), installer.value("TargetDir")); component.addOperation("Replace", pathToQt + qtBuildInternalsExtraCmake_663(), originalHostTargetPath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), pathToQt); // Patch Qt install path from qtpaths(.bat) component.addOperation("Replace", pathToQt + qtPathsScript_663(), originalQtPathsPath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQtPathsPath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); if ("663" == "dev" || 66 >= 64) { // Patch Qt install path from Qt6Dependencies.cmake if file exist; it isn't available before Qt 6.4.0 component.addOperation("Replace", pathToQt + qt6DependenciesCMakePath_663(), originalQtHostPath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQtHostPath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); // patch qmake6(.bat) if file exist; it isn't available before Qt 6.4.0 component.addOperation("Replace", pathToQt + qmake6Script_663(), originalQmakePath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQmakePath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); // Patch Qt install path from qtpaths6(.bat) if file exist; it isn't available before Qt 6.4.0 component.addOperation("Replace", pathToQt + qtPaths6Script_663(), originalQtPathsPath_663("MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64"), newQtPathsPath_663("6.6.3", "MacOS-MacOS_13-Clang-Android-Android_ANY-ARM64")); } // Patch default ndk host from qdevice.pri component.addOperation("LineReplace", pathToQt + qdeviceFile_663(), "DEFAULT_ANDROID_NDK_HOST =", "DEFAULT_ANDROID_NDK_HOST = " + newNDKHost_663()); addInitQtPatchOperation(component, platformIdentification_663(), pathToQt, pathToQt + qmakeScript_663(), "emb-arm-qt5"); if (installer.value("SDKToolBinary") == "") return; // add Qt into QtCreator component.addOperation("Execute", ["@SDKToolBinary@", "addQt", "--id", component.name, "--name", "Qt %{Qt:Version} for Android ARM64-v8a", "--type", "Qt4ProjectManager.QtVersion.Android", "--qmake", pathToQt + qmakeScript_663(), "UNDOEXECUTE", "@SDKToolBinary@", "rmQt", "--id", component.name]); // create qt.conf file createQtConfFiles(component, installer.value("TargetDir") + "/6.6.3/android_arm64_v8a", "Qt-6.6.3"); // patch qconfig.pri // is this OpenSource installation? var isOpenSource = "false"; if (['true', 'yes', '1'].indexOf(isOpenSource) >= 0) { component.addOperation("LineReplace", pathToQt + qconfigFile_663(), "QT_EDITION =", "QT_EDITION = OpenSource"); } }