summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2020-09-11 20:03:56 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2020-09-12 16:39:38 +0300
commite16357a52fece93e48d5657cfa8b137e8932c0bb (patch)
tree86ad7abc21e490d723388877581d9252783e19b8
parent10cd6a106e1c461c774ca166a67b8c835c755ef7 (diff)
Import QtWebKit commit f966d667c14ddcfe983f4a31fc80a1edbb6ada10
Change-Id: I4c6773b5dc78399f46ab9fee5c0ff876bd90ba0d Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
-rw-r--r--CMakeLists.txt2
-rw-r--r--Source/JavaScriptCore/CMakeLists.txt1
-rw-r--r--Source/JavaScriptCore/Scripts/generate-js-builtins.py2
-rw-r--r--Source/JavaScriptCore/generate-bytecode-files2
-rw-r--r--Source/JavaScriptCore/parser/Parser.cpp4
-rw-r--r--Source/WTF/wtf/Platform.h8
-rw-r--r--Source/WTF/wtf/dtoa/utils.h2
-rw-r--r--Source/WebCore/css/makegrammar.pl21
-rw-r--r--Source/WebCore/platform/MIMETypeRegistry.cpp3
-rw-r--r--Source/WebCore/platform/network/qt/ResourceRequest.h2
-rw-r--r--Source/cmake/OptionsQt.cmake5
-rw-r--r--Tools/QtTestBrowser/launcherwindow.cpp4
-rw-r--r--Tools/QtTestBrowser/useragentlist.txt28
-rw-r--r--Tools/qt/QtBinaryChecklist.txt235
-rwxr-xr-xTools/qt/build-qtwebkit-conan.py118
-rw-r--r--Tools/qt/conanfile.py52
-rwxr-xr-xTools/qt/installed-files-checker.py123
-rw-r--r--Tools/qt/jhbuild.modules1
-rwxr-xr-xTools/qt/license_writer.sh27
-rwxr-xr-xTools/qt/qt-downloader404
-rw-r--r--Tools/qt/qt-downloader-requirements.txt3
-rwxr-xr-xTools/qt/setup-qt5-submodules-for-coin.sh14
22 files changed, 959 insertions, 102 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 432ae6fce..eaf3a35df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -83,6 +83,8 @@ elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390")
set(WTF_CPU_S390 1)
elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "s390x")
set(WTF_CPU_S390X 1)
+elseif (LOWERCASE_CMAKE_SYSTEM_PROCESSOR MATCHES "riscv64")
+ set(WTF_CPU_RISCV64 1)
else ()
message(FATAL_ERROR "Unknown CPU '${LOWERCASE_CMAKE_SYSTEM_PROCESSOR}'")
endif ()
diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt
index afd76ca1a..3d184090d 100644
--- a/Source/JavaScriptCore/CMakeLists.txt
+++ b/Source/JavaScriptCore/CMakeLists.txt
@@ -1287,6 +1287,7 @@ elseif (WTF_CPU_S390)
elseif (WTF_CPU_S390X)
elseif (WTF_CPU_MIPS)
elseif (WTF_CPU_SH4)
+elseif (WTF_CPU_RISCV64)
elseif (WTF_CPU_X86)
elseif (WTF_CPU_X86_64)
if (MSVC AND ENABLE_JIT)
diff --git a/Source/JavaScriptCore/Scripts/generate-js-builtins.py b/Source/JavaScriptCore/Scripts/generate-js-builtins.py
index 7a203ff08..66b896326 100644
--- a/Source/JavaScriptCore/Scripts/generate-js-builtins.py
+++ b/Source/JavaScriptCore/Scripts/generate-js-builtins.py
@@ -124,7 +124,7 @@ if __name__ == '__main__':
cli_parser.add_option("-t", "--test", action="store_true", help="Enable test mode.")
arg_options, arg_values = cli_parser.parse_args()
- if len(arg_values) is 0 and not arg_options.input_directory:
+ if len(arg_values) == 0 and not arg_options.input_directory:
raise ParseException("At least one input file or directory expected.")
if not arg_options.output_directory:
diff --git a/Source/JavaScriptCore/generate-bytecode-files b/Source/JavaScriptCore/generate-bytecode-files
index c5dab429c..af3431275 100644
--- a/Source/JavaScriptCore/generate-bytecode-files
+++ b/Source/JavaScriptCore/generate-bytecode-files
@@ -163,7 +163,7 @@ if __name__ == "__main__":
initBytecodesFile = openOrExit(initASMFileName, "w")
try:
- bytecodeSections = json.load(bytecodeFile, encoding = "utf-8")
+ bytecodeSections = json.load(bytecodeFile)
except:
print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile, sys.exc_info()))
diff --git a/Source/JavaScriptCore/parser/Parser.cpp b/Source/JavaScriptCore/parser/Parser.cpp
index f4751616f..15582572d 100644
--- a/Source/JavaScriptCore/parser/Parser.cpp
+++ b/Source/JavaScriptCore/parser/Parser.cpp
@@ -1089,6 +1089,10 @@ template <class TreeBuilder> TreeStatement Parser<LexerType>::parseForStatement(
JSTokenLocation location(tokenLocation());
int startLine = tokenLine();
next();
+
+ DepthManager statementDepth(&m_statementDepth);
+ m_statementDepth++;
+
handleProductionOrFail(OPENPAREN, "(", "start", "for-loop header");
int nonLHSCount = m_parserState.nonLHSCount;
int declarations = 0;
diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
index 5717f3ea1..7aefa1bab 100644
--- a/Source/WTF/wtf/Platform.h
+++ b/Source/WTF/wtf/Platform.h
@@ -176,6 +176,11 @@
#define WTF_CPU_X86_SSE2 1
#endif
+/* CPU(RISCV64) - RISCV64 */
+#if defined(__riscv) && defined(__riscv_xlen) && __riscv_xlen == 64
+#define WTF_CPU_RISCV64 1
+#endif
+
/* CPU(ARM64) - Apple */
#if (defined(__arm64__) && defined(__APPLE__)) || defined(__aarch64__)
#define WTF_CPU_ARM64 1
@@ -707,7 +712,8 @@
|| CPU(S390X) \
|| CPU(MIPS64) \
|| CPU(PPC64) \
- || CPU(PPC64LE)
+ || CPU(PPC64LE) \
+ || CPU(RISCV64)
#define USE_JSVALUE64 1
#else
#define USE_JSVALUE32_64 1
diff --git a/Source/WTF/wtf/dtoa/utils.h b/Source/WTF/wtf/dtoa/utils.h
index 889642cee..176d5909f 100644
--- a/Source/WTF/wtf/dtoa/utils.h
+++ b/Source/WTF/wtf/dtoa/utils.h
@@ -49,7 +49,7 @@
defined(__ARMEL__) || \
defined(_MIPS_ARCH_MIPS32R2)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
-#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA)
+#elif CPU(MIPS) || CPU(MIPS64) || CPU(PPC) || CPU(PPC64) || CPU(PPC64LE) || CPU(SH4) || CPU(S390) || CPU(S390X) || CPU(IA64) || CPU(ALPHA) || CPU(ARM64) || CPU(HPPA) || CPU(RISCV64)
#define DOUBLE_CONVERSION_CORRECT_DOUBLE_OPERATIONS 1
#elif defined(_M_IX86) || defined(__i386__)
#if defined(_WIN32)
diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
index 5d63b0810..9435701c7 100644
--- a/Source/WebCore/css/makegrammar.pl
+++ b/Source/WebCore/css/makegrammar.pl
@@ -73,25 +73,6 @@ if ($suffix eq ".y.in") {
}
my $fileBase = File::Spec->join($outputDir, $filename);
-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
+my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
system(@bisonCommand) == 0 or die;
-
-open HEADER, ">$fileBase.h" or die;
-print HEADER << "EOF";
-#ifndef CSSGRAMMAR_H
-#define CSSGRAMMAR_H
-EOF
-
-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
-while (<HPP>) {
- print HEADER;
-}
-close HPP;
-
-print HEADER "#endif\n";
-close HEADER;
-
-unlink("$fileBase.cpp.h");
-unlink("$fileBase.hpp");
-
diff --git a/Source/WebCore/platform/MIMETypeRegistry.cpp b/Source/WebCore/platform/MIMETypeRegistry.cpp
index f824e605b..8087dc984 100644
--- a/Source/WebCore/platform/MIMETypeRegistry.cpp
+++ b/Source/WebCore/platform/MIMETypeRegistry.cpp
@@ -254,6 +254,9 @@ static void initializeSupportedImageMIMETypes()
// Do not treat SVG as images directly because WebKit can handle them.
supportedImageMIMETypes->remove("image/svg+xml");
supportedImageResourceMIMETypes->remove("image/svg+xml");
+ // Do not treat PDF as images
+ supportedImageMIMETypes->remove("application/pdf");
+ supportedImageResourceMIMETypes->remove("application/pdf");
#endif // PLATFORM(QT)
#endif // USE(CG)
}
diff --git a/Source/WebCore/platform/network/qt/ResourceRequest.h b/Source/WebCore/platform/network/qt/ResourceRequest.h
index 1154d56a0..87e21ec3f 100644
--- a/Source/WebCore/platform/network/qt/ResourceRequest.h
+++ b/Source/WebCore/platform/network/qt/ResourceRequest.h
@@ -32,7 +32,7 @@
// HTTP/2 is implemented since Qt 5.8, but various QtNetwork bugs make it unusable in browser with Qt < 5.10.1
// We also don't enable HTTP/2 for unencrypted connections because of possible compatibility issues; it can be
// enabled manually by user application via custom QNAM subclass
-#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1)
+#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 1) && !defined(QT_NO_SSL)
#define USE_HTTP2 1
#endif
diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
index 39fb23b2a..5e5eb6c22 100644
--- a/Source/cmake/OptionsQt.cmake
+++ b/Source/cmake/OptionsQt.cmake
@@ -13,6 +13,9 @@ set(PROJECT_VERSION_STRING "${PROJECT_VERSION}")
set(QT_CONAN_DIR "" CACHE PATH "Directory containing conanbuildinfo.cmake and conanfile.txt")
if (QT_CONAN_DIR)
+ if (NOT QT_CONAN_FILE)
+ set(QT_CONAN_FILE "${QT_CONAN_DIR}/conanfile.txt")
+ endif ()
message(STATUS "Using conan directory: ${QT_CONAN_DIR}")
find_program(CONAN_COMMAND NAMES conan PATHS $ENV{PIP3_PATH})
if (NOT CONAN_COMMAND)
@@ -31,7 +34,7 @@ if (QT_CONAN_DIR)
message(STATUS \"Importing dependencies from conan to \${_conan_imports_dest}\")
execute_process(
- COMMAND \"${CONAN_COMMAND}\" imports --import-folder \${_conan_imports_dest} \"${QT_CONAN_DIR}/conanfile.txt\"
+ COMMAND \"${CONAN_COMMAND}\" imports --import-folder \${_conan_imports_dest} \"${QT_CONAN_FILE}\"
WORKING_DIRECTORY \"${QT_CONAN_DIR}\"
RESULT_VARIABLE _conan_imports_result
)
diff --git a/Tools/QtTestBrowser/launcherwindow.cpp b/Tools/QtTestBrowser/launcherwindow.cpp
index 28ec245c9..f00272427 100644
--- a/Tools/QtTestBrowser/launcherwindow.cpp
+++ b/Tools/QtTestBrowser/launcherwindow.cpp
@@ -170,11 +170,13 @@ void LauncherWindow::initializeView()
} else {
WebViewGraphicsBased* view = new WebViewGraphicsBased(splitter);
m_view = view;
+#ifndef QT_NO_OPENGL
if (!m_windowOptions.useQOpenGLWidgetViewport)
toggleQGLWidgetViewport(m_windowOptions.useQGLWidgetViewport);
#ifdef QT_OPENGL_LIB
if (!m_windowOptions.useQGLWidgetViewport)
toggleQOpenGLWidgetViewport(m_windowOptions.useQOpenGLWidgetViewport);
+#endif // QT_OPENGL_LIB
#endif
view->setPage(page());
@@ -1357,3 +1359,5 @@ void LauncherWindow::find(int mode = s_findNormalFlag)
page()->findText(m_lineEdit->text(), QFlag(m_findFlag));
}
#endif
+
+#include "moc_launcherwindow.cpp"
diff --git a/Tools/QtTestBrowser/useragentlist.txt b/Tools/QtTestBrowser/useragentlist.txt
index decf1043e..f552f8cd6 100644
--- a/Tools/QtTestBrowser/useragentlist.txt
+++ b/Tools/QtTestBrowser/useragentlist.txt
@@ -1,13 +1,17 @@
-Mozilla/5.0 (X11; Linux i686) AppleWebKit/535.1 (KHTML, like Gecko) QtTestBrowser/0.1 Safari/535.1
-Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0) AppleWebKit/535.1 (KHTML, like Gecko) QtTestBrowser/0.1 Mobile Safari/535.1
-Mozilla/5.0 (Macintosh; PPC Mac OS X) AppleWebKit/125.2 (KHTML, like Gecko) Safari/125.8
-Mozilla/5.0 (Unknown; like Android 2.2; Intel Mac OS X 10_6) AppleWebKit/533.3 (KHTML, like Gecko) Version/4.0.3 Mobile Safari/533.3
-Mozilla/5.0 (iPhone; CPU OS 3_2 like Mac OS X) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
-Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7
-Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10
-Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10
+Mozilla/5.0 (Android 7.1.1; Mobile; rv:68.0) Gecko/68.0 Firefox/68.0
+Mozilla/5.0 (Linux; Android 7.1.1; E6883) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Mobile Safari/537.36
+Mozilla/5.0 (Linux; Android 9; G8441) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.111 Mobile Safari/537.36
+Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.2 Safari/605.1.15
Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1) AppleWebKit/413 (KHTML, like Gecko) Safari/413
-Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.2; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)
-Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)
-Mozilla/5.0 (Windows; Windows NT 5.1) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.68 Safari/534.24
-Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
+Mozilla/5.0 (Windows NT 10.0; Trident/7.0; rv:11.0
+Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.102 Safari/537.36 Edge/18.18363
+Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36
+Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
+Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) QtTestBrowser/0.1 Version/10.0 Safari/602.1
+Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 Epiphany/605.1.15
+Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0
+Mozilla/5.0 (X11; Linux x86_64; rv:80.0) Gecko/20100101 Firefox/80.0
+Mozilla/5.0 (iPad; CPU OS 12_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.1 Mobile/15E148 Safari/604.1
+Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1
+Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.18
+Opera/9.80 (X11; Linux x86_64) Presto/2.12.388 Version/12.16
diff --git a/Tools/qt/QtBinaryChecklist.txt b/Tools/qt/QtBinaryChecklist.txt
new file mode 100644
index 000000000..ee6985832
--- /dev/null
+++ b/Tools/qt/QtBinaryChecklist.txt
@@ -0,0 +1,235 @@
+include/QtWebKit/{{version}}/QtWebKit/private/qhttpheader_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquicknetworkreply_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquicknetworkrequest_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquickurlschemedelegate_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquickwebpage_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquickwebpage_p_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquickwebview_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qquickwebview_p_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qtwebsecurityorigin_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebchannelwebkittransport_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebdatabase_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebdownloaditem_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebdownloaditem_p_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebelement_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebhistory_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebiconimageprovider_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebkittest_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebloadrequest_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebnavigationhistory_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebnavigationhistory_p_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebnavigationrequest_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebpermissionrequest_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebplugindatabase_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebpreferences_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebpreferences_p_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebscriptworld_p.h
+include/QtWebKit/{{version}}/QtWebKit/private/qwebsecurityorigin_p.h
+include/QtWebKit/QWebDatabase
+include/QtWebKit/QWebElement
+include/QtWebKit/QWebElementCollection
+include/QtWebKit/QWebFullScreenRequest
+include/QtWebKit/QWebFullScreenVideoHandler
+include/QtWebKit/QWebHapticFeedbackPlayer
+include/QtWebKit/QWebHistory
+include/QtWebKit/QWebHistoryInterface
+include/QtWebKit/QWebHistoryItem
+include/QtWebKit/QWebKitPlatformPlugin
+include/QtWebKit/QWebNotificationData
+include/QtWebKit/QWebNotificationPresenter
+include/QtWebKit/QWebPluginFactory
+include/QtWebKit/QWebSecurityOrigin
+include/QtWebKit/QWebSelectData
+include/QtWebKit/QWebSelectMethod
+include/QtWebKit/QWebSettings
+include/QtWebKit/QWebSpellChecker
+include/QtWebKit/QWebTouchModifier
+include/QtWebKit/QtWebKit
+include/QtWebKit/QtWebKitDepends
+include/QtWebKit/QtWebKitVersion
+include/QtWebKit/qtwebkitversion.h
+include/QtWebKit/qwebdatabase.h
+include/QtWebKit/qwebelement.h
+include/QtWebKit/qwebfullscreenrequest.h
+include/QtWebKit/qwebhistory.h
+include/QtWebKit/qwebhistoryinterface.h
+include/QtWebKit/qwebkitglobal.h
+include/QtWebKit/qwebkitplatformplugin.h
+include/QtWebKit/qwebpluginfactory.h
+include/QtWebKit/qwebsecurityorigin.h
+include/QtWebKit/qwebsettings.h
+include/QtWebKitWidgets/{{version}}/QtWebKitWidgets/private/qwebframe_p.h
+include/QtWebKitWidgets/{{version}}/QtWebKitWidgets/private/qwebinspector_p.h
+include/QtWebKitWidgets/{{version}}/QtWebKitWidgets/private/qwebpage_p.h
+include/QtWebKitWidgets/{{version}}/QtWebKitWidgets/private/qwebviewaccessible_p.h
+include/QtWebKitWidgets/QGraphicsWebView
+include/QtWebKitWidgets/QWebFrame
+include/QtWebKitWidgets/QWebHitTestResult
+include/QtWebKitWidgets/QWebInspector
+include/QtWebKitWidgets/QWebPage
+include/QtWebKitWidgets/QWebView
+include/QtWebKitWidgets/QtWebKitWidgets
+include/QtWebKitWidgets/QtWebKitWidgetsDepends
+include/QtWebKitWidgets/QtWebKitWidgetsVersion
+include/QtWebKitWidgets/qgraphicswebview.h
+include/QtWebKitWidgets/qtwebkitwidgetsversion.h
+include/QtWebKitWidgets/qwebframe.h
+include/QtWebKitWidgets/qwebinspector.h
+include/QtWebKitWidgets/qwebpage.h
+include/QtWebKitWidgets/qwebview.h
+lib/cmake/Qt5WebKit/Qt5WebKitConfig.cmake
+lib/cmake/Qt5WebKit/Qt5WebKitConfigVersion.cmake
+lib/cmake/Qt5WebKit/WebKitTargets-release.cmake
+lib/cmake/Qt5WebKit/WebKitTargets.cmake
+lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsConfig.cmake
+lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsConfigVersion.cmake
+lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsTargets-release.cmake
+lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsTargets.cmake
+mkspecs/modules/qt_lib_webkit.pri
+mkspecs/modules/qt_lib_webkit_private.pri
+mkspecs/modules/qt_lib_webkitwidgets.pri
+mkspecs/modules/qt_lib_webkitwidgets_private.pri
+qml/QtWebKit/plugins.qmltypes
+qml/QtWebKit/qmldir
+qml/QtWebKit/experimental/qmldir
+
+
+{% if os=="linux" %}
+{% if release %}
+lib/libQt5WebKit.so
+lib/libQt5WebKit.so.{{major}}
+lib/libQt5WebKit.so.{{version}}
+lib/libQt5WebKitWidgets.so
+lib/libQt5WebKitWidgets.so.{{major}}
+lib/libQt5WebKitWidgets.so.{{version}}
+libexec/QtWebPluginProcess
+{% endif %}
+
+{% if debug %}
+lib/libQt5WebKit.so.{{version}}.debug
+lib/libQt5WebKitWidgets.so.{{version}}.debug
+{% endif %}
+
+{% elif os=="macos" %}
+lib/QtWebKit.framework/Headers
+lib/QtWebKit.framework/QtWebKit
+lib/QtWebKit.framework/Resources
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qhttpheader_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebdatabase_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebelement_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebhistory_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebplugindatabase_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebscriptworld_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/{{version}}/QtWebKit/private/qwebsecurityorigin_p.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebDatabase
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebElement
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebElementCollection
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebFullScreenRequest
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebFullScreenVideoHandler
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebHapticFeedbackPlayer
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebHistory
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebHistoryInterface
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebHistoryItem
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebKitPlatformPlugin
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebNotificationData
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebNotificationPresenter
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebPluginFactory
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebSecurityOrigin
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebSelectData
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebSelectMethod
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebSettings
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebSpellChecker
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QWebTouchModifier
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QtWebKit
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QtWebKitDepends
+lib/QtWebKit.framework/Versions/{{major}}/Headers/QtWebKitVersion
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qtwebkitversion.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebdatabase.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebelement.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebfullscreenrequest.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebhistory.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebhistoryinterface.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebkitglobal.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebkitplatformplugin.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebpluginfactory.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebsecurityorigin.h
+lib/QtWebKit.framework/Versions/{{major}}/Headers/qwebsettings.h
+lib/QtWebKit.framework/Versions/{{major}}/QtWebKit
+lib/QtWebKit.framework/Versions/{{major}}/Resources/Info.plist
+lib/QtWebKit.framework/Versions/Current
+lib/QtWebKitWidgets.framework/Headers
+lib/QtWebKitWidgets.framework/QtWebKitWidgets
+lib/QtWebKitWidgets.framework/Resources
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/{{version}}/QtWebKitWidgets/private/qwebframe_p.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/{{version}}/QtWebKitWidgets/private/qwebinspector_p.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/{{version}}/QtWebKitWidgets/private/qwebpage_p.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/{{version}}/QtWebKitWidgets/private/qwebviewaccessible_p.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QGraphicsWebView
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QWebFrame
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QWebHitTestResult
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QWebInspector
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QWebPage
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QWebView
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QtWebKitWidgets
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QtWebKitWidgetsDepends
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/QtWebKitWidgetsVersion
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qgraphicswebview.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qtwebkitwidgetsversion.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qwebframe.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qwebinspector.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qwebpage.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Headers/qwebview.h
+lib/QtWebKitWidgets.framework/Versions/{{major}}/QtWebKitWidgets
+lib/QtWebKitWidgets.framework/Versions/{{major}}/Resources/Info.plist
+lib/QtWebKitWidgets.framework/Versions/Current
+
+{% elif os=="windows" %}
+
+bin/QtWebNetworkProcess.exe
+bin/QtWebProcess.exe
+bin/QtWebStorageProcess.exe
+bin/icudt65.dll
+bin/icuin65.dll
+bin/icuuc65.dll
+bin/libxml2.dll
+bin/libxslt.dll
+
+{% if release %}
+bin/Qt5WebKit.dll
+bin/Qt5WebKitWidgets.dll
+lib/Qt5WebKit.lib
+lib/Qt5WebKitWidgets.lib
+qml/QtWebKit/experimental/qmlwebkitexperimentalplugin.dll
+qml/QtWebKit/qmlwebkitplugin.dll
+{% endif %}
+
+{% if debug %}
+bin/Qt5WebKitWidgetsd.dll
+bin/Qt5WebKitd.dll
+bin/Qt5WebKit.pdb
+bin/Qt5WebKitd.pdb
+bin/Qt5WebKitWidgets.pdb
+bin/Qt5WebKitWidgetsd.pdb
+lib/Qt5WebKitd.lib
+lib/Qt5WebKitWidgetsd.lib
+lib/cmake/Qt5WebKit/WebKitTargets-debug.cmake
+lib/cmake/Qt5WebKitWidgets/Qt5WebKitWidgetsTargets-debug.cmake
+qml/QtWebKit/experimental/qmlwebkitexperimentalplugind.dll
+qml/QtWebKit/qmlwebkitplugind.dll
+{% endif %}
+
+{% endif %}
+
+
+{% if os=="linux" or os=="macos" %}
+libexec/QtWebNetworkProcess
+libexec/QtWebProcess
+libexec/QtWebStorageProcess
+qml/QtWebKit/experimental/libqmlwebkitexperimentalplugin.so
+qml/QtWebKit/libqmlwebkitplugin.so
+{% endif %}
+
+{% if os=="linux" or os=="windows" %}
+lib/pkgconfig/Qt5WebKit.pc
+lib/pkgconfig/Qt5WebKitWidgets.pc
+{% endif %}
diff --git a/Tools/qt/build-qtwebkit-conan.py b/Tools/qt/build-qtwebkit-conan.py
index 4c1297832..32d875bdc 100755
--- a/Tools/qt/build-qtwebkit-conan.py
+++ b/Tools/qt/build-qtwebkit-conan.py
@@ -28,47 +28,77 @@ import argparse
import pathlib
import platform
import sys
+import subprocess
-def parse_qt(qt):
- if qt:
- os.environ['QTDIR'] = qt
+def run_command(command):
+ print("Executing:", command)
+ exit_code = os.system(command)
+ print("Exit code:", exit_code)
+ if exit_code:
+ sys.exit(1)
+
+class ConanProfile:
+ def __init__(self, profile_name):
+ self.name = profile_name
-def parse_cmake(cmake):
- if cmake:
- os.environ["CMAKEFLAGS"] = cmake
+ def create(self):
+ run_command("conan profile new {0} --detect --force".format(self.name))
+ def get_arch(self):
+ return subprocess.check_output("conan profile get settings.arch_build {0}".format(self.name), shell=True).rstrip().decode('ascii')
-def parse_ninja(ninja):
- if ninja:
- os.environ["NINJAFLAGS"] = ninja
+ def update(self, setting, value):
+ run_command("conan profile update settings.{0}={1} {2}".format(setting, value, self.name))
-def parse_compiler(compiler):
- if not compiler and not ("CC" in os.environ and "CXX" in os.environ):
+def set_compiler_environment(cc, cxx):
+ os.environ["CC"] = cc
+ os.environ["CXX"] = cxx
+
+
+def create_profile(compiler, arch):
+ compiler_preset = {
+ "msvc": ["cl", "cl"],
+ "clang": ["clang", "clang++"],
+ "gcc": ["gcc", "g++"]
+ }
+ if not compiler:
if platform.system() == "Windows":
compiler = "msvc"
elif platform.system() == "Darwin":
compiler = "clang"
+ elif platform.system() == "Linux":
+ compiler = "gcc"
+
+ if not compiler in compiler_preset:
+ sys.exit("Error: Unknown Compiler " + compiler + " specified")
+
+ cc, cxx = compiler_preset[compiler]
+ profile = ConanProfile('qtwebkit_{0}_{1}'.format(compiler, arch)) # e.g. qtwebkit_msvc_x86
if compiler == "msvc":
- os.environ["CC"] = "cl"
- os.environ["CXX"] = "cl"
- elif compiler == "clang":
- os.environ["CC"] = "clang"
- os.environ["CXX"] = "clang++"
- elif compiler == "gcc":
- os.environ["CC"] = "gcc"
- os.environ["CXX"] = "g++"
+ profile.create()
+ set_compiler_environment(cc, cxx)
+ else:
+ set_compiler_environment(cc, cxx)
+ profile.create()
+ if arch == 'default':
+ arch = profile.get_arch()
-def run_command(command):
- print("Executing:", command)
- exit_code = os.system(command)
- print("Exit code:", exit_code)
- if exit_code:
- sys.exit(1)
+ profile.update('arch', arch)
+ profile.update('arch_build', arch)
+
+ if platform.system() == "Windows" and compiler == "gcc":
+ profile.update('compiler.threads', 'posix')
+ if arch == 'x86':
+ profile.update('compiler.exception', 'dwarf2')
+ if arch == 'x86_64':
+ profile.update('compiler.exception', 'seh')
+
+ return profile.name
parser = argparse.ArgumentParser(description='Build QtWebKit with Conan. For installation of build product into Qt, use --install option')
@@ -80,13 +110,20 @@ parser.add_argument("--ninjaargs", help="Ninja arguments",
default="", type=str)
parser.add_argument(
"--build_directory", help="Name of build dirtectory (defaults to build)", default="build", type=str)
-parser.add_argument("--compiler", help="Specify compiler for build (msvc, gcc, clang)", type=str)
+parser.add_argument("--compiler", help="Specify compiler for build (msvc, gcc, clang)", default=None, choices=['gcc', 'msvc', 'clang'], type=str)
parser.add_argument("--configure", help="Execute the configuration step. When specified, build won't run unless --build is specified", action="store_true")
parser.add_argument("--build", help="Execute the build step. When specified, configure won't run unless --configure is specified", action="store_true")
parser.add_argument("--install", help="Execute the install step. When specified, configure and build steps WILL run without changes", action="store_true")
+parser.add_argument("--profile", help="Name of conan profile provided by user. Note: compiler and profile options are mutually exclusive", type=str)
+parser.add_argument("--arch", help="32 bit or 64 bit build, leave blank for autodetect", default="default", choices=['x86', 'x86_64'])
+parser.add_argument("--build_type", help="Name of CMake build configuration to use", default="Release", choices=['', 'Release', 'Debug'])
+parser.add_argument("--install_prefix", help="Set installation prefix to the given path (defaults to Qt directory)", default=None)
args = parser.parse_args()
+# Always print commands run by conan internally
+os.environ["CONAN_PRINT_RUN_COMMANDS"] = "1"
+
src_directory = str(pathlib.Path(__file__).resolve().parents[2])
if os.path.isabs(args.build_directory):
@@ -101,22 +138,35 @@ print("Path of build directory:" + build_directory)
run_command("conan remote add -f bincrafters https://api.bintray.com/conan/bincrafters/public-conan")
run_command("conan remote add -f qtproject https://api.bintray.com/conan/qtproject/conan")
-script = 'conan install {0} -if "{1}" --build=missing'.format(conanfile_path, build_directory)
-run_command(script)
+if args.profile and args.compiler:
+ sys.exit("Error: --compiler and --profile cannot be specified at the same time")
+
+if not args.profile:
+ profile_name = create_profile(args.compiler, args.arch)
+else:
+ profile_name = args.profile
+
+build_vars = f'-o qt="{args.qt}" -o cmakeargs="{args.cmakeargs}" \
+-o build_type="{args.build_type}" '
+
+if args.install_prefix:
+ build_vars += ' -o install_prefix="{}"'.format(args.install_prefix)
+elif args.qt:
+ build_vars += ' -o install_prefix="{}"'.format(args.qt)
-parse_qt(args.qt)
-parse_cmake(args.cmakeargs)
-parse_ninja(args.ninjaargs)
-parse_compiler(args.compiler)
+if args.ninjaargs:
+ os.environ["NINJAFLAGS"] = args.ninjaargs
if not args.configure and not args.build:
# If we have neither --configure nor --build, we should do both configure and build (but install only if requested)
args.configure = True
args.build = True
+if args.configure:
+ run_command('conan install {0} -if "{1}" --build=missing --profile={2} {3}'.format(conanfile_path, build_directory, profile_name, build_vars))
+
configure_flag = "--configure" if args.configure else ""
build_flag = "--build" if args.build else ""
install_flag = "--install" if args.install else ""
-script = 'conan build {0} {1} {2} -sf "{3}" -bf "{4}" "{5}"'.format(configure_flag, build_flag, install_flag, src_directory, build_directory, conanfile_path)
-run_command(script)
+run_command('conan build {0} {1} {2} -sf "{3}" -bf "{4}" "{5}"'.format(configure_flag, build_flag, install_flag, src_directory, build_directory, conanfile_path))
diff --git a/Tools/qt/conanfile.py b/Tools/qt/conanfile.py
index 5a3d0cfca..cecdd677d 100644
--- a/Tools/qt/conanfile.py
+++ b/Tools/qt/conanfile.py
@@ -31,7 +31,7 @@ class QtWebKitConan(ConanFile):
url = "https://github.com/qtwebkit/qtwebkit"
description = "Qt port of WebKit"
topics = ("qt", "browser-engine", "webkit", "qt5", "qml", "qtwebkit")
- settings = "os", "compiler", "build_type", "arch"
+ settings = "os", "compiler", "arch", "arch_build"
generators = "cmake", "virtualenv", "txt"
exports_sources = "../../*"
no_copy_source = True
@@ -40,6 +40,12 @@ class QtWebKitConan(ConanFile):
"libpng/1.6.37",
"libwebp/1.1.0"
)
+ options = {
+ "qt": "ANY",
+ "cmakeargs": "ANY",
+ "build_type": "ANY",
+ "install_prefix": "ANY"
+ }
default_options = {
"icu:shared": True,
"icu:data_packaging": "library",
@@ -64,11 +70,11 @@ class QtWebKitConan(ConanFile):
self.build_requires(
'pkg-config_installer/0.29.2@bincrafters/stable')
- # gperf python perl bison ruby flex
+ if self.settings.os == 'Windows': # TODO: Fix msys perl or at least allow using non-msys one from PATH
+ self.build_requires("strawberryperl/5.30.0.1")
+
if not tools.which("gperf"):
self.build_requires("gperf_installer/3.1@conan/stable")
- if not tools.which("perl"):
- self.build_requires("strawberryperl/5.30.0.1")
if not tools.which("ruby"):
self.build_requires("ruby_installer/2.6.3@bincrafters/stable")
if not tools.which("bison"):
@@ -94,20 +100,22 @@ class QtWebKitConan(ConanFile):
cmake.generator = "Ninja"
cmake.verbose = False
cmake.definitions["QT_CONAN_DIR"] = self.build_folder
- # QtWebKit installation requires conanfile.txt in build directory
- self.write_imports()
+ cmake.definitions["QT_CONAN_FILE"] = __file__
# if self.options.use_ccache:
# cmake.definitions["CMAKE_C_COMPILER_LAUNCHER"] = "ccache"
# cmake.definitions["CMAKE_CXX_COMPILER_LAUNCHER"] = "ccache"
- if "QTDIR" in os.environ:
+ if self.options.qt:
cmake.definitions["Qt5_DIR"] = os.path.join(
- os.environ["QTDIR"], "lib", "cmake", "Qt5")
+ str(self.options.qt), "lib", "cmake", "Qt5")
print("Qt5 directory:" + cmake.definitions["Qt5_DIR"])
- if "CMAKEFLAGS" in os.environ:
- cmake_flags = shlex.split(os.environ["CMAKEFLAGS"])
+ if self.options.build_type:
+ cmake.build_type = str(self.options.build_type)
+
+ if self.options.cmakeargs:
+ cmake_flags = shlex.split(str(self.options.cmakeargs))
else:
cmake_flags = None
@@ -122,6 +130,9 @@ class QtWebKitConan(ConanFile):
else:
ninja_flags = None
+ if self.options.install_prefix:
+ cmake.definitions["CMAKE_INSTALL_PREFIX"] = str(self.options.install_prefix)
+
print(self.source_folder)
print()
print(self.build_folder)
@@ -130,25 +141,6 @@ class QtWebKitConan(ConanFile):
cmake.build(args=ninja_flags)
cmake.install()
- # QtWebKit installation requires conanfile.txt in build directory, so we generate it here
- # Should be kept in sync with imports()
- def write_imports(self):
- conanfile = open(os.path.join(self.build_folder, "conanfile.txt"), "w")
- conanfile.write("[imports]\n")
-
- if self.settings.os == 'Windows':
- conanfile.write("bin, icudt65.dll -> ./bin\n")
- conanfile.write("bin, icuin65.dll -> ./bin\n")
- conanfile.write("bin, icuuc65.dll -> ./bin\n")
- # Visual Studio
- conanfile.write("bin, libxml2.dll -> ./bin\n")
- conanfile.write("bin, libxslt.dll -> ./bin\n")
- # MinGW
- conanfile.write("bin, libxml2-2.dll -> ./bin\n")
- conanfile.write("bin, libxslt-1.dll -> ./bin\n")
-
- conanfile.close()
-
def imports(self):
if self.settings.os == 'Windows':
self.copy("icudt65.dll", "./bin", "bin")
@@ -159,7 +151,7 @@ class QtWebKitConan(ConanFile):
self.copy("libxslt.dll", "./bin", "bin")
# MinGW
self.copy("libxml2-2.dll", "./bin", "bin")
- self.copy("libxml2-2.dll", "./bin", "bin")
+ self.copy("libxslt-1.dll", "./bin", "bin")
def package(self):
pass
diff --git a/Tools/qt/installed-files-checker.py b/Tools/qt/installed-files-checker.py
new file mode 100755
index 000000000..2144e9c32
--- /dev/null
+++ b/Tools/qt/installed-files-checker.py
@@ -0,0 +1,123 @@
+#!/usr/bin/env python3
+# Copyright (C) 2020 Konstantin Tokarev <annulen@yandex.ru>
+# Copyright (C) 2020 Rajagopalan-Gangadharan <g.raju2000@gmail.com>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+# THE POSSIBILITY OF SUCH DAMAGE.
+
+import sys
+from jinja2 import Environment, FileSystemLoader
+import argparse
+import os
+
+parser = argparse.ArgumentParser(description='Checker for Qtwebkit Binaries')
+parser.add_argument("--version", help=r"Version history of the form {major_version}.{minor_version}.{ver_patch}", required=True)
+parser.add_argument("--qt", help="Root of Qt installation")
+parser.add_argument("--build", help="Root of build directory")
+parser.add_argument("--os", help="Operating system", required=True, choices=[ "linux", "macos", "windows" ])
+parser.add_argument("--template", help='Relative path to template file', default="template/QtBinaryChecklist.txt")
+parser.add_argument("--release", help='Release build', action='store_true')
+parser.add_argument("--debug", help='Debug build', action='store_true')
+parser.add_argument("--qt_install_header", help='Qt headers install path')
+parser.add_argument("--qt_install_libs", help='Qt libraries install path')
+parser.add_argument("--qt_install_archdata", help='Qt archdata install path')
+parser.add_argument("--qt_install_libexecs", help='Qt libexecs install path')
+
+args = parser.parse_args()
+
+template_abspath = os.path.abspath(args.template)
+template_folder = os.path.dirname(template_abspath)
+template_name = os.path.basename(template_abspath)
+
+file_loader = FileSystemLoader(template_folder) # directory of template file
+env = Environment(loader=file_loader)
+
+template = env.get_template(template_name) # load template file
+
+major, minor, patch = args.version.split('.')
+
+check_list = template.render(os=args.os,
+ major=major, version=args.version, release=args.release, debug=args.debug).split('\n')
+
+file_count = {"linux_Release": 108, "windows_Debug": 118,"windows_Release":110, "macos_Release": 170}
+
+
+def verify_linux(check_list):
+ error_list = []
+ count = 0
+
+ for line in check_list:
+ if line.rstrip():
+ if line.startswith('include/'):
+ chk_path = os.path.join(args.qt_install_header, line[len('include/'):])
+ elif line.startswith('lib/'):
+ chk_path = os.path.join(args.qt_install_libs, line[len('lib/'):])
+ elif line.startswith('mkspecs/') or line.startswith('qml/'):
+ chk_path = os.path.join(args.qt_install_archdata, line)
+ elif line.startswith('libexec/'):
+ chk_path = os.path.join(args.qt_install_libexecs, line[len('libexec/'):])
+
+ count+=1
+
+ if not os.path.exists(chk_path):
+ error_list.append(chk_path)
+
+ return [error_list, count]
+
+def verify_windows_mac(check_list):
+ error_list = []
+ count = 0
+
+ build=os.path.join(os.getcwd(),args.build)
+ for line in check_list:
+ if line.rstrip():
+ if line.startswith('bin'):
+ chk_path = os.path.join(build, line)
+ else:
+ chk_path = os.path.join(args.qt, line)
+
+ count+=1
+ if not os.path.exists(chk_path):
+ error_list.append(chk_path)
+
+ return [error_list, count]
+
+
+if args.os == 'linux':
+ res = verify_linux(check_list)
+elif args.os == 'windows' or args.os == 'macos':
+ res = verify_windows_mac(check_list)
+
+build_type = 'Debug' if args.debug else 'Release'
+
+print("Verified {0}/{1} files".format(res[1],file_count[args.os+'_'+build_type]))
+if len(res[0])!=0:
+ print("Errors found files below are missing:")
+ for err in res[0]:
+ print(err)
+ exit(1)
+
+print("All files are installed properly")
+
+
+#python3 installed-files-checker.py --version 5.212.0 --build /mnt/c/qtwebkit/build --os linux
+#
+# py installed-files-checker.py --version 5.20.0 --qt "C:/Qt/5.14.2/msvc2017_64" --build "C:/qtwebkit/build/" --os windows
diff --git a/Tools/qt/jhbuild.modules b/Tools/qt/jhbuild.modules
index 3c8f15a33..e6b28824a 100644
--- a/Tools/qt/jhbuild.modules
+++ b/Tools/qt/jhbuild.modules
@@ -91,6 +91,7 @@
<autotools id="glib"
autogen-sh="configure"
autogenargs="--disable-dtrace --disable-gtk-doc-html">
+ <makeargs value="CFLAGS+=-Wno-error"/>
<branch module="/pub/GNOME/sources/glib/2.44/glib-2.44.1.tar.xz" version="2.44.1"
repo="ftp.gnome.org"
hash="sha256:8811deacaf8a503d0a9b701777ea079ca6a4277be10e3d730d2112735d5eca07">
diff --git a/Tools/qt/license_writer.sh b/Tools/qt/license_writer.sh
new file mode 100755
index 000000000..ebb36271a
--- /dev/null
+++ b/Tools/qt/license_writer.sh
@@ -0,0 +1,27 @@
+#!/bin/bash -x
+if [[ "${TOOLCHAIN}" =~ "win64_mingw" ]]; then
+ SUBDIR="${TOOLCHAIN/win64_/}_64"
+ elif [[ "${TOOLCHAIN}" =~ "win32_mingw" ]]; then
+ SUBDIR="${TOOLCHAIN/win32_/}_32"
+ elif [[ "${TOOLCHAIN}" =~ "win64_msvc" ]]; then
+ SUBDIR="${TOOLCHAIN/win64_/}"
+ elif [[ "${TOOLCHAIN}" =~ "win32_msvc" ]]; then
+ SUBDIR="${TOOLCHAIN/win32_/}"
+ else
+ SUBDIR="${TOOLCHAIN}"
+ fi
+
+CONF_FILE="${QTDIR}/bin/qt.conf"
+echo "[Paths]" > ${CONF_FILE}
+echo "Prefix = .." >> ${CONF_FILE}
+
+# Adjust the license to be able to run qmake
+# sed with -i requires intermediate file on Mac OS
+PRI_FILE="${QTDIR}/mkspecs/qconfig.pri"
+sed -i.bak 's/Enterprise/OpenSource/g' "${PRI_FILE}"
+sed -i.bak 's/licheck.*//g' "${PRI_FILE}"
+rm "${PRI_FILE}.bak"
+
+# Print the directory so that the caller can
+# adjust the PATH variable.
+echo $(dirname "${CONF_FILE}")
diff --git a/Tools/qt/qt-downloader b/Tools/qt/qt-downloader
new file mode 100755
index 000000000..534f3897f
--- /dev/null
+++ b/Tools/qt/qt-downloader
@@ -0,0 +1,404 @@
+#!/usr/bin/env python3
+
+import argparse
+import platform
+import requests
+import semantic_version
+import shutil
+import subprocess
+import sys
+import urllib.request
+from lxml import etree, html
+from pathlib import Path
+import os
+import shlex
+
+
+BaseUrl = 'https://download.qt.io/online/qtsdkrepository/'
+
+OsMap = {
+ 'macos': 'mac_x64',
+ 'linux': 'linux_x64',
+ 'windows': 'windows_x86'
+}
+
+
+def key_by_value(dict, value):
+ return next((left for left, right in dict.items() if right == value), None)
+
+
+def decode_version(v):
+ v = list(v)
+ major = v.pop(0)
+ patch = v.pop() if len(v) > 1 else 0
+ minor = ''.join(v)
+ return '{}.{}.{}'.format(major, minor, patch)
+
+
+def deduce_os():
+ os_type = platform.system().lower()
+ if os_type == 'darwin':
+ os_type = 'macos'
+ return os_type
+
+
+def discover_dirs(url):
+ reply = requests.get(url)
+ page = html.fromstring(reply.content)
+ items = page.xpath('//table//tr[position()>2]//a[not(starts-with(@href, "/"))]/@href')
+ return [item for item in items if item.endswith('/')]
+
+
+def discover_kits(args):
+ os_dict = {}
+ os_types = discover_dirs(BaseUrl)
+ for os_type in os_types:
+ human_os = key_by_value(OsMap, os_type[:-1])
+ current_os = human_os if human_os is not None else os_type[:-1]
+ os_dict[current_os] = None
+
+ if not (args.os == 'discover' and args.all or args.os != 'discover' and args.os in [os_type[:-1], human_os]):
+ continue
+
+ targets_dict = {}
+ targets = discover_dirs(BaseUrl + os_type)
+ targets = [target for target in targets if target != 'root/']
+ for target in targets:
+ targets_dict[target[:-1]] = None
+
+ if not (args.target == 'discover' and args.all or args.target != 'discover' and args.target == target[:-1]):
+ continue
+
+ versions_dict = {}
+ versions = discover_dirs(BaseUrl + os_type + target)
+ for version in versions:
+ if version.startswith('tools_') or version.endswith('_preview/') or version.endswith('_wasm/') or '_src' in version or not version.startswith('qt5_'):
+ continue
+
+ ver = decode_version(version[len('qt5_'):-1])
+ versions_dict[ver] = None
+
+ if not (args.version == 'discover' and args.all or args.version != 'discover' and args.version != 'latest' and args.version == ver):
+ continue
+
+ toolchains = discover_dirs(BaseUrl + os_type + target + version)
+ toolchains = [toolchain.split('.')[2:] for toolchain in toolchains]
+ toolchains = [toolchain[-1] for toolchain in toolchains if len(toolchain) > 0]
+ toolchains = set([toolchain[:-1] for toolchain in toolchains if not toolchain.startswith('qt') and not toolchain.startswith('debug')])
+
+ versions_dict[ver] = toolchains
+
+ targets_dict[target[:-1]] = versions_dict
+
+ os_dict[current_os] = targets_dict
+
+ return os_dict
+
+
+def build_url(args):
+ ver = args.version.replace('.', '')
+ return BaseUrl + '{}/{}/qt5_{}/'.format(OsMap[args.os], args.target, ver)
+
+
+def toolchain_build_url(args, tools):
+ return BaseUrl + '{}/{}/tools_{}/'.format(OsMap[args.os], args.target, tools)
+
+
+def ossl_info(url, name):
+ reply = requests.get(url + "Updates.xml")
+ update_xml = etree.fromstring(reply.content)
+
+ for package in update_xml.xpath('//PackageUpdate'):
+ name = package.xpath('Name/text()')[0]
+ if name.startswith('qt.') and name.endswith('_{}'.format(name[len(name)-3:])):
+ version = package.xpath('Version/text()')[0]
+ archives = package.xpath('DownloadableArchives/text()')[0].split(', ')
+ return (name, version, archives)
+
+ print('Update.xml does not contain proper entry for Qt kit', file=sys.stderr)
+ return None
+
+
+def mingw_info(url, mingw):
+ reply = requests.get(url + "Updates.xml")
+ update_xml = etree.fromstring(reply.content)
+
+ for package in update_xml.xpath('//PackageUpdate'):
+ name = package.xpath('Name/text()')[0]
+ if name.startswith('qt.') and name.endswith('.{}'.format(mingw)):
+ version = package.xpath('Version/text()')[0]
+ archives = package.xpath('DownloadableArchives/text()')[0].split(', ')
+ return (name, version, archives)
+
+ print('Update.xml does not contain proper entry for Qt kit', file=sys.stderr)
+ return None
+
+
+def get_info(url, version, toolchain):
+ reply = requests.get(url + "Updates.xml")
+ update_xml = etree.fromstring(reply.content)
+
+ ver = version.replace('.', '')
+
+ for package in update_xml.xpath('//PackageUpdate'):
+ name = package.xpath('Name/text()')[0]
+ if name.startswith('qt.') and name.endswith('.{}.{}'.format(ver, toolchain)):
+ version = package.xpath('Version/text()')[0]
+ archives = package.xpath('DownloadableArchives/text()')[0].split(', ')
+ return (name, version, archives)
+
+ print('Update.xml does not contain proper entry for Qt kit', file=sys.stderr)
+ return None
+
+
+def download_and_extract(archives_url, archives, output, req_modules):
+ for archive in archives:
+ module = archive.split('-')[0]
+ if len(req_modules) != 0 and (module not in req_modules):
+ continue
+ try:
+ print('Downloading module {}... '.format(module), end='', flush=True)
+ with urllib.request.urlopen(archives_url + archive) as response, open(archive, 'wb') as out_file:
+ shutil.copyfileobj(response, out_file)
+
+ print('\rExtracting module {}... '.format(module), end='', flush=True)
+ subprocess.run('7z x {0} -o{1}'.format(archive, output), shell=True, check=True,
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ print('\rInstalled module {} successfully'.format(module))
+ except subprocess.CalledProcessError as e:
+ print('Error: {}'.format(e))
+
+ os_type = deduce_os()
+ suggestion = ''
+ if os_type == 'linux':
+ suggestion = ' Run sudo apt install p7zip-full on Ubuntu'
+ elif os_type == 'macos':
+ suggestion = ' Run brew install p7zip on macOS'
+
+ raise RuntimeError('Check that 7z command is in your PATH.{}'.format(suggestion))
+ except KeyboardInterrupt:
+ print('Interrupted')
+ raise KeyboardInterrupt
+ finally:
+ Path(archive).unlink()
+
+ print('Finished installation')
+
+
+def show_discover_context(args, parser):
+ if args.os != 'discover':
+ if args.os == 'auto':
+ args.os = deduce_os()
+
+ print('OS type: {}'.format(args.os))
+
+ if args.target != 'discover':
+ print('Target: {}'.format(args.target))
+
+ if args.version != 'discover':
+ if args.version == 'latest':
+ print('Discovering latest version... ', end='')
+ kits = discover_kits(args)
+ print('Done')
+ check_os_type(args, kits)
+ targets = kits[args.os]
+ check_targets(args, targets)
+ versions = targets[args.target]
+ args.version = str(sorted(map(semantic_version.Version, versions.keys()))[-1])
+ elif not semantic_version.validate(args.version):
+ print('Wrong version: {}. Should follow Semantic Versioning format: major.minor.patch\n'.format(args.version), file=sys.stderr)
+ parser.print_help()
+ sys.exit(1)
+
+ print('Qt version: {}'.format(args.version))
+
+ if args.toolchain != 'discover':
+ print('Toolchain: {}'.format(args.toolchain))
+
+
+def show_discovered_parameters(args, params, labels):
+ print('Discovering available ', end='')
+
+ discoverables = []
+ for index, param in enumerate(params):
+ if param == 'discover':
+ discoverables.append(labels[index])
+
+ if not args.all:
+ discoverables = discoverables[:1]
+
+ if len(discoverables) == 1:
+ print('{}...'.format(discoverables[0]), end='', flush=True)
+ elif len(discoverables) == 2:
+ print('{}...'.format(' and '.join(discoverables)), end='', flush=True)
+ else:
+ print('{}, and {}...'.format(', '.join(discoverables[:-1]), discoverables[-1]), end='', flush=True)
+
+
+def show_os_types_only(kits):
+ print(' Choose from: {}'.format(', '.join(sorted(kits.keys()))))
+
+
+def show_targets_only(targets):
+ print(' Choose from: {}'.format(', '.join(sorted(targets.keys()))))
+
+
+def show_versions_only(versions):
+ print(' Choose from: {}'.format(', '.join(map(str, sorted(map(semantic_version.Version, versions.keys()))))))
+
+
+def show_toolchains_only(toolchains):
+ print(' Choose from: {}'.format(', '.join(sorted(toolchains))))
+
+
+def check_os_type(args, kits):
+ if not args.os in kits:
+ print(' Unknown OS type: {}'.format(args.os))
+ show_os_types_only(kits)
+ sys.exit(1)
+
+
+def check_targets(args, targets):
+ if not args.target in targets:
+ print(' Unknown target: {}'.format(args.target))
+ show_targets_only(targets)
+ sys.exit(1)
+
+
+def check_versions(args, versions):
+ if not args.version in versions:
+ print(' Unknown version: {}'.format(args.version))
+ show_versions_only(versions)
+ sys.exit(1)
+
+
+def check_toolchains(args, toolchains):
+ if not args.toolchain in toolchains:
+ print(' Unknown toolchain: {}'.format(args.toolchain))
+ show_toolchains_only(toolchains)
+ sys.exit(1)
+
+def show_os_types_and_all(kits, indent = 0):
+ for os_type, targets in kits.items():
+ print(' {}{}:'.format(' ' * indent, os_type))
+ show_targets_and_all(targets, indent + 1)
+
+
+def show_targets_and_all(targets, indent = 0):
+ for target, versions in sorted(targets.items()):
+ print(' {}Target {} supports toolchains:'.format(' ' * indent, target))
+ show_versions_and_all(versions, indent + 1)
+
+
+def show_versions_and_all(versions, indent = 0):
+ for version, toolchains in sorted(versions.items()):
+ print(' {}{}: {}'.format(' ' * indent, version, ', '.join(sorted(toolchains))))
+
+
+def show_discovery_results(args, kits):
+ print(' Done')
+
+ if args.os == 'discover':
+ if not args.all:
+ show_os_types_only(kits)
+ else:
+ show_os_types_and_all(kits)
+ elif args.target == 'discover':
+ check_os_type(args, kits)
+ targets = kits[args.os]
+ if not args.all:
+ show_targets_only(targets)
+ else:
+ show_targets_and_all(targets)
+ elif args.version == 'discover':
+ check_os_type(args, kits)
+ targets = kits[args.os]
+ check_targets(args, targets)
+ versions = targets[args.target]
+ if not args.all:
+ show_versions_only(versions)
+ else:
+ show_versions_and_all(versions)
+ elif args.toolchain == 'discover':
+ check_os_type(args, kits)
+ targets = kits[args.os]
+ check_targets(args, targets)
+ versions = targets[args.target]
+ check_versions(args, versions)
+ toolchains = versions[args.version]
+ show_toolchains_only(toolchains)
+ else:
+ check_os_type(args, kits)
+ targets = kits[args.os]
+ check_targets(args, targets)
+ versions = targets[args.target]
+ check_versions(args, versions)
+ toolchains = versions[args.version]
+ check_toolchains(args, toolchains)
+
+
+def verify_parameters(args):
+ print('Verifying arguments...', end='')
+ kits = discover_kits(args)
+ show_discovery_results(args, kits)
+
+
+def main():
+ parser = argparse.ArgumentParser(description='Qt downloader',
+ formatter_class=argparse.ArgumentDefaultsHelpFormatter)
+ parser.add_argument('os', nargs='?', default='discover', help='Operating system type: {}, auto, or discovered one. Omit this to discover available OS types'.format(', '.join(OsMap.keys())))
+ parser.add_argument('target', nargs='?', default='discover', help='Target platform. Omit this to discover available targets')
+ parser.add_argument('version', nargs='?', default='discover', help='Qt version conforming to Semantic Versioning format: major.minor.patch. Use \'latest\' to get most up to date version. Omit this to discover available versions.')
+ parser.add_argument('toolchain', nargs='?', default='discover', help='Toolchain to use. Omit this to discover available toolchains')
+ parser.add_argument('-a', '--all', action='store_true', help='Discover allowed values for all missing arguments')
+ parser.add_argument('--output', '-o', default=os.getcwd(), help='Output directory')
+ parser.add_argument('--qt_modules', default='', help='Download selected qt modules')
+ parser.add_argument('--mingw', '-m', default=None,
+ help='Download Mingw from Qt.Expected Format - win{arch}_mingw{major}{minor} eg: win32_mingw730')
+ parser.add_argument('--openssl', choices=['openssl_x64', 'openssl_x86'],
+ default=None, help='Download openSSl Distribution from Qt. ')
+
+ args = parser.parse_args()
+
+ show_discover_context(args, parser)
+
+ params = [args.os, args.target, args.version, args.toolchain]
+ labels = ['OS types', 'targets', 'Qt versions', 'toolchains']
+ if 'discover' in params:
+ show_discovered_parameters(args, params, labels)
+ kits = discover_kits(args)
+ show_discovery_results(args, kits)
+ sys.exit(0)
+ else:
+ verify_parameters(args)
+ url = build_url(args)
+
+ info = get_info(url, args.version, args.toolchain)
+ if info is None:
+ sys.exit(1)
+
+ if args.mingw:
+ mingw = toolchain_build_url(args, 'mingw')
+ mingw_name, mingw_version, mingw_archives = mingw_info(mingw, args.mingw)
+ download_and_extract(mingw + mingw_name + '/' + mingw_version, mingw_archives, args.output, [])
+
+ if args.openssl:
+ ossl = toolchain_build_url(args, args.openssl)
+ ossl_name, ossl_version, ossl_archives = ossl_info(ossl, args.openssl)
+ download_and_extract(ossl + ossl_name + '/' + ossl_version, ossl_archives, args.output, [])
+
+ name, version, archives = info
+ qt_modules = shlex.split(args.qt_modules)
+ download_and_extract(url + name + '/' + version, archives, args.output, qt_modules)
+
+
+if __name__ == '__main__':
+ try:
+ main()
+ except IOError as error:
+ print(error)
+ except RuntimeError as error:
+ print(error)
+ except KeyboardInterrupt:
+ print('Stopped by user')
+
diff --git a/Tools/qt/qt-downloader-requirements.txt b/Tools/qt/qt-downloader-requirements.txt
new file mode 100644
index 000000000..48a678cdd
--- /dev/null
+++ b/Tools/qt/qt-downloader-requirements.txt
@@ -0,0 +1,3 @@
+requests
+semantic_version
+lxml
diff --git a/Tools/qt/setup-qt5-submodules-for-coin.sh b/Tools/qt/setup-qt5-submodules-for-coin.sh
index eb5576873..c5baf0c37 100755
--- a/Tools/qt/setup-qt5-submodules-for-coin.sh
+++ b/Tools/qt/setup-qt5-submodules-for-coin.sh
@@ -22,6 +22,20 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
+usage() {
+ echo "Usage: $0 <qt_ref>"
+ echo " where qt_ref is tag or other git reference from qt5.git repo to take submodules from"
+ exit 0
+}
+
+if [ -z "$1" ]; then
+ usage
+fi
+
+if [ "$1" = "--help" ]; then
+ usage
+fi
+
QT_REF="$1"
SCRIPTNAME=$(basename "$0")