aboutsummaryrefslogtreecommitdiff
path: root/vcpkg/ports/qtwebengine
diff options
context:
space:
mode:
authorEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
committerEthan Morgan <ethan@gweithio.com>2026-02-14 16:44:06 +0000
commit54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch)
treed915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/qtwebengine
move to own git serverHEADmaster
Diffstat (limited to 'vcpkg/ports/qtwebengine')
-rw-r--r--vcpkg/ports/qtwebengine/clang-cl.patch24
-rw-r--r--vcpkg/ports/qtwebengine/cross-build.diff22
-rw-r--r--vcpkg/ports/qtwebengine/disable-host-pkgconfig.diff12
-rw-r--r--vcpkg/ports/qtwebengine/fix-error2275-2672.patch13
-rw-r--r--vcpkg/ports/qtwebengine/include-dir-order.diff45
-rw-r--r--vcpkg/ports/qtwebengine/nested-name-fix.patch13
-rw-r--r--vcpkg/ports/qtwebengine/osx-sdk-info.diff93
-rw-r--r--vcpkg/ports/qtwebengine/pdf-system-libjpeg.diff15
-rw-r--r--vcpkg/ports/qtwebengine/pdf-system-libpng.diff12
-rw-r--r--vcpkg/ports/qtwebengine/pkg-config.diff13
-rw-r--r--vcpkg/ports/qtwebengine/portfile.cmake283
-rw-r--r--vcpkg/ports/qtwebengine/rpath.diff22
-rw-r--r--vcpkg/ports/qtwebengine/vcpkg.json241
13 files changed, 808 insertions, 0 deletions
diff --git a/vcpkg/ports/qtwebengine/clang-cl.patch b/vcpkg/ports/qtwebengine/clang-cl.patch
new file mode 100644
index 0000000..03c87b8
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/clang-cl.patch
@@ -0,0 +1,24 @@
+diff --git a/src/3rdparty/gn/build/build_win.ninja.template b/src/3rdparty/gn/build/build_win.ninja.template
+index 7d2704c..b14186b 100644
+--- a/src/3rdparty/gn/build/build_win.ninja.template
++++ b/src/3rdparty/gn/build/build_win.ninja.template
+@@ -8,5 +8,5 @@ rule alink_thin
+ description = LIB $out
+
+ rule link
+- command = $ld /nologo $in /link $ldflags /PDB:$out.pdb /OUT:$out $solibs $libs
++ command = $ld /nologo $in $ldflags /PDB:$out.pdb /OUT:$out $solibs $libs
+ description = LINK $out
+diff --git a/src/gn/CMakeLists.txt b/src/gn/CMakeLists.txt
+index 0fe3e4e..1e2556f 100644
+--- a/src/gn/CMakeLists.txt
++++ b/src/gn/CMakeLists.txt
+@@ -31,7 +31,7 @@ find_package(Ninja 1.7.2 REQUIRED)
+
+ if(WIN32)
+ set(GN_EXECUTABLE gn.exe)
+- if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW)
++ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND NOT MINGW OR MSVC)
+ # Use lld-link instead of clang-cl.
+ set(GN_LINKER ${CMAKE_LINKER})
+ endif()
diff --git a/vcpkg/ports/qtwebengine/cross-build.diff b/vcpkg/ports/qtwebengine/cross-build.diff
new file mode 100644
index 0000000..26e7436
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/cross-build.diff
@@ -0,0 +1,22 @@
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 789f15bc6..be3ea630d 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -114,7 +114,7 @@ endif()
+ # HOST PROJECT
+ ##
+
+-if(CMAKE_CROSSCOMPILING AND NOT IOS AND NOT MACOS AND NOT WIN32)
++if(0)
+
+ if(NOT Gn_FOUND)
+ message(FATAL_ERROR "\nHost gn not found - cross compilation not possible")
+@@ -148,7 +148,7 @@ if(CMAKE_CROSSCOMPILING AND NOT IOS AND NOT MACOS)
+ endif()
+
+ # install gn for cross build
+-if((LINUX OR MACOS OR WIN32) AND INSTALL_GN)
++if(NOT CMAKE_CROSSCOMPILING AND INSTALL_GN)
+ if(NOT QT_WILL_INSTALL)
+ set(copyOutput
+ ${QT_BUILD_DIR}/${INSTALL_LIBEXECDIR}/gn${CMAKE_EXECUTABLE_SUFFIX}
diff --git a/vcpkg/ports/qtwebengine/disable-host-pkgconfig.diff b/vcpkg/ports/qtwebengine/disable-host-pkgconfig.diff
new file mode 100644
index 0000000..e57b665
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/disable-host-pkgconfig.diff
@@ -0,0 +1,12 @@
+diff --git a/cmake/QtToolchainHelpers.cmake b/cmake/QtToolchainHelpers.cmake
+index 8d5a97777..08296e504 100644
+--- a/cmake/QtToolchainHelpers.cmake
++++ b/cmake/QtToolchainHelpers.cmake
+@@ -142,6 +142,7 @@ endfunction()
+ function(create_pkg_config_wrapper wrapperName wrapperCmd)
+ file(WRITE ${wrapperName}
+ "#!/bin/sh\n"
++ "exit 0\n"
+ "unset PKG_CONFIG_LIBDIR\n"
+ "unset PKG_CONFIG_PATH\n"
+ "unset PKG_CONFIG_SYSROOT_DIR\n"
diff --git a/vcpkg/ports/qtwebengine/fix-error2275-2672.patch b/vcpkg/ports/qtwebengine/fix-error2275-2672.patch
new file mode 100644
index 0000000..729a6e2
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/fix-error2275-2672.patch
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc b/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc
+index ce06089..61534f1 100644
+--- a/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc
++++ b/src/3rdparty/chromium/v8/src/compiler/backend/instruction-selector.cc
+@@ -875,7 +875,7 @@ class InstructionSelectorT<Adapter>::CachedStateValuesBuilder {
+ InstructionSelectorT<Adapter>::CachedStateValues* Build(Zone* zone) {
+ DCHECK(CanCache());
+ DCHECK(values_->nested_count() == nested_start_);
+- return zone->New<InstructionSelectorT<Adapter>::CachedStateValues>(
++ return zone->New<typename InstructionSelectorT<Adapter>::CachedStateValues>(
+ zone, values_, values_start_, inputs_, inputs_start_);
+ }
+
diff --git a/vcpkg/ports/qtwebengine/include-dir-order.diff b/vcpkg/ports/qtwebengine/include-dir-order.diff
new file mode 100644
index 0000000..093cd44
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/include-dir-order.diff
@@ -0,0 +1,45 @@
+diff --git a/src/core/configure/BUILD.root.gn.in b/src/core/configure/BUILD.root.gn.in
+index 214ef6e715..8b76e08309 100644
+--- a/src/core/configure/BUILD.root.gn.in
++++ b/src/core/configure/BUILD.root.gn.in
+@@ -74,11 +74,22 @@ config("QtWebEngineCore_config") {
+ defines = [
+ @GN_DEFINES@,
+ ]
++ # Don't let <vcpkg-installed>/include appear in QtWebEngineCore_config:
++ # vendored dependencies (protobuf, dawn, skia, ...) have inter-dependencies
++ # which must not accidentally pick headers from installed ports.
++ # Instead, attach these includes to a source_set used as another dependency.
++}
++config("QtWebEngineCore_include_dirs_config") {
+ include_dirs = [
+ @GN_INCLUDE_DIRS@,
+ rebase_path("${target_gen_dir}/.moc/")
+ ]
+ }
++source_set("QtWebEngineCore_include_dirs") {
++ public_configs = [
++ ":QtWebEngineCore_include_dirs_config"
++ ]
++}
+
+ declare_args() {
+ use_embedded_config = false
+@@ -214,6 +225,8 @@ shared_library("QtWebEngineCore") {
+ "//tools/v8_context_snapshot:v8_context_snapshot"
+ ]
+ }
++ # Complements QtWebEngineCore_config modifcation
++ deps += [ ":QtWebEngineCore_include_dirs" ]
+ }
+
+ source_set("qtwebengine_spellcheck_sources") {
+@@ -571,6 +584,8 @@ if (is_win) {
+ "@GN_SOURCE_ROOT@/sandbox_win.cpp"
+ ]
+ public_deps = [ "//sandbox/win:sandbox" ]
++ # Complements QtWebEngineCore_config modifcation
++ deps = [ ":QtWebEngineCore_include_dirs" ]
+ }
+ }
+
diff --git a/vcpkg/ports/qtwebengine/nested-name-fix.patch b/vcpkg/ports/qtwebengine/nested-name-fix.patch
new file mode 100644
index 0000000..3f25409
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/nested-name-fix.patch
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/chromium/v8/src/heap/cppgc/marking-state.h b/src/3rdparty/chromium/v8/src/heap/cppgc/marking-state.h
+index 4ce1ce4..2207466 100644
+--- a/src/3rdparty/chromium/v8/src/heap/cppgc/marking-state.h
++++ b/src/3rdparty/chromium/v8/src/heap/cppgc/marking-state.h
+@@ -342,7 +342,7 @@ class MutatorMarkingState final : public BasicMarkingState {
+ ~MutatorMarkingState() override = default;
+
+ inline bool MarkNoPush(HeapObjectHeader& header) {
+- return MutatorMarkingState::BasicMarkingState::MarkNoPush(header);
++ return this->MutatorMarkingState::BasicMarkingState::MarkNoPush(header);
+ }
+
+ inline void ReTraceMarkedWeakContainer(cppgc::Visitor&, HeapObjectHeader&);
diff --git a/vcpkg/ports/qtwebengine/osx-sdk-info.diff b/vcpkg/ports/qtwebengine/osx-sdk-info.diff
new file mode 100644
index 0000000..d316494
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/osx-sdk-info.diff
@@ -0,0 +1,93 @@
+diff --git a/cmake/Functions.cmake b/cmake/Functions.cmake
+index 8d5a97777..239eaa1dd 100644
+--- a/cmake/Functions.cmake
++++ b/cmake/Functions.cmake
+@@ -401,6 +401,6 @@ function(add_archiver_options target buildDir completeStatic)
+ get_target_property(cmakeTarget ${target} CMAKE_TARGET)
+ set(objects_out "${buildDir}/${cmakeTarget}_objects.o")
+ add_library(GnObject_${cmakeTarget}_${config} OBJECT IMPORTED GLOBAL)
+- target_link_libraries(${cmakeTarget} PRIVATE $<$<CONFIG:${config}>:GnObject_${cmakeTarget}_${config}>)
++ target_link_libraries(${cmakeTarget} PRIVATE $<BUILD_LOCAL_INTERFACE:$<$<CONFIG:${config}>:GnObject_${cmakeTarget}_${config}>>)
+ set_property(TARGET GnObject_${cmakeTarget}_${config} PROPERTY IMPORTED_OBJECTS_${cfg} ${objects_out})
+ endfunction()
+diff --git a/cmake/QtToolchainHelpers.cmake b/cmake/QtToolchainHelpers.cmake
+index 8d5a97777..239eaa1dd 100644
+--- a/cmake/QtToolchainHelpers.cmake
++++ b/cmake/QtToolchainHelpers.cmake
+@@ -389,6 +389,10 @@ macro(append_compiler_linker_sdk_setup)
+ use_libcxx=true
+ )
+ _qt_internal_get_apple_sdk_version(apple_sdk_version)
++ list(APPEND gnArgArg
++ CMAKE_OSX_SYSROOT="${CMAKE_OSX_SYSROOT}"
++ apple_sdk_version="${apple_sdk_version}"
++ )
+ if (apple_sdk_version LESS 13.2)
+ list(APPEND gnArgArg
+ use_sck=false
+diff --git a/src/3rdparty/chromium/build/config/apple/sdk_info.py b/src/3rdparty/chromium/build/config/apple/sdk_info.py
+index 81b06d438..03af4f2db 100755
+--- a/src/3rdparty/chromium/build/config/apple/sdk_info.py
++++ b/src/3rdparty/chromium/build/config/apple/sdk_info.py
+@@ -59,8 +59,11 @@ def FillXcodeVersion(settings, developer_dir):
+ settings['xcode_build'] = version_plist['ProductBuildVersion']
+ return
+
+- lines = subprocess.check_output(['xcodebuild',
++ try:
++ lines = subprocess.check_output(['xcodebuild',
+ '-version']).decode('UTF-8').splitlines()
++ except:
++ lines = [ 'Required: 12', 'Actual: unknown' ]
+ settings['xcode_version'] = FormatVersion(lines[0].split()[-1])
+ settings['xcode_version_int'] = int(settings['xcode_version'], 10)
+ settings['xcode_build'] = lines[-1].split()[-1]
+@@ -86,10 +89,13 @@ def FillSDKPathAndVersion(settings, platform, xcode_version):
+ settings['sdk_build'] = subprocess.check_output(
+ ['xcrun', '-sdk', platform,
+ '--show-sdk-build-version']).decode('UTF-8').strip()
+- settings['toolchains_path'] = os.path.join(
++ try:
++ settings['toolchains_path'] = os.path.join(
+ subprocess.check_output(['xcode-select',
+ '-print-path']).decode('UTF-8').strip(),
+ 'Toolchains/XcodeDefault.xctoolchain')
++ except:
++ settings['toolchains_path'] = ''
+
+
+ def CreateXcodeSymlinkAt(src, dst, root_build_dir):
+diff --git a/src/3rdparty/chromium/build/config/mac/mac_sdk.gni b/src/3rdparty/chromium/build/config/mac/mac_sdk.gni
+index 00588459e..48b4a0102 100644
+--- a/src/3rdparty/chromium/build/config/mac/mac_sdk.gni
++++ b/src/3rdparty/chromium/build/config/mac/mac_sdk.gni
+@@ -15,6 +15,8 @@ assert(
+ assert(current_os == "mac" || current_os == "android" || current_toolchain == default_toolchain)
+
+ declare_args() {
++ apple_sdk_version = ""
++ CMAKE_OSX_SYSROOT = ""
+ # The following two variables control the minimum supported version for
+ # macOS:
+ #
+@@ -115,6 +117,7 @@ if (mac_sdk_path == "" && use_system_xcode &&
+ }
+
+ if (use_system_xcode) {
++ if (CMAKE_OSX_SYSROOT == "") {
+ # The tool will print the SDK path on the first line, and the version on the
+ # second line.
+ find_sdk_args = [
+@@ -133,6 +136,12 @@ if (use_system_xcode) {
+ } else {
+ mac_bin_path = find_sdk_lines[1]
+ }
++ } else {
++ mac_sdk_version = apple_sdk_version
++ mac_sdk_build_version = ""
++ mac_sdk_path = CMAKE_OSX_SYSROOT
++ mac_bin_path = ""
++ }
+ } else {
+ mac_sdk_version = mac_sdk_official_version
+ mac_sdk_build_version = mac_sdk_official_build_version
diff --git a/vcpkg/ports/qtwebengine/pdf-system-libjpeg.diff b/vcpkg/ports/qtwebengine/pdf-system-libjpeg.diff
new file mode 100644
index 0000000..f4f90e3
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/pdf-system-libjpeg.diff
@@ -0,0 +1,15 @@
+diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
+index 95931a261..61806ee08 100644
+--- a/src/pdf/CMakeLists.txt
++++ b/src/pdf/CMakeLists.txt
+@@ -215,6 +215,10 @@ foreach(arch ${archs})
+ ARGS pdfium_use_system_libtiff
+ CONDITION QT_FEATURE_webengine_system_libtiff
+ )
++ extend_gn_list(gnArgArg
++ ARGS use_system_libjpeg
++ CONDITION QT_FEATURE_webengine_system_libjpeg
++ )
+ extend_gn_list(gnArgArg
+ ARGS use_qt_libjpeg
+ CONDITION QT_FEATURE_webengine_qt_libjpeg
diff --git a/vcpkg/ports/qtwebengine/pdf-system-libpng.diff b/vcpkg/ports/qtwebengine/pdf-system-libpng.diff
new file mode 100644
index 0000000..35967f4
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/pdf-system-libpng.diff
@@ -0,0 +1,12 @@
+diff --git a/src/pdf/CMakeLists.txt b/src/pdf/CMakeLists.txt
+index 61806ee08..00621491e 100644
+--- a/src/pdf/CMakeLists.txt
++++ b/src/pdf/CMakeLists.txt
+@@ -205,6 +205,7 @@ foreach(arch ${archs})
+ )
+ extend_gn_list(gnArgArg
+ ARGS pdfium_use_system_libpng use_system_libpng
++ skia_use_system_libpng
+ CONDITION QT_FEATURE_webengine_system_libpng
+ )
+ extend_gn_list(gnArgArg
diff --git a/vcpkg/ports/qtwebengine/pkg-config.diff b/vcpkg/ports/qtwebengine/pkg-config.diff
new file mode 100644
index 0000000..d4dfdd5
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/pkg-config.diff
@@ -0,0 +1,13 @@
+diff --git a/src/3rdparty/chromium/build/config/linux/pkg_config.gni b/src/3rdparty/chromium/build/config/linux/pkg_config.gni
+index 0d873903c..09bf2e874 100644
+--- a/src/3rdparty/chromium/build/config/linux/pkg_config.gni
++++ b/src/3rdparty/chromium/build/config/linux/pkg_config.gni
+@@ -54,7 +54,7 @@ pkg_config_script = "//build/config/linux/pkg-config.py"
+ pkg_config_args = []
+
+ common_pkg_config_args = []
+-if (sysroot != "") {
++if (sysroot != "" && !is_android) {
+ # Pass the sysroot if we're using one (it requires the CPU arch also).
+ common_pkg_config_args += [
+ "-s",
diff --git a/vcpkg/ports/qtwebengine/portfile.cmake b/vcpkg/ports/qtwebengine/portfile.cmake
new file mode 100644
index 0000000..6f9cf16
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/portfile.cmake
@@ -0,0 +1,283 @@
+set(SCRIPT_PATH "${CURRENT_INSTALLED_DIR}/share/qtbase")
+include("${SCRIPT_PATH}/qt_install_submodule.cmake")
+
+set(${PORT}_PATCHES
+ "clang-cl.patch"
+ "cross-build.diff"
+ "disable-host-pkgconfig.diff"
+ "fix-error2275-2672.patch"
+ "nested-name-fix.patch"
+ "osx-sdk-info.diff"
+ "pdf-system-libjpeg.diff"
+ "pdf-system-libpng.diff"
+ "pkg-config.diff"
+ "rpath.diff"
+ "include-dir-order.diff"
+)
+
+set(qtwebengine_target "${VCPKG_TARGET_TRIPLET}-${VCPKG_CMAKE_SYSTEM_NAME}")
+if(VCPKG_CROSSCOMPILING)
+ if(NOT qtwebengine_host STREQUAL qtwebengine_target)
+ # Port limitation: qtwebengine-chromium builds and runs host tools.
+ message(WARNING "Building for ${TARGET_TRIPLET} on ${HOST_TRIPLET} is unsupported.")
+ endif()
+ if(FEATURES STREQUAL "core")
+ set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
+ return()
+ endif()
+else()
+ file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-port-config.cmake" "set(qtwebengine_host \"${qtwebengine_target}\")\n")
+ if(FEATURES STREQUAL "core")
+ # Install only the custom gn executable.
+ set(VCPKG_BUILD_TYPE "release")
+ set(VCPKG_POLICY_EMPTY_INCLUDE_FOLDER enabled)
+ qt_install_submodule(
+ CONFIGURE_OPTIONS
+ -DBUILD_ONLY_GN=ON
+ CONFIGURE_OPTIONS_MAYBE_UNUSED
+ INSTALL_MKSPECSDIR
+ QT_BUILD_BENCHMARKS
+ QT_BUILD_EXAMPLES
+ QT_BUILD_TESTS
+ QT_MKSPECS_DIR
+ QT_USE_DEFAULT_CMAKE_OPTIMIZATION_FLAGS
+ )
+ qt_fixup_and_cleanup(TOOL_NAMES gn)
+ qt_install_copyright("${SOURCE_PATH}")
+ return()
+ endif()
+endif()
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
+FEATURES
+ "geolocation" FEATURE_webengine_geolocation
+ "geolocation" CMAKE_REQUIRE_FIND_PACKAGE_Qt6Positioning
+ "pdf" FEATURE_qtpdf_build
+ "proprietary-codecs" FEATURE_webengine_proprietary_codecs
+ "spellchecker" FEATURE_webengine_spellchecker
+ "webchannel" FEATURE_webengine_webchannel
+ "webchannel" CMAKE_REQUIRE_FIND_PACKAGE_Qt6WebChannel
+ "webengine" FEATURE_qtwebengine_build
+INVERTED_FEATURES
+ "geolocation" CMAKE_DISABLE_FIND_PACKAGE_Qt6Positioning
+ "webchannel" CMAKE_DISABLE_FIND_PACKAGE_Qt6WebChannel
+)
+
+if(VCPKG_TARGET_IS_OSX AND "spellchecker" IN_LIST FEATURES)
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_webengine_native_spellchecker=ON")
+endif()
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" static_runtime)
+ list(APPEND FEATURE_OPTIONS "-DQT_FEATURE_static_runtime=${static_runtime}")
+endif()
+
+# webengine-extensions
+# webengine-printing-and-pdf
+# webengine-pepper-plugins
+set(deactivated_features webengine_webrtc_pipewire)
+foreach(_feat IN LISTS deactivated_features)
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_${_feat}=OFF")
+endforeach()
+set(enabled_features webengine_webrtc)
+foreach(_feat IN LISTS enabled_features)
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_${_feat}=ON")
+endforeach()
+
+if(NOT VCPKG_TARGET_IS_WINDOWS)
+ # qt_configure_add_summary_entry(ARGS "webengine-system-lcms2")
+ # qt_configure_add_summary_entry(ARGS "webengine-system-libpci")
+ # + ALSA and PULSEAUDIO
+ # gbm, libpci ?
+ set(system_libs freetype glib harfbuzz libjpeg libpng libtiff libwebp libxml minizip re2 snappy zlib)
+ if(NOT VCPKG_TARGET_IS_IOS AND NOT VCPKG_TARGET_IS_OSX)
+ list(APPEND system_libs icu)
+ endif()
+ if("pdfium" IN_LIST FEATURES)
+ list(APPEND system_libs lcms2 libopenjpeg2)
+ endif()
+ if("webengine" IN_LIST FEATURES)
+ list(APPEND system_libs ffmpeg opus)
+ endif()
+ foreach(_sys_lib IN LISTS system_libs)
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_webengine_system_${_sys_lib}=ON")
+ endforeach()
+ # vcpkg ports exist, but don't work with chromium
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_webengine_system_libevent=OFF")
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_webengine_system_libvpx=OFF")
+
+ vcpkg_find_acquire_program(PKGCONFIG)
+ set(ENV{PKG_CONFIG} "${PKGCONFIG}")
+ list(APPEND FEATURE_OPTIONS "-DVCPKG_LOCK_FIND_PACKAGE_PkgConfig=ON")
+ # Note <installed>/share/Qt6/QtBuildRepoHelpers.cmake
+ list(APPEND FEATURE_OPTIONS "-DFEATURE_pkg_config=ON")
+ # Note <installed>/share/Qt6BuildInternals/QtBuildInternalsExtra.cmake
+ list(APPEND FEATURE_OPTIONS "-DQT_SKIP_BUILD_INTERNALS_PKG_CONFIG_FEATURE=ON")
+endif()
+
+vcpkg_find_acquire_program(FLEX)
+vcpkg_find_acquire_program(BISON)
+
+#vcpkg_find_acquire_program(GN) # Qt builds its own internal version
+
+find_program(NODEJS
+ NAMES node
+ PATHS
+ "${CURRENT_HOST_INSTALLED_DIR}/tools/node"
+ "${CURRENT_HOST_INSTALLED_DIR}/tools/node/bin"
+ ENV PATH
+ NO_DEFAULT_PATH
+)
+if(NOT NODEJS)
+ message(FATAL_ERROR "node not found! Please install it via your system package manager!")
+endif()
+
+get_filename_component(NODEJS_DIR "${NODEJS}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${NODEJS_DIR}")
+get_filename_component(FLEX_DIR "${FLEX}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${FLEX_DIR}")
+get_filename_component(BISON_DIR "${BISON}" DIRECTORY )
+vcpkg_add_to_path(PREPEND "${BISON_DIR}")
+
+function(download_distfile var url sha512)
+ string(REGEX REPLACE ".*/" "" filename "${url}")
+ vcpkg_download_distfile(archive
+ URLS "${url}"
+ FILENAME "${filename}"
+ SHA512 "${sha512}"
+ )
+ set("${var}" "${archive}" PARENT_SCOPE)
+endfunction()
+
+download_distfile(html5lib
+ "https://files.pythonhosted.org/packages/6c/dd/a834df6482147d48e225a49515aabc28974ad5a4ca3215c18a882565b028/html5lib-1.1-py2.py3-none-any.whl"
+ 53e828155e489176e8ea0cdc941ec6271764bbf7069b1a83c0ce8adb26694450d17d7c76b4a00a14dbb99ca203ae02b3d8c8e41953fd59499bbc8a8d4900975b
+)
+download_distfile(six
+ "https://files.pythonhosted.org/packages/b7/ce/149a00dd41f10bc29e5921b496af8b574d8413afcd5e30dfa0ed46c2cc5e/six-1.17.0-py2.py3-none-any.whl"
+ 2796b93aaac73193faeb5c93a85d23c2ae9fc4a7e57df88dc34b704a36fa62cd0b1fb5d1a74b961a23eff2467be94eb14f5f10874dfa733dc4ab59715280bbf3
+)
+download_distfile(webencodings
+ "https://files.pythonhosted.org/packages/f4/24/2a3e3df732393fed8b3ebf2ec078f05546de641fe1b667ee316ec1dcf3b7/webencodings-0.5.1-py2.py3-none-any.whl"
+ 2a34dbebc33a44a3691216104982b4a978a2a60b38881fc3704d04cb1da38ea2878b5ffec5ac19ac43f50d00c8d4165e05fdf6fa4363a564d8c5090411fc392d
+)
+x_vcpkg_get_python_packages(
+ OUT_PYTHON_VAR PYTHON3
+ PYTHON_VERSION 3
+ PACKAGES --no-index "${html5lib}" "${six}" "${webencodings}"
+)
+get_filename_component(PYTHON_DIR "${PYTHON3}" DIRECTORY )
+vcpkg_add_to_path(APPEND "${PYTHON_DIR}")
+
+vcpkg_add_to_path(PREPEND "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf")
+set(GPERF "${CURRENT_HOST_INSTALLED_DIR}/tools/gperf/gperf${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+
+if(CMAKE_HOST_WIN32) # WIN32 HOST probably has win_flex and win_bison!
+ if(NOT EXISTS "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+ file(CREATE_LINK "${FLEX}" "${FLEX_DIR}/flex${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+ endif()
+ if(NOT EXISTS "${BISON_DIR}/BISON${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+ file(CREATE_LINK "${BISON}" "${BISON_DIR}/bison${VCPKG_HOST_EXECUTABLE_SUFFIX}")
+ endif()
+endif()
+
+string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtree_length)
+# We know that C:/buildrees/${PORT} is to long to build Release. Debug works however. Means 24 length is too much but 23 might work.
+if(buildtree_length GREATER 22 AND VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
+ message(WARNING "Buildtree path '${CURRENT_BUILDTREES_DIR}' is too long.\nConsider passing --x-buildtrees-root=<shortpath> to vcpkg!\nTrying to use '${CURRENT_BUILDTREES_DIR}/../tmp'")
+ set(CURRENT_BUILDTREES_DIR "${CURRENT_BUILDTREES_DIR}/../tmp") # activly avoid long path issues in CI. -> Means CI will not return logs
+ cmake_path(NORMAL_PATH CURRENT_BUILDTREES_DIR)
+ string(LENGTH "${CURRENT_BUILDTREES_DIR}" buildtree_length_new)
+ if(buildtree_length_new GREATER 22)
+ message(FATAL_ERROR "Buildtree path is too long. Build will fail! Pass --x-buildtrees-root=<shortpath> to vcpkg!")
+ endif()
+ file(MAKE_DIRECTORY "${CURRENT_BUILDTREES_DIR}")
+endif()
+
+set(ENV{QTWEBENGINE_GN_THREADS} "${VCPKG_CONCURRENCY}")
+set(ENV{NINJAFLAGS} "-j${VCPKG_CONCURRENCY} $ENV{NINJAFLAGS}")
+
+##### qt_install_submodule, unrolled
+set(qt_plugindir ${QT6_DIRECTORY_PREFIX}plugins)
+set(qt_qmldir ${QT6_DIRECTORY_PREFIX}qml)
+
+qt_download_submodule(PATCHES ${${PORT}_PATCHES})
+if(QT_UPDATE_VERSION)
+ return()
+endif()
+
+qt_cmake_configure(
+ DISABLE_PARALLEL_CONFIGURE # due to in-source changes.
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ "-DGPerf_EXECUTABLE=${GPERF}"
+ "-DBISON_EXECUTABLE=${BISON}"
+ "-DFLEX_EXECUTABLE=${FLEX}"
+ "-DNodejs_EXECUTABLE=${NODEJS}"
+ "-DPython3_EXECUTABLE=${PYTHON3}"
+ -DQT_FEATURE_webengine_jumbo_build=0
+ -DVCPKG_LOCK_FIND_PACKAGE_BISON=ON
+ -DVCPKG_LOCK_FIND_PACKAGE_FLEX=ON
+ -DVCPKG_LOCK_FIND_PACKAGE_GPerf=ON
+ -DVCPKG_LOCK_FIND_PACKAGE_Ninja=ON
+ -DVCPKG_LOCK_FIND_PACKAGE_Nodejs=ON
+ OPTIONS_MAYBE_UNUSED
+ FEATURE_webengine_webrtc
+)
+
+vcpkg_backup_env_variables(VARS PKG_CONFIG_PATH)
+file(GLOB target_args_gn RELATIVE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/core/Release" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/core/Release/*/args.gn")
+if(NOT VCPKG_BUILD_TYPE)
+ block(SCOPE_FOR VARIABLES)
+ set(VCPKG_BUILD_TYPE debug)
+ if(VCPKG_TARGET_IS_LINUX AND EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/core/Debug/${target_args_gn}")
+ file(APPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/src/core/Debug/${target_args_gn}" "\ngcc_target_rpath=\"\\\${ORIGIN}:${CURRENT_INSTALLED_DIR}/debug/lib\"\n")
+ endif()
+ vcpkg_host_path_list(PREPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig" "${CURRENT_INSTALLED_DIR}/share/pkgconfig")
+ vcpkg_cmake_install(ADD_BIN_TO_PATH)
+ endblock()
+endif()
+vcpkg_restore_env_variables(VARS PKG_CONFIG_PATH)
+block(SCOPE_FOR VARIABLES)
+set(VCPKG_BUILD_TYPE release)
+if(VCPKG_TARGET_IS_LINUX AND EXISTS "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/core/Release/${target_args_gn}")
+ file(APPEND "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/src/core/Release/${target_args_gn}" "\ngcc_target_rpath=\"\\\${ORIGIN}:${CURRENT_INSTALLED_DIR}/lib\"\n")
+endif()
+vcpkg_host_path_list(PREPEND ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig" "${CURRENT_INSTALLED_DIR}/share/pkgconfig")
+vcpkg_cmake_install(ADD_BIN_TO_PATH)
+endblock()
+vcpkg_restore_env_variables(VARS PKG_CONFIG_PATH)
+
+# Unroll response file references.
+# Escape quotes in a way which survives vcpkg_cmake_config_fixup().
+file(GLOB cmake_target_files "${CURRENT_PACKAGES_DIR}/share/Qt6*/Qt6*Targets.cmake" "${CURRENT_PACKAGES_DIR}/debug/share/Qt6*/Qt6*Targets.cmake")
+foreach(file IN LISTS cmake_target_files)
+ file(READ "${file}" haystack)
+ while(haystack MATCHES "@([^>]*[.]rsp)")
+ set(response_file "${CMAKE_MATCH_1}")
+ if(EXISTS "${response_file}")
+ file(STRINGS "${response_file}" options)
+ string(REPLACE [["]] [[${_escaped_quote_}]] options "${options}")
+ list(JOIN options " " replacement)
+ else()
+ message("${Z_VCPKG_BACKCOMPAT_MESSAGE_LEVEL}" "No such response file: ${response_file}")
+ set(replacement "")
+ endif()
+ string(REPLACE "@${response_file}" "${replacement}" haystack "${haystack}")
+ endwhile()
+ file(WRITE "${file}" [[set(_escaped_quote_ "\"")]] "\n\n${haystack}")
+endforeach()
+
+qt_fixup_and_cleanup(TOOL_NAMES gn QtWebEngineProcess qwebengine_convert_dict webenginedriver)
+if("webengine" IN_LIST FEATURES)
+ if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_BUILD_TYPE)
+ file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/QtWebEngineProcessd.exe" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/QtWebEngineProcessd.exe")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/QtWebEngineProcessd.pdb" "${CURRENT_PACKAGES_DIR}/tools/Qt6/bin/debug/QtWebEngineProcessd.pdb")
+ endif()
+ file(RENAME "${CURRENT_PACKAGES_DIR}/resources" "${CURRENT_PACKAGES_DIR}/share/Qt6/resources") # qt.conf wants it there and otherwise the QtWebEngineProcess cannot start
+endif()
+
+qt_install_copyright("${SOURCE_PATH}")
+
+##### qt_install_submodule
diff --git a/vcpkg/ports/qtwebengine/rpath.diff b/vcpkg/ports/qtwebengine/rpath.diff
new file mode 100644
index 0000000..8a0a56a
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/rpath.diff
@@ -0,0 +1,22 @@
+diff --git a/src/3rdparty/chromium/build/config/gcc/BUILD.gn b/src/3rdparty/chromium/build/config/gcc/BUILD.gn
+index 147ebfc53..0febdd592 100644
+--- a/src/3rdparty/chromium/build/config/gcc/BUILD.gn
++++ b/src/3rdparty/chromium/build/config/gcc/BUILD.gn
+@@ -66,7 +66,7 @@ config("rpath_for_built_shared_libraries") {
+ if (!is_android && current_os != "aix" && !is_castos) {
+ # Note: Android, Aix don't support rpath. Chromecast has its own logic for
+ # setting the rpath in //build/config/chromecast.
+- if (current_toolchain != default_toolchain || gcc_target_rpath == "") {
++ if (gcc_target_rpath == "") {
+ ldflags = [
+ # Want to pass "\$". GN will re-escape as required for ninja.
+ "-Wl,-rpath=\$ORIGIN",
+@@ -80,7 +80,7 @@ config("rpath_for_built_shared_libraries") {
+ }
+ }
+
+-if (is_component_build && !is_android) {
++if (!is_android) {
+ # See the rpath_for... config above for why this is necessary for component
+ # builds.
+ executable_and_shared_library_configs_ =
diff --git a/vcpkg/ports/qtwebengine/vcpkg.json b/vcpkg/ports/qtwebengine/vcpkg.json
new file mode 100644
index 0000000..287533d
--- /dev/null
+++ b/vcpkg/ports/qtwebengine/vcpkg.json
@@ -0,0 +1,241 @@
+{
+ "$comment": "x86-windows is not within the upstream support matrix of Qt6",
+ "name": "qtwebengine",
+ "version": "6.9.1",
+ "port-version": 3,
+ "description": "Qt modules for rendering web and PDF content.",
+ "homepage": "https://www.qt.io/",
+ "license": null,
+ "dependencies": [
+ {
+ "name": "qtbase",
+ "default-features": false
+ }
+ ],
+ "default-features": [
+ {
+ "name": "pdf",
+ "platform": "android | ios | (linux & !x86) | osx | (windows & x64 & !static)"
+ },
+ {
+ "name": "webengine",
+ "platform": "!static & ((linux & !x86) | osx | (windows & x64))"
+ }
+ ],
+ "features": {
+ "geolocation": {
+ "description": "Build with Geolocation",
+ "dependencies": [
+ {
+ "name": "qtlocation",
+ "default-features": false
+ },
+ {
+ "name": "qtwebengine",
+ "default-features": false,
+ "features": [
+ "webengine"
+ ]
+ }
+ ]
+ },
+ "pdf": {
+ "description": "The Qt PDF module contains classes and functions for rendering PDF documents.",
+ "supports": "android | ios | linux | osx | (windows & x64 & !static)",
+ "dependencies": [
+ {
+ "name": "freetype",
+ "platform": "!windows"
+ },
+ {
+ "name": "glib",
+ "platform": "!windows"
+ },
+ {
+ "name": "gperf",
+ "host": true
+ },
+ {
+ "name": "harfbuzz",
+ "platform": "!windows"
+ },
+ {
+ "name": "icu",
+ "platform": "!ios & !osx & !windows"
+ },
+ {
+ "name": "lcms",
+ "platform": "!windows"
+ },
+ {
+ "name": "libjpeg-turbo",
+ "platform": "!windows"
+ },
+ {
+ "name": "libpng",
+ "platform": "!windows"
+ },
+ {
+ "name": "libwebp",
+ "platform": "!windows"
+ },
+ {
+ "name": "libxml2",
+ "default-features": false,
+ "features": [
+ "icu"
+ ],
+ "platform": "!windows"
+ },
+ {
+ "name": "libxslt",
+ "default-features": false,
+ "platform": "!windows"
+ },
+ {
+ "name": "minizip",
+ "platform": "!windows"
+ },
+ {
+ "name": "nss",
+ "platform": "android | linux"
+ },
+ "opengl",
+ {
+ "name": "openjpeg",
+ "platform": "!windows"
+ },
+ {
+ "name": "opus",
+ "platform": "!windows"
+ },
+ {
+ "name": "qtbase",
+ "default-features": false,
+ "features": [
+ "gui",
+ "network",
+ "widgets"
+ ]
+ },
+ {
+ "name": "qtbase",
+ "default-features": false,
+ "features": [
+ "harfbuzz",
+ "jpeg",
+ "png"
+ ],
+ "platform": "linux"
+ },
+ {
+ "name": "qtdeclarative",
+ "default-features": false
+ },
+ {
+ "name": "qttools",
+ "default-features": false
+ },
+ {
+ "$comment": "Provides the port's custom GN host tool",
+ "name": "qtwebengine",
+ "host": true,
+ "default-features": false
+ },
+ {
+ "name": "re2",
+ "platform": "!windows"
+ },
+ {
+ "name": "snappy",
+ "platform": "!windows"
+ },
+ {
+ "name": "tiff",
+ "default-features": false,
+ "platform": "!windows"
+ },
+ {
+ "name": "vcpkg-get-python-packages",
+ "host": true
+ },
+ {
+ "name": "vcpkg-tool-nodejs",
+ "host": true
+ },
+ {
+ "name": "zlib",
+ "platform": "!windows"
+ }
+ ]
+ },
+ "proprietary-codecs": {
+ "description": "Enables the use of proprietary codecs such as h.264/h.265 and MP3.",
+ "dependencies": [
+ {
+ "name": "qtwebengine",
+ "default-features": false,
+ "features": [
+ "webengine"
+ ]
+ }
+ ]
+ },
+ "spellchecker": {
+ "description": "Provides a spellchecker",
+ "dependencies": [
+ {
+ "name": "qtwebengine",
+ "default-features": false,
+ "features": [
+ "webengine"
+ ]
+ }
+ ]
+ },
+ "webchannel": {
+ "description": "Provides QtWebChannel integration",
+ "dependencies": [
+ {
+ "name": "qtwebchannel",
+ "default-features": false,
+ "features": [
+ "qml"
+ ]
+ },
+ {
+ "name": "qtwebengine",
+ "default-features": false,
+ "features": [
+ "webengine"
+ ]
+ }
+ ]
+ },
+ "webengine": {
+ "description": "Qt WebEngine provides functionality for rendering regions of dynamic web content.",
+ "supports": "(linux | osx | (windows & x64)) & !static",
+ "dependencies": [
+ {
+ "name": "dbus",
+ "default-features": false
+ },
+ {
+ "name": "ffmpeg",
+ "platform": "!windows"
+ },
+ {
+ "name": "opus",
+ "platform": "!windows"
+ },
+ {
+ "name": "qtwebengine",
+ "default-features": false,
+ "features": [
+ "pdf"
+ ]
+ }
+ ]
+ }
+ }
+}