diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/about_credits_entry.tmpl | 2 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/configure.prf | 114 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/default_post.prf | 11 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/default_pre.prf | 14 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/functions.prf | 172 | ||||
-rw-r--r-- | tools/qmake/mkspecs/features/gyp_generator.prf | 2 | ||||
-rwxr-xr-x | tools/scripts/take_snapshot.py | 92 | ||||
-rw-r--r-- | tools/scripts/version_resolver.py | 6 | ||||
-rwxr-xr-x | tools/scripts/windeploy-examples.py | 393 |
9 files changed, 663 insertions, 143 deletions
diff --git a/tools/about_credits_entry.tmpl b/tools/about_credits_entry.tmpl index dd74c880a..20bbb28a0 100644 --- a/tools/about_credits_entry.tmpl +++ b/tools/about_credits_entry.tmpl @@ -1,6 +1,6 @@ /*! \contentspage qtwebengine-licensing.html -\page qtwebengine-3rdparty-{{name-sanitized}}.html +\page qtwebengine-3rdparty-{{name-sanitized}}.html attribution \ingroup qtwebengine-licensing \brief {{license-type}} \title {{name}} diff --git a/tools/qmake/mkspecs/features/configure.prf b/tools/qmake/mkspecs/features/configure.prf index 6a67bf097..c6f07e39d 100644 --- a/tools/qmake/mkspecs/features/configure.prf +++ b/tools/qmake/mkspecs/features/configure.prf @@ -21,49 +21,69 @@ defineTest(runConfigure) { } linux { + QT_FOR_CONFIG += gui-private !config_khr:skipBuild("khronos development headers appear to be missing (mesa/libegl1-mesa-dev)") REQUIRED_PACKAGES = dbus-1 fontconfig - !cross_compile: contains(QT_CONFIG, xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst + !cross_compile: qtConfig(xcb): REQUIRED_PACKAGES += libdrm xcomposite xcursor xi xrandr xscrnsaver xtst contains(QT_CONFIG, pulseaudio): REQUIRED_PACKAGES += libpulse - contains(QT_CONFIG, system-png): REQUIRED_PACKAGES += libpng - contains(QT_CONFIG, system-harfbuzz): REQUIRED_PACKAGES += harfbuzz + qtConfig(system-png): REQUIRED_PACKAGES += libpng + qtConfig(system-harfbuzz) { + packagesExist("\'harfbuzz >= 1.2.0\'"): WEBENGINE_CONFIG += use_system_harfbuzz + else: log("System harfbuzz is too old (min. version 1.2). Using Chromium's copy.$${EOL}") + } !cross_compile: REQUIRED_PACKAGES += libpci for(package, $$list($$REQUIRED_PACKAGES)) { !packagesExist($$package):skipBuild("Unmet dependency: $$package") } - packagesExist(minizip, zlib): WEBENGINE_CONFIG += use_system_minizip + packagesExist(minizip, zlib): WEBENGINE_CONFIG += use_system_minizip use_system_zlib else: log("System zlib or minizip not found. Using Chromium's copies.$${EOL}") - packagesExist(libwebp,libwebpdemux): WEBENGINE_CONFIG += use_system_libwebp + packagesExist(libwebp,libwebpdemux): WEBENGINE_CONFIG += use_system_libwebp use_system_libwebpdemux else: log("System libwebp or libwebpdemux not found. Using Chromium's copies.$${EOL}") - packagesExist(libxml-2.0,libxslt): WEBENGINE_CONFIG += use_system_libxslt + packagesExist(libxml-2.0,libxslt): WEBENGINE_CONFIG += use_system_libxslt use_system_libxml2 else: log("System libxml2 or libxslt not found. Using Chromium's copies.$${EOL}") for(package, $$list("libevent jsoncpp opus protobuf")) { packagesExist($$package): WEBENGINE_CONFIG += use_system_$$package - else: log("System $$package not found. Using Chromium's copy.$${EOL}") + else { + log("System $$package not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_$$package + } } use?(system_protobuf) { !system("which protoc > /dev/null") { log("Protobuf compiler not found. Using Chromium's copy of protobuf.$${EOL}") WEBENGINE_CONFIG -= use_system_protobuf + WEBENGINE_CONFIG += use_bundled_protobuf } } config_libvpx: WEBENGINE_CONFIG += use_system_vpx - else: log("Compatible system libvpx not found. Using Chromium's copy.$${EOL}") + else { + log("Compatible system libvpx not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_libvpx + } config_srtp: WEBENGINE_CONFIG += use_system_libsrtp - else: log("System libsrtp not found. Using Chromium's copy.$${EOL}") + else { + log("System libsrtp not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_srtp + } config_snappy: WEBENGINE_CONFIG += use_system_snappy - else: log("System snappy not found. Using Chromium's copy.$${EOL}") + else { + log("System snappy not found. Using Chromium's copy.$${EOL}") + WEBENGINE_CONFIG += use_bundled_snappy + } !cross_compile { packagesExist(nss): WEBENGINE_CONFIG += use_nss else: log("System NSS not found, BoringSSL will be used.$${EOL}") } } - - # Spellcheck support is moved to dev - WEBENGINE_CONFIG += no_spellcheck + isQtMinimum(5, 8) { + include($$QTWEBENGINE_OUT_ROOT/qtwebengine-config.pri) + QT_FOR_CONFIG += webengine-private + qtConfig(proprietary-codecs): WEBENGINE_CONFIG += use_proprietary_codecs + qtConfig(spellchecker): WEBENGINE_CONFIG += use_spellchecker + } isEmpty(skipBuildReason): { cache(CONFIG, add, $$list(webengine_successfully_configured)) @@ -73,61 +93,79 @@ defineTest(runConfigure) { } } -} - -# This is called from default_post, at which point we've also parsed -# command line options -defineTest(finalizeConfigure) { - linux { - use?(nss) { - log("Certificate handling.............. Using system NSS$${EOL}") - } else { - log("Certificate handling.............. Using bundled BoringSSL$${EOL}") - } + unix:!darwin { + log("System library dependencies:$${EOL}") use?(system_icu) { packagesExist("icu-uc icu-i18n") { - log("ICU............................... Using system version$${EOL}") + log(" ICU ................................ Using system version$${EOL}") } else { - log("ICU............................... System ICU not found$${EOL}") + log(" ICU ................................ System ICU not found$${EOL}") skipBuild("Unmet dependencies: icu-uc, icu-i18n") } } else { - log("ICU............................... Using internal copy (Default, force system ICU with WEBENGINE_CONFIG+=use_system_icu)$${EOL}") + log(" ICU ................................ Using internal copy (Default, force system ICU with WEBENGINE_CONFIG+=use_system_icu)$${EOL}") + WEBENGINE_CONFIG += use_bundled_icu } use?(system_ffmpeg) { packagesExist("libavcodec libavformat libavutil") { packagesExist("libwebp, libwebpdemux, opus, \'vpx >= 1.4\'"){ - log("FFMPEG............................ Using system version$${EOL}") + log(" FFMPEG ............................. Using system version$${EOL}") } else { - log("FFMPEG............................ Conflicting FFMPEG dependencies$${EOL}") + log(" FFMPEG ............................. Conflicting FFMPEG dependencies$${EOL}") skipBuild("Unmet dependencies: opus, vpx, libwebp, libwebpdemux") } } else { - log("FFMPEG............................ System FFMPEG not found$${EOL}") + log(" FFMPEG ............................. System FFMPEG not found$${EOL}") skipBuild("Unmet dependencies: libavcodec, libavformat, libavutil") } } else { - log("FFMPEG............................ Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG+=use_system_ffmpeg)$${EOL}") + log(" FFMPEG ............................. Using internal copy (Default, force system FFMPEG with WEBENGINE_CONFIG+=use_system_ffmpeg)$${EOL}") + WEBENGINE_CONFIG += use_bundled_ffmpeg + } + for(config, WEBENGINE_CONFIG) { + match = $$find(config, "^use_system_") + !isEmpty(match) { + use_system += $$replace(match, ^use_system_,) + } + match = $$find(config, "^use_bundled_") + !isEmpty(match) { + use_bundled += $$replace(match, ^use_bundled_,) + } } + !isEmpty(use_system): log(" Optional system libraries used ..... $$use_system$${EOL}") + !isEmpty(use_bundled): log(" Optional bundled libraries used .... $$use_bundled$${EOL}") } + log("Configurable features:$${EOL}") use?(proprietary_codecs) { - log("Proprietary codecs (H264, MP3).... Enabled$${EOL}") + log(" Proprietary codecs (H264, MP3) ..... Enabled$${EOL}") } else { - log("Proprietary codecs (H264, MP3).... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_proprietary_codecs)$${EOL}") + log(" Proprietary codecs (H264, MP3) ..... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_proprietary_codecs)$${EOL}") } qtHaveModule(positioning): { - log("Geolocation....................... Enabled$${EOL}") + log(" Geolocation ........................ Enabled$${EOL}") } else { - log("Geolocation....................... Not enabled (Requires Qt Positioning module)$${EOL}") + log(" Geolocation ........................ Not enabled (Requires Qt Positioning module)$${EOL}") + } + unix:!darwin { + use?(nss) { + log(" Certificate handling ............... Using system NSS$${EOL}") + } else { + log(" Certificate handling ............... Using bundled BoringSSL$${EOL}") + } } osx { use?(appstore_compliant_code) { - log("AppStore Compliant ............... Enabled$${EOL}") + log(" Mac App Store Compliant ............ Enabled$${EOL}") + } else { + log(" Mac App Store Compliant ............ Not enabled (Default, enable with WEBENGINE_CONFIG+=use_appstore_compliant_code)$${EOL}") + } + use?(native_spellchecker) { + log("Native Spellchecker .............. Enabled$${EOL}") } else { - log("AppStore Compliant ............... Not enabled (Default, enable with WEBENGINE_CONFIG+=use_appstore_compliant_code)$${EOL}") + log("Native Spellchecker .............. Not enabled (Default, enable with WEBENGINE_CONFIG+=use_native_spellchecker)$${EOL}") } !isMinOSXSDKVersion(10, 10, 3) { - log("Force Touch API usage ............ Not enabled (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}") + log(" Force Touch API usage .............. Not enabled (Because the OS X SDK version to be used \"$${WEBENGINE_OSX_SDK_PRODUCT_VERSION}\" is lower than the required \"10.10.3\")$${EOL}") } } } diff --git a/tools/qmake/mkspecs/features/default_post.prf b/tools/qmake/mkspecs/features/default_post.prf deleted file mode 100644 index 64e8cb1fe..000000000 --- a/tools/qmake/mkspecs/features/default_post.prf +++ /dev/null @@ -1,11 +0,0 @@ -load(default_post) -load(functions) - -root_project_file:isPlatformSupported(): finalizeConfigure() - -!isEmpty(skipBuildReason) { - SUBDIRS = - export(SUBDIRS) - log($${skipBuildReason}$${EOL}) - log(QtWebEngine will not be built.$${EOL}) -} diff --git a/tools/qmake/mkspecs/features/default_pre.prf b/tools/qmake/mkspecs/features/default_pre.prf index 27aded013..77e437bc9 100644 --- a/tools/qmake/mkspecs/features/default_pre.prf +++ b/tools/qmake/mkspecs/features/default_pre.prf @@ -1,6 +1,3 @@ -# Resolve root directories for sources -QTWEBENGINE_ROOT = $$replace(PWD, /tools/qmake/mkspecs/features$,) - # We depend on libc++ to build chromium so our macosx-version-min has to be 10.7 QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7 @@ -24,14 +21,3 @@ EOL = $$escape_expand(\\n) # Call the original default_pre. load(default_pre) load(functions) - -# Check platform support and run config tests early enough to bail -equals(_PRO_FILE_, "$$QTWEBENGINE_ROOT/qtwebengine.pro"): CONFIG += root_project_file - -root_project_file:isPlatformSupported() { - !exists($$QTWEBENGINE_ROOT/src/3rdparty/chromium) { - error("Submodule qtwebengine-chromium does not exist. Run 'git submodule update --init'.") - } - load(configure) - runConfigure() -} diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index c8fd278b4..236ee8ac5 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -1,4 +1,20 @@ +defineTest(isQtMinimum) { + !equals(QT_MAJOR_VERSION, $$1): return(false) + count(ARGS, 1, greaterThan) { + lessThan(QT_MINOR_VERSION, $$2): return(false) + } + return(true) +} + +!isQtMinimum(5, 8) { + defineTest(qtConfig) { + contains(QT_CONFIG, $$1): return(true) + return(false) + } +} + defineTest(isPlatformSupported) { + QT_FOR_CONFIG += gui-private linux { !gcc:!clang { skipBuild("Qt WebEngine on Linux requires clang or GCC.") @@ -11,20 +27,24 @@ defineTest(isPlatformSupported) { return(false) } msvc { - !equals(MSVC_VER, "12.0"):!equals(MSVC_VER, "14.0") { - skipBuild("Qt WebEngine on Windows requires MSVC 2013 or MSVC 2015.") + !equals(MSVC_VER, "14.0") { + skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") return(false) } } else { - skipBuild("Qt WebEngine on Windows requires MSVC 2013 or MSVC 2015.") + skipBuild("Qt WebEngine on Windows requires MSVC 2015 Update 2 or later.") return(false) } isBuildingOnWin32() { skipBuild("Qt WebEngine on Windows must be built on a 64-bit machine.") } + !isMinWinSDKVersion(10, 10586): { + skipBuild("Qt WebEngine on Windows requires a Windows SDK version 10.0.10586 or newer.") + return(false) + } } else:osx { - lessThan(QMAKE_XCODE_VERSION, 6.1) { - skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 6.1 is required to build Qt WebEngine.") + lessThan(QMAKE_XCODE_VERSION, 5.1) { + skipBuild("Using XCode version $$QMAKE_XCODE_VERSION, but at least version 5.1 is required to build Qt WebEngine.") return(false) } # We require OS X 10.9 (darwin version 13.0.0) or newer @@ -46,7 +66,7 @@ defineTest(isPlatformSupported) { skipBuild("C++11 support is required in order to build chromium.") return(false) } - contains(QT_CONFIG, mirclient) { + qtConfig(mirclient) { skipBuild("Mir is not yet supported as graphics backend for Qt WebEngine.") return(false) } @@ -56,6 +76,7 @@ defineTest(isPlatformSupported) { } !isPythonVersionSupported(): return(false) !isArchSupported(): return(false) + isSanitizerEnabled():!isSanitizerSupported():!forceSanitizerBuild(): return(false) return(true) } @@ -87,6 +108,106 @@ defineTest(isPythonVersionSupported) { return(false) } +defineTest(isSanitizerEnabled) { + sanitize_address|sanitize_memory|sanitize_undefined|sanitize_thread: return(true) + return(false) +} + +defineTest(forceSanitizerBuild) { + contains(WEBENGINE_CONFIG, force_sanitizer_build): return(true) + skipBuild("Chosen sanitizer configuration is not supported. Use WEBENGINE_CONFIG+=force_sanitizer_build to force build with the chosen sanitizer configuration.") + return(false) +} + +defineTest(isSanitizerSupported) { + sanitizer_combo_supported = true + sanitize_address { + asan_supported = false + linux-clang-libc++:isSanitizerSupportedOnLinux() { + asan_supported = true + } else:macos:isSanitizerSupportedOnMacOS() { + asan_supported = true + } + !$$asan_supported { + sanitizer_combo_supported = false + warning("An address sanitizer-enabled Qt WebEngine build can only be built on Linux or macOS using Clang and libc++.") + } + } + + sanitize_memory { + sanitizer_combo_supported = false + warning("A memory sanitizer-enabled Qt WebEngine build is not supported.") + } + + sanitize_undefined { + ubsan_supported = false + linux-clang-libc++:isSanitizerSupportedOnLinux():CONFIG(release, debug|release):!debug_and_release { + ubsan_supported = true + } + !$$ubsan_supported { + sanitizer_combo_supported = false + warning("An undefined behavior sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++ in release mode.") + } + } + + sanitize_thread { + tsan_supported = false + linux-clang-libc++:isSanitizerSupportedOnLinux() { + tsan_supported = true + } + !$$tsan_supported { + sanitizer_combo_supported = false + warning("A thread sanitizer-enabled Qt WebEngine build can only be built on Linux using Clang and libc++.") + } + } + + $$sanitizer_combo_supported: return(true) + return(false) +} + +defineTest(isSanitizerSupportedOnLinux) { + isSanitizerLinuxClangVersionSupported(): return(true) + return(false) +} + +defineTest(isSanitizerSupportedOnMacOS) { + isEmpty(QT_APPLE_CLANG_MAJOR_VERSION) { + QTWEBENGINE_CLANG_IS_APPLE = false + } else { + QTWEBENGINE_CLANG_IS_APPLE = true + } + $$QTWEBENGINE_CLANG_IS_APPLE:isSanitizerMacOSAppleClangVersionSupported(): return(true) + else:isSanitizerMacOSClangVersionSupported(): return(true) + return(false) +} + +defineTest(isSanitizerMacOSAppleClangVersionSupported) { + # Clang sanitizer suppression attributes work from Apple Clang version 7.3.0+. + greaterThan(QT_APPLE_CLANG_MAJOR_VERSION, 7): return(true) + greaterThan(QT_APPLE_CLANG_MINOR_VERSION, 2): return(true) + + warning("Using Apple Clang version $${QT_APPLE_CLANG_MAJOR_VERSION}.$${QT_APPLE_CLANG_MINOR_VERSION}.$${QT_APPLE_CLANG_PATCH_VERSION}, but at least Apple Clang version 7.3.0 is required to build a sanitizer-enabled Qt WebEngine.") + return(false) +} + +defineTest(isSanitizerMacOSClangVersionSupported) { + # Clang sanitizer suppression attributes work from non-apple Clang version 3.7+. + greaterThan(QT_CLANG_MAJOR_VERSION, 3): return(true) + greaterThan(QT_CLANG_MINOR_VERSION, 6): return(true) + + warning("Using Clang version $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.") + return(false) +} + +defineTest(isSanitizerLinuxClangVersionSupported) { + # Clang sanitizer suppression attributes work from Clang version 3.7+. + greaterThan(QT_CLANG_MAJOR_VERSION, 3): return(true) + greaterThan(QT_CLANG_MINOR_VERSION, 6): return(true) + + warning("Using Clang version $${QT_CLANG_MAJOR_VERSION}.$${QT_CLANG_MINOR_VERSION}, but at least Clang version 3.7 is required to build a sanitizer-enabled Qt WebEngine.") + return(false) +} + defineTest(isGCCVersionSupported) { # The below will work for gcc 4.7 and up and also match gcc 5 greaterThan(QT_GCC_MINOR_VERSION, 6):return(true) @@ -96,7 +217,7 @@ defineTest(isGCCVersionSupported) { } defineTest(isQMLTestSupportApiEnabled) { - contains(QT_CONFIG, private_tests): return(true) # enable for developer-build + qtConfig(private_tests): return(true) # enable for developer-build contains(QT_BUILD_PARTS, tests): return(true) contains(WEBENGINE_CONFIG, testsupport): return(true) return(false) @@ -134,6 +255,22 @@ defineTest(isMinOSXSDKVersion) { return(false) } +defineTest(isMinWinSDKVersion) { + requested_major = $$1 + requested_minor = $$2 + WIN_SDK_VERSION = $$(WindowsSDKVersion) + + # major.0.minor + major_version = $$section(WIN_SDK_VERSION, ., 0, 0) + minor_version = $$section(WIN_SDK_VERSION, ., 2, 2) + + greaterThan(major_version, $$requested_major):return(true) + equals(major_version, $$requested_major):greaterThan(minor_version, $$requested_minor):return(true) + equals(major_version, $$requested_major):equals(minor_version, $$requested_minor)::return(true) + + return(false) +} + # Map to the correct target type for gyp defineReplace(toGypTargetType) { equals(TEMPLATE, "app"):return("executable") @@ -238,28 +375,17 @@ defineReplace(findOrBuildNinja) { !exists($$out) { src_3rd_party_dir = $$absolute_path("$${getChromiumSrcDir()}/../", "$$QTWEBENGINE_ROOT") - out = $$shadowed($$absolute_path("ninja/ninja", "$$src_3rd_party_dir")) + out = $$shadowed($$absolute_path(ninja/ninja, $$src_3rd_party_dir)) win32: out = $${out}.exe - out = $$system_path($$out) # If we did not find ninja, then we bootstrap it. !exists($$out) { - # If we are making a shadow build, copy the ninja sources to the build directory. - !equals(PWD, $${OUT_PWD}) { - log("Build directory is different from source directory - copying ninja sources to the build tree...") - shadow_3rd_party_path = $$system_path($$shadowed($$src_3rd_party_dir)) - - !exists($$dirname(out)): mkpath($$dirname(out)) - copy_dir_files { - system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$dirname(out))") - } else { - system("$$QMAKE_COPY_DIR $$system_quote($$system_path($$absolute_path("ninja", "$$src_3rd_party_dir"))) $$system_quote($$shadow_3rd_party_path)") - } - } - system("cd $$system_quote($$dirname(out)) && python configure.py --bootstrap") + mkpath($$dirname(out)) + ninja_configure = $$absolute_path(ninja/configure.py, $$src_3rd_party_dir) + system("cd $$system_quote($$system_path($$dirname(out))) && python $$system_quote($$system_path($$ninja_configure)) --bootstrap") } } - return($$out) + return($$system_path($$out)) } defineTest(skipBuild) { diff --git a/tools/qmake/mkspecs/features/gyp_generator.prf b/tools/qmake/mkspecs/features/gyp_generator.prf index 4cf7cd2f4..2fbd74730 100644 --- a/tools/qmake/mkspecs/features/gyp_generator.prf +++ b/tools/qmake/mkspecs/features/gyp_generator.prf @@ -14,6 +14,8 @@ defineReplace(mocAction) { OUTPUT_NAME = $$mocOutput($$INPUT_FILE) DEFINES_LIST = $$join(DEFINES, " -D", -D) INCPATH = $$join(INCLUDEPATH, " -I", -I) + # we don't generate a moc_predef file yet. + MOC_PREDEF_FILE = MOC_COMMAND = $$clean_path($$mocCmdBase()) MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(DEFINES)"), $$DEFINES_LIST) MOC_COMMAND = $$replace(MOC_COMMAND, $$re_escape("$(INCPATH)"), $$INCPATH) diff --git a/tools/scripts/take_snapshot.py b/tools/scripts/take_snapshot.py index 25b3dc15e..316805b6d 100755 --- a/tools/scripts/take_snapshot.py +++ b/tools/scripts/take_snapshot.py @@ -44,8 +44,6 @@ os.chdir(qtwebengine_root) def isInGitBlacklist(file_path): # We do need all the gyp files. - if file_path.endswith('.gyp') or file_path.endswith('.gypi') or file_path.endswith('.isolate'): - False if ( '.gitignore' in file_path or '.gitmodules' in file_path or '.gitattributes' in file_path @@ -59,6 +57,10 @@ def isInChromiumBlacklist(file_path): # We do need all the gyp files. if file_path.endswith('.gyp') or file_path.endswith('.gypi') or file_path.endswith('.isolate'): return False + # We do need all the gn file. + if file_path.endswith('.gn') or file_path.endswith('.gni') or file_path.endswith('typemap') or \ + file_path.endswith('.mojom'): + return False if ( '_jni' in file_path or 'jni_' in file_path or 'testdata/' in file_path @@ -91,9 +93,17 @@ def isInChromiumBlacklist(file_path): not 'third_party/chromevox' in file_path and not 'media/desktop_media_list.h' in file_path and not 'media/desktop_streams_registry.' in file_path and + not 'common/chrome_constants.' in file_path and + not 'common/chrome_paths' in file_path and not 'common/chrome_switches.' in file_path and - not 'common/localized_error.' in file_path and + not 'common/content_restriction.h' in file_path and not 'common/spellcheck_' in file_path and + not 'common/url_constants' in file_path and + not '/extensions/api/' in file_path and + not '/extensions/browser/api/' in file_path and + not '/extensions/permissions/' in file_path and + not '/renderer_host/pepper/' in file_path and + not '/renderer/pepper/' in file_path and not '/spellchecker/' in file_path and not '/tools/convert_dict/' in file_path and not file_path.endswith('cf_resources.rc') and @@ -105,47 +115,32 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('chrome_frame') or file_path.startswith('chromeos') or file_path.startswith('cloud_print') - or (file_path.startswith('components') and - not file_path.startswith('components/cdm') and - not file_path.startswith('components/device_event_log') and - not file_path.startswith('components/devtools_') and - not file_path.startswith('components/error_page') and - not file_path.startswith('components/keyed_service') and - not file_path.startswith('components/mime_util') and - not file_path.startswith('components/precache') and - not file_path.startswith('components/pref_registry') and - not file_path.startswith('components/printing') and - not file_path.startswith('components/resources') and - not file_path.startswith('components/scheduler') and - not file_path.startswith('components/security_interstitials') and - not file_path.startswith('components/startup_metric_utils') and - not file_path.startswith('components/strings') and - not file_path.startswith('components/tracing') and - not file_path.startswith('components/url_formatter') and - not file_path.startswith('components/user_prefs') and - not file_path.startswith('components/version_') and - not file_path.startswith('components/visitedlink') and - not file_path.startswith('components/web_cache') and - not file_path.startswith('components/webcrypto') and - not file_path.startswith('components/webusb') and - not file_path.endswith('.grd') and - not file_path.endswith('.grdp') and - not 'components_strings' in file_path) + or file_path.startswith('components/chrome_apps/') + or file_path.startswith('components/cronet/') + or file_path.startswith('components/drive/') + or file_path.startswith('components/invalidation/') + or file_path.startswith('components/gcm_driver/') + or file_path.startswith('components/mus/') + or file_path.startswith('components/nacl/') + or file_path.startswith('components/omnibox/') + or file_path.startswith('components/policy/') + or file_path.startswith('components/proximity_auth/') + or (file_path.startswith('components/resources/terms/') and not file_path.endswith('terms_chromium.html')) + or file_path.startswith('components/rlz/') + or file_path.startswith('components/sync_driver/') + or file_path.startswith('components/test/') + or file_path.startswith('components/test_runner/') + or file_path.startswith('components/translate/') or file_path.startswith('content/public/android/java') or (file_path.startswith('content/shell') and - not file_path.startswith('content/shell/common')) + not file_path.startswith('content/shell/common') and + not file_path.endswith('.grd')) or file_path.startswith('courgette') - or (file_path.startswith('extensions') and - not 'browser/extension_function_registry.h' in file_path and - not 'browser/extension_function_histogram_value.h' in file_path and - not 'browser/notification_types.cc' in file_path and - not 'browser/notification_types.h' in file_path) or file_path.startswith('google_update') or file_path.startswith('ios') or file_path.startswith('media/base/android/java') or file_path.startswith('native_client') or file_path.startswith('net/android/java') - or file_path.startswith('pdf') or file_path.startswith('remoting') or file_path.startswith('rlz') or file_path.startswith('sync') @@ -185,7 +180,8 @@ def isInChromiumBlacklist(file_path): or file_path.startswith('third_party/jsr-305/src') or file_path.startswith('third_party/junit') or file_path.startswith('third_party/libphonenumber') - or file_path.startswith('third_party/libaddressinput') + or file_path.startswith('third_party/libaddressinput/src/testdata') + or file_path.startswith('third_party/libaddressinput/src/common/src/test') or file_path.startswith('third_party/libc++') or file_path.startswith('third_party/liblouis') or file_path.startswith('third_party/lighttpd') @@ -195,32 +191,22 @@ def isInChromiumBlacklist(file_path): or (file_path.startswith('third_party/polymer') and not file_path.startswith('third_party/polymer/v1_0/components-chromium/')) or file_path.startswith('third_party/openh264/src/res') + or file_path.startswith('third_party/pdfium/tools') or file_path.startswith('third_party/pdfsqueeze') or file_path.startswith('third_party/pefile') or file_path.startswith('third_party/perl') - or file_path.startswith('third_party/pdfium') or file_path.startswith('third_party/psyco_win32') or file_path.startswith('third_party/scons-2.0.1') or file_path.startswith('third_party/sfntly/src/cpp/data/fonts') or file_path.startswith('third_party/trace-viewer') or file_path.startswith('third_party/undoview') or file_path.startswith('third_party/webgl') + or file_path.startswith('tools/android') + or file_path.startswith('tools/luci_go') + or file_path.startswith('tools/metrics') or file_path.startswith('tools/memory_inspector') - or (file_path.startswith('tools') and - not file_path.startswith('tools/clang') and - not file_path.startswith('tools/compile_test') and - not file_path.startswith('tools/generate_library_loader') and - not file_path.startswith('tools/generate_shim_headers') and - not file_path.startswith('tools/generate_stubs') and - not file_path.startswith('tools/grit') and - not file_path.startswith('tools/gyp') and - not file_path.startswith('tools/json_comment_eater') and - not file_path.startswith('tools/json_schema_compiler') and - not file_path.startswith('tools/idl_parser') and - not file_path.startswith('tools/memory') and - not file_path.startswith('tools/msan') and - not file_path.startswith('tools/protoc_wrapper') and - not file_path.startswith('tools/ubsan')) + or file_path.startswith('tools/perf') + or file_path.startswith('tools/swarming_client') or file_path.startswith('ui/android/java') or file_path.startswith('ui/app_list') or file_path.startswith('ui/base/ime/chromeos') diff --git a/tools/scripts/version_resolver.py b/tools/scripts/version_resolver.py index 6029bbdc9..e481f0ed0 100644 --- a/tools/scripts/version_resolver.py +++ b/tools/scripts/version_resolver.py @@ -38,9 +38,9 @@ import json import urllib2 import git_submodule as GitSubmodule -chromium_version = '49.0.2623.111' -chromium_branch = '2623' -ninja_version = 'v1.6.0' +chromium_version = '53.0.2785.148' +chromium_branch = '2785' +ninja_version = 'v1.7.1' json_url = 'http://omahaproxy.appspot.com/all.json' diff --git a/tools/scripts/windeploy-examples.py b/tools/scripts/windeploy-examples.py new file mode 100755 index 000000000..c41a5bc31 --- /dev/null +++ b/tools/scripts/windeploy-examples.py @@ -0,0 +1,393 @@ +#!/usr/bin/env python + +############################################################################# +# +# Copyright (C) 2015 The Qt Company Ltd. +# Contact: http://www.qt.io/licensing/ +# +# This file is part of the QtWebEngine module of the Qt Toolkit. +# +# $QT_BEGIN_LICENSE:LGPL$ +# 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 http://www.qt.io/terms-conditions. For further +# information use the contact form at http://www.qt.io/contact-us. +# +# GNU Lesser General Public License Usage +# Alternatively, this file may be used under the terms of the GNU Lesser +# General Public License version 2.1 as published by the Free Software +# Foundation and appearing in the file LICENSE.LGPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU Lesser General Public License version 2.1 requirements +# will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +# +# As a special exception, The Qt Company gives you certain additional +# rights. These rights are described in The Qt Company LGPL Exception +# version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +# +# GNU General Public License Usage +# Alternatively, this file may be used under the terms of the GNU +# General Public License version 3.0 as published by the Free Software +# Foundation and appearing in the file LICENSE.GPL included in the +# packaging of this file. Please review the following information to +# ensure the GNU General Public License version 3.0 requirements will be +# met: http://www.gnu.org/copyleft/gpl.html. +# +# +# $QT_END_LICENSE$ +# +############################################################################# + +import argparse +import os +import re +import subprocess +import shutil +import sys + + +class Api: + QUICK = "webengine" + WIDGET = "webenginewidgets" + + +class Mode: + RELEASE = "release" + DEBUG = "debug" + + +def is_windows(): + return os.name == "nt" + + +class ArgManager(object): + def __init__(self): + try: + self.__args = self.__parse() + except: + raise + + self.build_dir = self.__args.build_dir + self.src_dir = self.__args.src_dir + self.example_filter = re.compile("%s-%s-%s" % (self.__api_filter(), self.__name_filter(), self.__mode_filter())) + self.list_examples = self.__args.list_examples + self.force = self.__args.force + self.verbose = self.__args.verbose + self.out_dir = self.__args.out_dir + + def __parse(self): + ap = argparse.ArgumentParser(description="Deploy QtWebEngine example binaries on Windows.") + ap.add_argument("--release", dest="release", action="store_true", default=False, + help="Deploy release binaries only") + ap.add_argument("--debug", dest="debug", action="store_true", default=False, + help="Deploy debug binaries only") + ap.add_argument("--quick", dest="quick", action="store_true", default=False, + help="Deploy quick examples only") + ap.add_argument("--widget", dest="widget", action="store_true", default=False, + help="Deploy widget examples only") + ap.add_argument("-e", "--examples", dest="examples", nargs="+", action="store", default=".*", + help="Select example to deploy") + ap.add_argument("-l", "--list-examples", dest="list_examples", action="store_true", default=False, + help="List available examples") + ap.add_argument("-f", "--force", dest="force", action="store_true", default=False, + help="Force to overwrite existing files") + ap.add_argument("-v", "--verbose", dest="verbose", action="store_true", default=False, + help="Print windeployqt output") + ap.add_argument("--src-dir", dest="src_dir", action="store", type=self.__validate_src_dir, default=None, + help="Specify path of Qt sources. It is used for finding QML files of the example" + "and scanning for QML imports") + ap.add_argument("--build-dir", dest="build_dir", action="store", type=self.__validate_build_dir, default=None, + help="Specify path of the Qt binaries. It is used for finding qmake.exe, windeployqt.exe and" + "binaries of the examples. It is not necessary to set if qmake.exe is set in the path") + ap.add_argument("-o", "--out-dir", dest="out_dir", action="store", default=os.getcwd(), + help="Specify path for the deployed examples. If it is not set" + "current working directory is used") + return ap.parse_args() + + def __validate_src_dir(self, src_dir): + if not os.path.exists(src_dir): + raise OSError("The specified Qt source directory does not exist: %s" % src_dir) + + qtwebengine_dir = src_dir + # Accept Qt top level source directory too + if os.path.exists(os.path.join(src_dir, "qtwebengine")): + qtwebengine_dir = os.path.join(src_dir, "qtwebengine") + + examples_dir = os.path.join(qtwebengine_dir, "examples") + must_have_paths = [ + os.path.join(examples_dir, "examples.pro"), + os.path.join(examples_dir, Api.QUICK), + os.path.join(examples_dir, Api.WIDGET), + ] + + # Check whether src_dir is the proper QtWebEngine source directory + for p in must_have_paths: + if not os.path.exists(p): + raise OSError("The specified Qt source directory is invalid: %s" % src_dir) + + return src_dir + + def __validate_build_dir(self, build_dir): + if not os.path.exists(build_dir): + raise OSError("The specified Qt build directory does not exist: %s" % build_dir) + + # Accept QtWebEngine build directory too + if os.path.basename(build_dir) == "qtwebengine": + build_dir = os.path.abspath(os.path.join(build_dir, "..")) + + # Attempt to support custom build directories + if os.path.exists(os.path.join(build_dir, "bin", "qmake.exe")): + return build_dir + + # Check existence of qtbase/bin/qmake.exe + qtbase_dir = os.path.join(build_dir, "qtbase") + if not os.path.exists(os.path.join(qtbase_dir, "bin", "qmake.exe")): + raise OSError("Program 'qmake.exe' cannot be found in the specified Qt build directory: %s" % build_dir) + + return qtbase_dir + + def __mode_filter(self): + if self.__args.release and not self.__args.debug: + return Mode.RELEASE + if not self.__args.release and self.__args.debug: + return Mode.DEBUG + return ".*" + + def __api_filter(self): + if self.__args.quick and not self.__args.widget: + return Api.QUICK + if not self.__args.quick and self.__args.widget: + return Api.WIDGET + return ".*" + + def __name_filter(self): + alt_list = [] + + examples = self.__args.examples + if not isinstance(examples, list): + examples = [examples] + + for e in examples: + if "," in e: + alt_list.extend(e.split(",")) + else: + alt_list.append(e) + + return "|".join(alt_list) + + +class QtHelper(object): + def __init__(self, build_path=None, src_path=None): + self.__build_path = build_path if build_path is not None else "" + self.__src_path = src_path if src_path is not None else "" + self.__query = {} + self.__angle = None + + self.__qmake = "qmake.exe" + self.__windeployqt = "windeployqt.exe" + if build_path: + self.__qmake = os.path.join(self.__build_path, "bin", self.__qmake) + self.__windeployqt = os.path.join(self.__build_path, "bin", self.__windeployqt) + + try: + program = self.__qmake + subprocess.check_output([program, "-v"]) + program = self.__windeployqt + subprocess.check_output([program, "-h"]) + except OSError as e: + raise OSError("Program '%s' cannot be executed\n%s" % (program, e)) + except: + raise + + self.__query = self.get_query() + self.__build_path = self.get_build_path() + self.__src_path = self.get_src_path() + self.__angle = self.has_angle() + + def get_query(self): + if self.__query: + return self.__query + + qmake_output = subprocess.check_output([self.__qmake, "-query"]).split("\r\n") + query = {} + for line in qmake_output: + entry = line.split(":", 1) + if len(entry) != 2: + continue + query[entry[0]] = entry[1] + return query + + def get_build_path(self): + return os.path.abspath(os.path.join(self.__query["QT_INSTALL_PREFIX"], "..")) + + def get_src_path(self): + if self.__src_path: + return self.__src_path + + if "QT_INSTALL_PREFIX/src" in self.__query: + return os.path.abspath(os.path.join(self.__query["QT_INSTALL_PREFIX/src"], "..")) + + return self.__build_path + + def get_windeployqt(self): + return self.__windeployqt + + def has_angle(self): + if self.__angle: + return self.__angle + + qconfig_pri_path = os.path.abspath(os.path.join(self.__query["QT_HOST_PREFIX"], "mkspecs", "qconfig.pri")) + print(qconfig_pri_path) + if not os.path.exists(qconfig_pri_path): + sys.stderr.write("Configuration file qconfig.pri cannot be found. Fallback to desktop GL mode.\n") + return False + + qt_config = [] + + qconfig_pri = open(qconfig_pri_path, "r") + for line in qconfig_pri: + if line.startswith("QT_CONFIG +="): + qt_config = re.match("^QT_CONFIG \+= (.+)$", line).group(1).split(" ") + qconfig_pri.close() + + return "angle" in qt_config + + def collect_examples(self): + examples = [] + + for api in [Api.QUICK, Api.WIDGET]: + examples_root_dir_path = os.path.join(self.__build_path, "qtwebengine", "examples", api) + if not os.path.exists(examples_root_dir_path): + continue + + for example in os.listdir(examples_root_dir_path): + example_dir_path = os.path.join(examples_root_dir_path, example) + if not os.path.exists(example_dir_path): + continue + + example_src_path = os.path.join(self.__src_path, "qtwebengine", "examples", api, example) + + for mode in [Mode.RELEASE, Mode.DEBUG]: + example_exe_path = os.path.join(example_dir_path, mode, example + ".exe") + if not os.path.exists(example_exe_path): + continue + examples.append(Example(example, api, mode, self.__angle, example_exe_path, example_src_path)) + + return examples + + +class Example(str): + def __new__(cls, example, api, mode, angle, exe_path, src_path): + obj = str.__new__(cls, "%s-%s-%s" % (api, example, mode)) + return obj + + def __init__(self, example, api, mode, angle, exe_path, src_path): + super(Example, self).__init__("%s-%s-%s" % (api, example, mode)) + self.__name = example + self.__api = api + self.__mode = mode + self.__angle = angle + self.__exe_path = exe_path + self.__src_path = src_path + + def get_deploy_params(self, mode, force): + deploy_params = [] + deploy_params.append("--%s" % mode) + deploy_params.append("--compiler-runtime") + + if self.__angle: + deploy_params.append("--angle") + + if force: + deploy_params.append("--force") + + if self.__api is Api.QUICK: + deploy_params.append("--qmldir") + deploy_params.append(self.__src_path) + + if self.__mode is Mode.DEBUG: + deploy_params.append("--pdb") + + return deploy_params + + def name(self): + return self.__name + + def deploy(self, qt, dest_path, force=False, verbose=False): + src_path = os.path.dirname(self.__exe_path) + for f in os.listdir(src_path): + shutil.copy(os.path.join(src_path, f), dest_path) + + deploy_command = [] + deploy_command.append(qt.get_windeployqt()) + # Debug executables also need the release libraries + deploy_command.extend(self.get_deploy_params(Mode.RELEASE, force)) + deploy_command.append(dest_path) + + if verbose: + print("%s" % " ".join(deploy_command)) + + out = None if verbose else open(os.devnull, "w") + exit_code = subprocess.call(deploy_command, stdout=out) + + if self.__mode is Mode.DEBUG and not exit_code: + param_release = "--%s" % Mode.RELEASE + param_debug = "--%s" % Mode.DEBUG + deploy_command = map(lambda item: param_debug if item == param_release else item, deploy_command) + + if verbose: + print("%s" % " ".join(deploy_command)) + + exit_code = subprocess.call(deploy_command, stdout=out) + + if out is not None: + out.close() + + return exit_code + + +def main(): + try: + args = ArgManager() + + if not is_windows(): + raise OSError("This script works on Windows only\n") + + qt = QtHelper(args.build_dir, args.src_dir) + except Exception as e: + sys.stderr.write(str(e)) + exit(1) + + example_list = filter((lambda e: args.example_filter.match(e)), qt.collect_examples()) + if not example_list: + print("There is no example that fulfills the requirements") + return + + for example in example_list: + if args.list_examples: + print(example.name()) + continue + + print("Deploying %s ..." % example.name()) + dest_path = os.path.abspath(os.path.join(args.out_dir, example.name())) + if not os.path.exists(dest_path): + os.makedirs(dest_path) + elif os.listdir(dest_path) and not args.force: + sys.stderr.write("Destination directory is not empty: %s\n" % dest_path) + sys.stderr.write("Skip deploying %s\n" % example.name()) + continue + + exit_code = example.deploy(qt, dest_path, args.force, args.verbose) + if exit_code: + sys.stderr.write("Deploy of example '%s' has failed: %s\n" % (example.name(), exit_code)) + exit(exit_code) + + print("Example '%s' has been successfully deployed at %s" % (example.name(), dest_path)) + + return + +if __name__ == "__main__": + main() |