From f2064cbd7c8fbdf934130410027c271d21ba586c Mon Sep 17 00:00:00 2001 From: kh1 Date: Tue, 25 Sep 2012 11:42:30 +0200 Subject: Incorporate following changes to support Qt5. d5e0dd38ead398d5be8126b4f21c0a50b7b61b17 72000567377d52d5d6e0db2b5d5b95407d85bbc1 Change-Id: I413f6f0ace095dc0d4b375cf392f8878e97ac27c Reviewed-by: Tim Jenssen --- src/libs/installer/macrelocateqt.cpp | 16 +++-- src/libs/installer/macrelocateqt.h | 2 +- src/libs/installer/qtpatchoperation.cpp | 24 +++++--- .../resources/files-to-patch-linux-emb-arm-qt5 | 70 ++++++++++++++++++++++ .../installer/resources/files-to-patch-linux-qt5 | 11 ++++ .../installer/resources/files-to-patch-macx-qt5 | 25 ++++++++ .../installer/resources/files-to-patch-windows-qt5 | 18 ++++++ src/libs/installer/resources/patch_file_lists.qrc | 3 + 8 files changed, 153 insertions(+), 16 deletions(-) create mode 100644 src/libs/installer/resources/files-to-patch-linux-emb-arm-qt5 create mode 100644 src/libs/installer/resources/files-to-patch-linux-qt5 create mode 100644 src/libs/installer/resources/files-to-patch-macx-qt5 create mode 100644 src/libs/installer/resources/files-to-patch-windows-qt5 diff --git a/src/libs/installer/macrelocateqt.cpp b/src/libs/installer/macrelocateqt.cpp index 0647c24e1..4ffdb8bd0 100644 --- a/src/libs/installer/macrelocateqt.cpp +++ b/src/libs/installer/macrelocateqt.cpp @@ -43,7 +43,7 @@ Relocator::Relocator() { } -bool Relocator::apply(const QString &qtInstallDir, const QString &targetDir) +bool Relocator::apply(const QString &qtInstallDir, const QString &targetDir, const QString &version) { // Relocator::apply(/Users/rakeller/QtSDKtest2/Simulator/Qt/gcc) // Relocator uses indicator: /QtSDKtest2operation 'QtPatch' with arguments: 'mac; /Users/rakeller/QtSDKtest2/Simulator/Qt/gcc' failed: Error while relocating Qt: "ReplaceInsta @@ -81,11 +81,15 @@ bool Relocator::apply(const QString &qtInstallDir, const QString &targetDir) operation.setComponentRootPath(qtInstallDir); QStringList arguments; arguments << indicator - << replacement - << qtInstallDir + QLatin1String("/plugins") - << qtInstallDir + QLatin1String("/lib") - << qtInstallDir + QLatin1String("/imports") - << qtInstallDir + QLatin1String("/bin"); + << replacement; + if (version.isEmpty()) { + arguments << qtInstallDir + QLatin1String("/plugins") + << qtInstallDir + QLatin1String("/lib") + << qtInstallDir + QLatin1String("/imports") + << qtInstallDir + QLatin1String("/bin"); + } else { + arguments << qtInstallDir; + } operation.setArguments(arguments); operation.performOperation(); diff --git a/src/libs/installer/macrelocateqt.h b/src/libs/installer/macrelocateqt.h index 769cb11aa..045847c41 100644 --- a/src/libs/installer/macrelocateqt.h +++ b/src/libs/installer/macrelocateqt.h @@ -42,7 +42,7 @@ class Relocator public: Relocator(); - bool apply(const QString &qtInstallDir, const QString &targetDir); + bool apply(const QString &qtInstallDir, const QString &targetDir, const QString &version); QString errorMessage() const { return m_errorMessage; } private: diff --git a/src/libs/installer/qtpatchoperation.cpp b/src/libs/installer/qtpatchoperation.cpp index c37bec8fe..cec0b84ed 100644 --- a/src/libs/installer/qtpatchoperation.cpp +++ b/src/libs/installer/qtpatchoperation.cpp @@ -139,10 +139,11 @@ bool QtPatchOperation::performOperation() // Arguments: // 1. type // 2. new/target qtpath + // 3. version if greather Qt4 - if (arguments().count() != 2) { + if (arguments().count() != 3) { setError(InvalidArguments); - setErrorString(tr("Invalid arguments in %0: %1 arguments given, 2 expected.").arg(name()) + setErrorString(tr("Invalid arguments in %0: %1 arguments given, 3 expected.").arg(name()) .arg(arguments().count())); return false; } @@ -157,7 +158,7 @@ bool QtPatchOperation::performOperation() "at this time.")); return false; } - + const QString newQtPathStr = QDir::toNativeSeparators(arguments().at(1)); const QByteArray newQtPath = newQtPathStr.toUtf8(); @@ -195,15 +196,20 @@ bool QtPatchOperation::performOperation() return false; } - QFile patchFileListFile; + QString fileName; if (type == QLatin1String("windows")) - patchFileListFile.setFileName(QLatin1String(":/files-to-patch-windows")); + fileName = QString::fromLatin1(":/files-to-patch-windows"); else if (type == QLatin1String("linux")) - patchFileListFile.setFileName(QLatin1String(":/files-to-patch-linux")); + fileName = QString::fromLatin1(":/files-to-patch-linux"); else if (type == QLatin1String("linux-emb-arm")) - patchFileListFile.setFileName(QLatin1String(":/files-to-patch-linux-emb-arm")); + fileName = QString::fromLatin1(":/files-to-patch-linux-emb-arm"); else if (type == QLatin1String("mac")) - patchFileListFile.setFileName(QLatin1String(":/files-to-patch-macx")); + fileName = QString::fromLatin1(":/files-to-patch-macx"); + + QFile patchFileListFile(fileName); + QString version = arguments().value(3).toLower(); + if (!version.isEmpty()) + patchFileListFile.setFileName(fileName + QLatin1Char('-') + version); if (!patchFileListFile.open(QFile::ReadOnly)) { setError(UserDefinedError); @@ -337,7 +343,7 @@ bool QtPatchOperation::performOperation() return false; } Q_CHECK_PTR(core); - successMacRelocating = relocator.apply(newQtPathStr, core->value(scTargetDir)); + successMacRelocating = relocator.apply(newQtPathStr, core->value(scTargetDir), version); if (!successMacRelocating) { setError(UserDefinedError); setErrorString(tr("Error while relocating Qt: %1").arg(relocator.errorMessage())); diff --git a/src/libs/installer/resources/files-to-patch-linux-emb-arm-qt5 b/src/libs/installer/resources/files-to-patch-linux-emb-arm-qt5 new file mode 100644 index 000000000..0ae1605de --- /dev/null +++ b/src/libs/installer/resources/files-to-patch-linux-emb-arm-qt5 @@ -0,0 +1,70 @@ +bin/qmake +bin/lrelease +%% +lib/libQtCore.la +lib/libQt3Support.la +lib/libQtCLucene.la +lib/libQtDBus.la +lib/libQtDeclarative.la +lib/libQtGui.la +lib/libQtHelp.la +lib/libQtMultimedia.la +lib/libQtNetwork.la +lib/libQtOpenGL.la +lib/libphonon.la +lib/libQtScript.la +lib/libQtScriptTools.la +lib/libQtSql.la +lib/libQtSvg.la +lib/libQtTest.la +lib/libQtWebKit.la +lib/libQtXml.la +lib/libQtXmlPatterns.la +demos/shared/libdemo_shared.prl +lib/libQt3Support.prl +lib/libQtAssistantClient.prl +lib/libQtCLucene.prl +lib/libQtCore.prl +lib/libQtDBus.prl +lib/libQtDesignerComponents.prl +lib/libQtDesigner.prl +lib/libQtDeclarative.prl +lib/libQtGui.prl +lib/libQtHelp.prl +lib/libQtMultimedia.prl +lib/libQtNetwork.prl +lib/libQtOpenGL.prl +lib/libQtScript.prl +lib/libQtScriptTools.prl +lib/libQtSql.prl +lib/libQtSvg.prl +lib/libQtTest.prl +lib/libQtUiTools.prl +lib/libQtWebKit.prl +lib/libQtXmlPatterns.prl +lib/libQtXml.prl +lib/libphonon.prl +lib/libqtmain.prl +lib/pkgconfig/phonon.pc +lib/pkgconfig/Qt3Support.pc +lib/pkgconfig/QtAssistantClient.pc +lib/pkgconfig/QtCLucene.pc +lib/pkgconfig/QtCore.pc +lib/pkgconfig/QtDBus.pc +lib/pkgconfig/QtDeclarative.pc +lib/pkgconfig/QtDesignerComponents.pc +lib/pkgconfig/QtDesigner.pc +lib/pkgconfig/QtGui.pc +lib/pkgconfig/QtHelp.pc +lib/pkgconfig/QtMultimedia.pc +lib/pkgconfig/QtNetwork.pc +lib/pkgconfig/QtOpenGL.pc +lib/pkgconfig/QtScript.pc +lib/pkgconfig/QtScriptTools.pc +lib/pkgconfig/QtSql.pc +lib/pkgconfig/QtSvg.pc +lib/pkgconfig/QtTest.pc +lib/pkgconfig/QtUiTools.pc +lib/pkgconfig/QtWebKit.pc +lib/pkgconfig/QtXmlPatterns.pc +lib/pkgconfig/QtXml.pc diff --git a/src/libs/installer/resources/files-to-patch-linux-qt5 b/src/libs/installer/resources/files-to-patch-linux-qt5 new file mode 100644 index 000000000..6b8b148fe --- /dev/null +++ b/src/libs/installer/resources/files-to-patch-linux-qt5 @@ -0,0 +1,11 @@ +bin/qmake +bin/lrelease +lib/libQtCore.so +%% +*.la +*.prl +*.pc +*.pri +lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake +mkspecs/default-host/qmake.conf + diff --git a/src/libs/installer/resources/files-to-patch-macx-qt5 b/src/libs/installer/resources/files-to-patch-macx-qt5 new file mode 100644 index 000000000..ae32610d5 --- /dev/null +++ b/src/libs/installer/resources/files-to-patch-macx-qt5 @@ -0,0 +1,25 @@ +bin/qmake +bin/lrelease +bin/lconvert +bin/lupdate +bin/macdeployqt +bin/qcollectiongenerator +bin/qdoc3 +bin/qhelpgenerator +bin/qt3to4 +bin/xmlpatterns +bin/xmlpatternsvalidator +lib/QtCore.framework/QtCore +bin/Designer.app/Contents/MacOS/Designer +bin/Linguist.app/Contents/MacOS/Linguist +bin/qhelpconverter.app/Contents/MacOS/qhelpconverter +bin/QMLViewer.app/Contents/MacOS/QMLViewer +bin/qttracereplay.app/Contents/MacOS/qttracereplay +%% +*.la +*.prl +*.pc +*.pri +lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake +mkspecs/default-host/qmake.conf + diff --git a/src/libs/installer/resources/files-to-patch-windows-qt5 b/src/libs/installer/resources/files-to-patch-windows-qt5 new file mode 100644 index 000000000..a2bae9369 --- /dev/null +++ b/src/libs/installer/resources/files-to-patch-windows-qt5 @@ -0,0 +1,18 @@ +bin/qmake.exe +bin/lrelease.exe +bin/QtCore5.dll +bin/QtCored5.dll +lib/QtCore5.dll +lib/QtCored5.dll +%% +*.la +*.prl +*.pc +*.pri +mkspecs/default/qmake.conf +mkspecs/default-host/qmake.conf +.qmake.cache +lib/cmake/Qt5LinguistTools/Qt5LinguistToolsConfig.cmake +lib/prl.txt + + diff --git a/src/libs/installer/resources/patch_file_lists.qrc b/src/libs/installer/resources/patch_file_lists.qrc index a51500369..26154dec2 100644 --- a/src/libs/installer/resources/patch_file_lists.qrc +++ b/src/libs/installer/resources/patch_file_lists.qrc @@ -3,5 +3,8 @@ files-to-patch-linux files-to-patch-windows files-to-patch-macx + files-to-patch-linux-qt5 + files-to-patch-windows-qt5 + files-to-patch-macx-qt5 -- cgit v1.2.3