Merge pull request #1447 from mcallegari/master

qt5-git: enable qtscxml module and remove patch 0047
This commit is contained in:
Alexpux
2016-06-01 09:48:15 +04:00
2 changed files with 2 additions and 157 deletions

View File

@@ -1,152 +0,0 @@
diff -urN qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/configureapp.cpp qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/configureapp.cpp
--- qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/configureapp.cpp 2015-08-26 14:29:09.999124600 +0100
+++ qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/configureapp.cpp 2015-08-26 15:41:02.749516900 +0100
@@ -3448,6 +3448,9 @@
// FIXME: add detection
configStream << " QMAKE_DEFAULT_LIBDIRS = /lib /usr/lib" << endl;
configStream << " QMAKE_DEFAULT_INCDIRS = /usr/include /usr/local/include" << endl;
+ } else {
+ configStream << " QMAKE_DEFAULT_LIBDIRS = " << Environment::detectCompilerDefaultLibDirs() << endl;
+ configStream << " QMAKE_DEFAULT_INCDIRS = " << Environment::detectCompilerDefaultIncDirs() << endl;
}
configStream << "}" << endl;
configStream << "QT_CONFIG += " << qtConfig.join(' ') << endl;
diff -urN qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/environment.cpp qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/environment.cpp
--- qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/environment.cpp 2015-08-26 14:29:10.004624600 +0100
+++ qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/environment.cpp 2015-08-26 15:41:02.742516900 +0100
@@ -40,6 +40,8 @@
#include <qfile.h>
#include <qfileinfo.h>
#include <qstandardpaths.h>
+#include <qtemporaryfile.h>
+#include <qregularexpression.h>
#include <process.h>
#include <errno.h>
@@ -249,6 +251,112 @@
#endif
};
+/* Returns the exit-code. */
+int Environment::compileSomething(const QString &flags, const QString &code, QString &stdOut, QString &stdErr)
+{
+ CompilerInfo *info = compilerInfo(detectCompiler());
+ int returnCode = 1;
+ if (info) {
+ QTemporaryFile tmpIn("conftestXXXXXX.cpp");
+ QString tmpOutFileName;
+ {
+ QTemporaryFile tmpOut("conftestXXXXXX.o");
+ tmpOut.open();
+ tmpOut.close();
+ tmpOutFileName = tmpOut.fileName();
+ }
+ QString tmpStdErrFileName;
+ {
+ QTemporaryFile tmpStdErr("conftestXXXXXX.stderr");
+ tmpStdErr.open();
+ tmpStdErr.close();
+ tmpStdErrFileName = tmpStdErr.fileName();
+ }
+ if (tmpIn.open()) {
+ tmpIn.write(code.toUtf8());
+ tmpIn.close();
+ QString cmd = info->executable + QString(" ") + flags
+ + QString(" -o ") + tmpOutFileName
+ + QString(" ") + tmpIn.fileName() + " 2>" + tmpStdErrFileName;
+ stdOut = Environment::execute(cmd, &returnCode);
+ QFile tmpStdErr(tmpStdErrFileName);
+ if (tmpStdErr.open(QIODevice::ReadOnly | QIODevice::Text)) {
+ stdErr = tmpStdErr.readAll();
+ tmpStdErr.close();
+ tmpStdErr.remove();
+ }
+ QFile::remove(tmpOutFileName);
+ }
+ }
+ return returnCode;
+}
+
+QString Environment::detectCompilerDefaultIncDirs()
+{
+ QString stdOut;
+ QString stdErr;
+ int returnCode = Environment::compileSomething("-v ", "", stdOut, stdErr);
+ QStringList result;
+ int index = stdErr.indexOf("<...>");
+ if (index != -1) {
+ index = stdErr.indexOf("\n", index);
+ int lastIndex = index;
+ while (lastIndex != -1) {
+ if (stdErr[lastIndex + 1] != ' ')
+ break;
+ lastIndex += 2;
+ index = stdErr.indexOf("\n", lastIndex + 1);
+ if (index != -1) {
+ const QString newPath(QDir::cleanPath(stdErr.mid(lastIndex, index - lastIndex)));
+ if (result.indexOf(newPath) == -1)
+ result.append(newPath);
+ }
+ lastIndex = index;
+ }
+ }
+ Q_UNUSED(returnCode);
+ QString resultString;
+ for (int i = 0; i < result.count(); ++i) {
+ resultString.append(result[i]);
+ if ( i != result.count() - 1)
+ resultString.append(" ");
+ }
+ return resultString;
+}
+
+QString Environment::detectCompilerDefaultLibDirs()
+{
+ QString stdOut;
+ QString stdErr;
+ int returnCode = Environment::compileSomething("-v ", "", stdOut, stdErr);
+ QStringList result;
+ int index = stdErr.indexOf("LIBRARY_PATH");
+ if (index != -1) {
+ index += strlen("LIBRARY_PATH");
+ int lastIndex = index;
+ while (lastIndex != -1) {
+ if (stdErr[lastIndex + 1] == '\n')
+ break;
+ index = stdErr.indexOf(";", lastIndex + 1);
+ if (index != -1) {
+ const QString newPath(QDir::cleanPath(stdErr.mid(lastIndex + 1, index - lastIndex - 1)));
+ if (result.indexOf(newPath) == -1)
+ result.append(newPath);
+ }
+ lastIndex = index;
+ }
+ }
+ Q_UNUSED(returnCode);
+ QString resultString;
+ for (int i = 0; i < result.count(); ++i) {
+ resultString.append(result[i]);
+ if ( i != result.count() - 1)
+ resultString.append(" ");
+ }
+ return resultString;
+}
+
+
/*!
Creates a commandling from \a program and it \a arguments,
escaping characters that needs it.
diff -urN qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/environment.h qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/environment.h
--- qt-everywhere-opensource-src-5.5.0.orig/qtbase/tools/configure/environment.h 2015-08-26 14:29:10.018624600 +0100
+++ qt-everywhere-opensource-src-5.5.0/qtbase/tools/configure/environment.h 2015-08-26 15:41:02.735516900 +0100
@@ -58,6 +58,10 @@
static Compiler compilerFromQMakeSpec(const QString &qmakeSpec);
static QString gccVersion();
+ static int compileSomething(const QString &flags, const QString &code, QString &stdOut, QString &stdErr);
+ static QString detectCompilerDefaultIncDirs();
+ static QString detectCompilerDefaultLibDirs();
+
static int execute(QStringList arguments, const QStringList &additionalEnv, const QStringList &removeEnv);
static QString execute(const QString &command, int *returnCode = 0);
static bool cpdir(const QString &srcDir, const QString &destDir);

View File

@@ -6,7 +6,7 @@ _qt_git_repo=https://code.qt.io/qt
#_qt_git_repo=https://github.com/qtproject
# The Qt5 GIT branch to clone and build (replace with 'dev' to build the bleeding edge sources)
_qt_git_branch=5.7
_qt_git_branch=5.7.0
# The way Qt5 libraries are built. Possible values are '-release', '-debug' or '-debug_and_release'
_build_mode=-release
@@ -118,7 +118,7 @@ qt_modules=(
qtquickcontrols
qtquickcontrols2
qtscript
#qtscxml
qtscxml
qtsensors
qtserialbus
qtserialport
@@ -163,7 +163,6 @@ source=(
0043-static-cmake-regex-QT_INSTALL_LIBS-in-QMAKE_PRL_LIBS_FOR_CMAKE.patch
0045-static-use-qminimal-platform-plugin-for-qcollectiongenerator.patch
0046-Revert-Revert-fix-NTFS-mount-points.patch
0047-Emit-QMAKE_DEFAULT_LIBDIRS-and-INCDIRS-to-qconfig-pri.patch
0048-win32-Avoid-platformNativeInterface-segfaults-with-minimal-platform.patch
0049-do-not-include-qopengles2ext-h.patch
)
@@ -294,7 +293,6 @@ prepare() {
popd > /dev/null
rm -f ${srcdir}/qt5/qtbase/src/gui/opengl/qopengles2ext.h
patch -p1 -i ${srcdir}/0047-Emit-QMAKE_DEFAULT_LIBDIRS-and-INCDIRS-to-qconfig-pri.patch
patch -p1 -i ${srcdir}/0048-win32-Avoid-platformNativeInterface-segfaults-with-minimal-platform.patch
local _ARCH_TUNE=
@@ -488,7 +486,6 @@ sha256sums=('609ab74b93ef11f24ef4d7c1bd0a2e81c4280b07fa455dfcf003a2364ab72745'
'29ed4566d4c1853b70a5173c6391ed90f123c5121b5836f2d16f8478f6354f0a' # 0043-static-cmake-regex-QT_INSTALL_LIBS-in-QMAKE_PRL_LIBS_FOR_CMAKE.patch
'72e46178f2f694d8408f22684d1a7d39394056cb574fc4855c1f38c9d51e7e6c' # 0045-static-use-qminimal-platform-plugin-for-qcollectiongenerator.patch
'fd6b1cd956730c1a05a7489760afed6b36561a3b0ec5857c3fbe21dcd7a54617' # 0046-Revert-Revert-fix-NTFS-mount-points.patch
'59081c0bd492181c64ad991bb9e722733c17af6007c2b04c7c5c5a80c2a3fb75' # 0047-Emit-QMAKE_DEFAULT_LIBDIRS-and-INCDIRS-to-qconfig-pri.patch
'3bda25f357a33b122345fea011a14199b5953fd248fab960a5344a2ed9401331' # 0048-win32-Avoid-platformNativeInterface-segfaults-with-minimal-platform.patch
'199c08dbf2f1e8596023b484714de8757a8bcf7d78c5dfe64ea271c54a401687' # 0049-do-not-include-qopengles2ext-h.patch
)