diff --git a/Mk/Uses/qt-dist.mk b/Mk/Uses/qt-dist.mk index 40ae305bdbb1..bbcefac7e9c4 100644 --- a/Mk/Uses/qt-dist.mk +++ b/Mk/Uses/qt-dist.mk @@ -1,540 +1,541 @@ # There are three Qt related USES files with different access to Qt. # - qmake: The port requires Qt's qmake to build -- creates the configure target # - auto includes qt.mk # - qt-dist: The port is a port for a part of Qt # - auto includes qt.mk # - qt.mk - Dependency handling. USE_QT=foo bar # # # Usage # qt-dist:[,yes|modulename] # # MAINTAINER: kde@FreeBSD.org .if !defined(_QT_DIST_MK_INCLUDED) _QT_DIST_MK_INCLUDED= qt-dist.mk # Suck in qt.mk and qmake.mk qt_ARGS?= # empty .include "${USESDIR}/qt.mk" qmake_ARGS?= # empty .include "${USESDIR}/qmake.mk" # Supported distribution arguments _COMMON_DISTS= 3d base charts connectivity datavis3d declarative imageformats location multimedia \ networkauth quick3d quicktimeline remoteobjects scxml sensors \ serialbus serialport speech svg tools translations virtualkeyboard \ wayland webchannel webengine websockets webview _QT5_DISTS= gamepad graphicaleffects quickcontrols \ quickcontrols2 script webglplugin \ x11extras xmlpatterns _QT6_DISTS= 5compat doc httpserver languageserver lottie positioning \ quickeffectmaker shadertools _QT_DISTS= ${_COMMON_DISTS} \ ${_QT${_QT_VER}_DISTS} # We only accept one item as an argument. The fetch target further below works # around this. _QT_DIST= # empty . for dist in ${_QT_DISTS:O:u} . if ${qt-dist_ARGS:M${dist}} . if empty(_QT_DIST) _QT_DIST= ${dist} . else IGNORE= cannot be installed: different Qt dists specified via qt-dist:[${qt-dist_ARGS:S/ /,/g}] . endif . endif . endfor # Fall back to sensible defaults for _QT_DIST . if empty(_QT_DIST) _QT_DIST= ${PORTNAME} # don't force qt-dist to be set for Qt5 ports which 75% of time are ${PORTNAME} . endif # Check validitiy . if empty(_QT_DISTS:M${_QT_DIST}) IGNORE= Unsupported qt-dist ${_QT_DIST} for qt:${_QT_VER} . endif ################################################################################ # Set standard bsd.port.mk variables. LICENSE?= LGPL21 WWW?= https://www.qt.io/ . if !exists(${PKGDIR}/pkg-descr) DESCR?= ${PORTSDIR}/devel/${_QT_RELNAME}/pkg-descr . endif # Stage support. _QT5_DESTDIRNAME= INSTALL_ROOT _QT6_DESTDIRNAME= DESTDIR DESTDIRNAME= ${_QT${_QT_VER}_DESTDIRNAME} # Qt's tarballs are xz compressed. . if empty(USES:Mtar) EXTRACT_SUFX?= .tar.xz . endif # Qt5 specific master sites _QT5_MASTER_SITES_kde= LOCAL _QT5_MASTER_SITE_SUBDIR_kde= kde/KDE/Qt/${_QT_VERSION} _QT5_MASTER_SITES= ${MASTER_SITE_QT} _QT5_MASTER_SITE_SUBDIR= official_releases/qt/${_QT_VERSION:R}/${_QT_VERSION}/submodules/ # Qt6 specific master sites _QT6_MASTER_SITES= ${MASTER_SITE_QT} _QT6_MASTER_SITE_SUBDIR= official_releases/qt/${_QT_VERSION:R}/${_QT_VERSION}/submodules \ official_releases/additional_libraries/${_QT_VERSION:R}/${_QT_VERSION}/ # Qt5 specific distnames . if ${_QT_DIST} == webengine _QT5_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-opensource-src-${DISTVERSION},} . else _QT5_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-src-${DISTVERSION},} . endif _QT5_DISTNAME_kde= ${_QT_DIST:S,^,kde-qt,:S,$,-${DISTVERSION},} # Qt6 specific distnames _QT6_DISTNAME= ${_QT_DIST:S,^,qt,:S,$,-everywhere-src-${DISTVERSION},} # Effective master sites and disfile valus MASTER_SITES= ${_QT${_QT_VER}_MASTER_SITES${_KDE_${_QT_DIST}:D_kde}} MASTER_SITE_SUBDIR= ${_QT${_QT_VER}_MASTER_SITE_SUBDIR${_KDE_${_QT_DIST}:D_kde}} DISTNAME= ${_QT${_QT_VER}_DISTNAME${_KDE_${_QT_DIST}:D_kde}} DISTFILES= ${DISTNAME:S,$,${EXTRACT_SUFX},} DIST_SUBDIR= KDE/Qt/${_QT_VERSION} . if ${_QT_VER:M5} # KDE maintains a repository with a patched Qt5 distribution. _KDE_3d= 0 _KDE_base= 156 _KDE_charts= 0 _KDE_connectivity= 6 _KDE_datavis3d= 0 _KDE_declarative= 31 _KDE_gamepad= 0 _KDE_graphicaleffects= 0 _KDE_imageformats= 9 _KDE_location= 4 _KDE_multimedia= 3 _KDE_networkauth= 0 _KDE_quick3d= 1 _KDE_quickcontrols= 0 _KDE_quickcontrols2= 6 _KDE_quicktimeline= 0 _KDE_remoteobjects= 0 _KDE_script= 0 _KDE_script_ORIGIN_TAG= v5.15.15-lts _KDE_script_VERSION= 5.15.15 _KDE_scxml= 0 _KDE_sensors= 0 _KDE_serialbus= 0 _KDE_serialport= 0 _KDE_speech= 1 _KDE_svg= 8 _KDE_tools= 3 _KDE_translations= 0 _KDE_virtualkeyboard= 0 _KDE_wayland= 57 _KDE_webchannel= 3 -_KDE_webengine= 0 +_KDE_webengine= 11 +_KDE_webengine_BRANCH= 5.15 _KDE_webengine_ORIGIN_TAG= v5.15.15-lts _KDE_webengine_VERSION= 5.15.15 _KDE_webglplugin= 0 _KDE_websockets= 2 _KDE_webview= 0 _KDE_x11extras= 0 _KDE_xmlpatterns= 0 . if defined(_KDE_${_QT_DIST}) . if defined(_KDE_${_QT_DIST}_ORIGIN_TAG) -_KDE_${_QT_DIST}_BRANCH= ${_KDE_${_QT_DIST}_VERSION} +_KDE_${_QT_DIST}_BRANCH?= ${_KDE_${_QT_DIST}_VERSION} . else _KDE_${_QT_DIST}_BRANCH= kde/5.15 COMMENT+= (KDE patched) . endif QT5_KDE_PATCH= p${_KDE_${_QT_DIST}} _KDE_${_QT_DIST}_VERSION?= ${_QT_VERSION} _KDE_${_QT_DIST}_ORIGIN_TAG?= v${_KDE_${_QT_DIST}_VERSION}-lts-lgpl . else QT5_KDE_PATCH= # . endif . endif # ${_QT_VER:M5} # Environment setup for Qt5 . if ${_QT_VER:M5} # Qt (at least when used with qmake) has a tendency to overlink: some libraries # have dependencies on others in the mkspec configurations and the latter are # always passed to the linker even if they are not actually used. By passing # --as-needed to the linker by default when building the Qt ports we do not # have to declare a lot of unnecessary dependencies in USE_QT5. LDFLAGS+= -Wl,--as-needed . if ${_QT_DIST} == "base" && ${PORTNAME} != "qmake" # Qt configure requires pkg-config to detect dependencies. .include "${USESDIR}/pkgconfig.mk" . endif # -nomake is only used by qtbase's configure script. # Other ports from other Qt modules will automatically build examples and # tests if the directories exist because of mkspecs/features/qt_parts.prf. EXTRACT_AFTER_ARGS?= ${DISTNAME:S,$,/examples,:S,^,--exclude ,} \ ${DISTNAME:S,$,/tests,:S,^,--exclude ,} \ --no-same-owner --no-same-permissions . endif # ! ${_QT_VER:M5} # Build setup for Qt6 . if ${_QT_VER:M6} CMAKE_ARGS+= -DCMAKE_INSTALL_PREFIX=${PREFIX} \ -DINSTALL_BINDIR=${PREFIX}/${QT_BINDIR_REL} \ -DINSTALL_PUBLICBINDIR=${PREFIX}/bin \ -DINSTALL_LIBDIR=${PREFIX}/${QT_LIBDIR_REL} \ -DINSTALL_LIBEXECDIR=${PREFIX}/${QT_LIBEXECDIR_REL} \ -DINSTALL_DOCDIR=${PREFIX}/${QT_DOCDIR_REL} \ -DINSTALL_ARCHDATADIR=${PREFIX}/${QT_ARCHDIR_REL} \ -DINSTALL_DATADIR=${PREFIX}/${QT_DATADIR_REL} \ -DINSTALL_INCLUDEDIR=${PREFIX}/${QT_INCDIR_REL} \ -DINSTALL_MKSPECSDIR=${PREFIX}/${QT_MKSPECDIR_REL} \ -DINSTALL_EXAMPLESDIR=${PREFIX}/${QT_EXAMPLEDIR_REL} \ -DINSTALL_DESCRIPTIONSDIR=${PREFIX}/${QT_DESCRIPTIONSDIR_REL} \ -DQT_QMAKE_TARGET_MKSPEC:String=freebsd-clang \ --log-level=TRACE . endif # Build setup for Qt5 . if ${_QT_VER:M5} CONFIGURE_ENV+= MAKE="${MAKE:T}" CONFIGURE_ARGS+= -opensource -confirm-license \ -no-pch \ -prefix ${PREFIX} \ -bindir ${PREFIX}/${QT_BINDIR_REL} \ -headerdir ${PREFIX}/${QT_INCDIR_REL} \ -libdir ${PREFIX}/${QT_LIBDIR_REL} \ -plugindir ${PREFIX}/${QT_PLUGINDIR_REL} \ -importdir ${PREFIX}/${QT_IMPORTDIR_REL} \ -datadir ${PREFIX}/${QT_DATADIR_REL} \ -docdir ${PREFIX}/${QT_DOCDIR_REL} \ -translationdir ${PREFIX}/${QT_L10NDIR_REL} \ -sysconfdir ${PREFIX}/${QT_ETCDIR_REL} \ -nomake examples -nomake tests \ -platform ${QMAKESPECNAME} \ -archdatadir ${PREFIX}/${QT_ARCHDIR_REL} \ -libexecdir ${PREFIX}/${QT_LIBEXECDIR_REL} \ -qmldir ${PREFIX}/${QT_QMLDIR_REL} \ -examplesdir ${PREFIX}/${QT_EXAMPLEDIR_REL} \ -testsdir ${PREFIX}/${QT_TESTDIR_REL} . if ${ARCH} == i386 && empty(MACHINE_CPU:Msse2) CONFIGURE_ARGS+= -no-sse2 . endif # Work around a bug in current binutils, where the gold linker creates # duplicate symbols. See pr 218187. Disable the gold-linker for Qt5 ports. CONFIGURE_ARGS+= -no-use-gold-linker # Pass -recheck-all so that multiple calls to the configure script really # re-run all checks. CONFIGURE_ARGS+= -recheck-all . endif # ${_QT_VER:M5} . if defined(WANT_QT_DEBUG) || defined(WITH_DEBUG) WITH_DEBUG= yes STRIP= # It's done prior to bsd.qt.mk inclusion. CONFIGURE_ARGS+= -debug -separate-debug-info # Override configuration in global qconfig.pri. QMAKE_ARGS+= QT_CONFIG+="debug separate_debug_info" \ QT_CONFIG-="release" . else CONFIGURE_ARGS+= -release -no-separate-debug-info QMAKE_ARGS+= QT_CONFIG+="release" \ QT_CONFIG-="debug separate_debug_info" . endif # defined(WANT_QT_DEBUG) || defined(WITH_DEBUG) . if defined(WANT_QT_VERBOSE_CONFIGURE) CONFIGURE_ARGS+= -verbose . endif . if ${_QT_DIST} == "base" _EXTRA_PATCHES_QT5= ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_create__cmake.prf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_features_qt__module.prf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_common_bsd_bsd.conf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-clang_qmake.conf . if ${ARCH:Mmips*} || (${ARCH:Mpowerpc*} && !exists(/usr/bin/clang)) || ${ARCH} == sparc64 _EXTRA_PATCHES_QT5+= ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_g++-base.conf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_gcc-base.conf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-g++_qmake.conf USE_GCC= yes . elif ${ARCH} == armv7 || ${ARCH} == powerpc _EXTRA_PATCHES_QT5+= ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_g++-base.conf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_common_gcc-base.conf \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-g++_qmake.conf . endif . if ${_QT_VER:M5} EXTRA_PATCHES?= ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-configure \ ${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-sync.profiles \ ${_EXTRA_PATCHES_QT5} . endif # ${_QT_VER:M5} . endif # ${_QT_DIST} == "base" # Override settings installed in qconfig.h and *.pri files. The flags will be # installed along with the port, but have to be passed as arguments while # building the port itself. Flags prefixed with "-" (e.g., "-CUPS" and "-cups") # are needed to disable some features. . if !defined(${QT_MODNAME}) || empty(${QT_MODNAME}) # Used for both qconfig-*.h and qt_config_*.pri; it can't be empty. QT_MODNAME= ${PORTNAME} . endif QT_DEFINES?= # For qconfig.h flags (without "QT_" prefix). QT_CONFIG?= # For *.pri files QT_CONFIG flags. . if ${QT_DEFINES} QMAKE_ARGS+= DEFINES+="${QT_DEFINES:O:u:C/^([^-])/QT_\1/:C/^-/QT_NO_/:O}" . endif # ${QT_DEFINES} PKGDEINSTALL= ${WRKDIR}/pkg-deinstall PKGINSTALL= ${WRKDIR}/pkg-install . if ${QT_CONFIG:N-*} QMAKE_ARGS+= QT_CONFIG+="${QT_CONFIG:N-*:O:u}" . endif . if ${QT_CONFIG:M-*} QMAKE_ARGS+= QT_CONFIG-="${QT_CONFIG:M-*:O:u:C/^-//}" . endif PLIST_SUB+= SHORTVER=${_QT_VERSION:R} \ FULLVER=${_QT_VERSION:C/-.*//} # Handle additional PLIST directories, which should only be used for Qt-dist ports. . for dir in ETC # Export QT_ETCDIR. PLIST_SUB+= QT_${dir}DIR="${QT_${dir}DIR_REL}" . endfor . if ${_QT_VER:M5} . for dir in CMAKE # Export QT_CMAKEDIR. PLIST_SUB+= QT_${dir}DIR="${QT_${dir}DIR_REL}" . endfor . endif . if ${_QT_VER:M5} . if ${_QT_DIST} == "base" # qtbase requires some tools to be symlinked to the build directory. _QT_TOOLS= # empty . if ${PORTNAME} != "qmake" _QT_TOOLS+= ${QMAKE} . endif . if ${PORTNAME} != "buildtools" _QT_TOOLS+= ${MOC} ${RCC} . endif . if ${PORTNAME} != "qdoc" _QT_TOOLS+= qdoc . endif . if ${PORTNAME} != "dbus" _QT_TOOLS+= qdbuscpp2xml qdbusxml2cpp . endif . if ${PORTNAME} != "widgets" _QT_TOOLS+= ${UIC} . endif # The list of QtBase components that need to be linked into WRKSRC/lib for # other QtBase ports. See below. _QT5_BASE= core dbus gui network sql widgets _QT5_ADDITIONAL_LINK?= # Ensure definition . if ${_QT_VER:M5} post-patch: gcc-post-patch gcc-post-patch: ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/mkspecs/common/gcc-base.conf \ ${WRKSRC}/mkspecs/freebsd-g++/qmake.conf ${REINPLACE_CMD} 's|%%GCC_DEFAULT%%|${GCC_DEFAULT}|g' \ ${WRKSRC}/mkspecs/common/gcc-base.conf \ ${WRKSRC}/mkspecs/common/g++-base.conf \ ${WRKSRC}/mkspecs/common/bsd/bsd.conf \ ${WRKSRC}/mkspecs/freebsd-g++/qmake.conf . endif pre-configure: qtbase-pre-configure qtbase-pre-configure: . for tool in ${_QT_TOOLS} @${TEST} -e ${QT_BINDIR}/${tool:T} && \ ${LN} -sf ${QT_BINDIR}/${tool:T} ${CONFIGURE_WRKSRC}/bin/${tool:T} || \ ${TRUE} . endfor # The following is a fix for the inplace upgrade problem we faced (see # QTBUG-40825 and ports bugs 194088, 195105 and 198720) previously, # which previously was adressed by making sure, that ${LOCALBASE}/lib, which # would often gets added by pkgconf for the dependencies, was passed after # ${WRKSRC}/lib. # * We fix the inplace upgrade problem by moving the Qt5 libraries into # ${LOCALBASE}/lib/qt5. Therefore a -L${LOCALBASE}/lib does no harm anymore. # * However, this means, that the ports belonging to the split up QtBase package # now no longer can find their depending QtBase libraries. We fix this by # linking these into ${CONFIGURE_WRKSRC}/lib if the given QtBase port depends # on them. . if ${_QT_DIST:Mbase} . for basedep in ${_QT5_BASE} . if ! empty(USE_QT:M${basedep}) ${LN} -sf ${QT_LIBDIR}/${${basedep}_LIB} ${CONFIGURE_WRKSRC}/lib . endif . endfor . endif # # **** THIS PART IS OBSOLETE FOR THE NEXT QT UPGRADE **** # # Add ${LOCALBASE}/lib to DEFAULT_LIBDIRS, which we use to filter out # certain paths from pkg-config calls (see the explanation in # devel/qt5/files/patch-configure) as well as for setting # QMAKE_DEFAULT_LIBDIR in mkspecs/qconfig.pri. Part of the solution for # ports/194088. post-patch: qtbase-post-patch qtbase-post-patch: ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \ ${WRKSRC}/mkspecs/common/bsd/bsd.conf \ ${WRKSRC}/mkspecs/freebsd-clang/qmake.conf . if ${PORTNAME} != "qmake" _QMAKE= ${CONFIGURE_WRKSRC}/bin/qmake . endif . endif pre-configure: qt5-pre-configure qt5-pre-configure: # Qt 5.3.2 introduced a check in mkspecs/features/create_cmake.prf that # requires tests/auto/cmake to be present, otherwise the configure stage will # fail. # Since we cannot extract tests/auto/cmake/ and exclude tests/ at the same # time, we have to disable the check in a cache file (the only way to get this # value through to the configure script in qtbase). ${MKDIR} ${CONFIGURE_WRKSRC} ${ECHO_CMD} 'CMAKE_MODULE_TESTS = -' > ${CONFIGURE_WRKSRC}/.qmake.cache # configure will run syncqt.pl if it finds a .git entry in the working directory touch ${WRKSRC}/.git # As the patch collection was created after a version bump, all module verisions # are tagged as 5.15.3 touch ${WRKSRC}/.qmake.conf # easier than to -f before the sed ${REINPLACE_CMD} -e '/MODULE_VERSION/s|5\.15\.\([0-9]*\)|${_QT_VERSION}|g' \ ${WRKSRC}/.qmake.conf # **** THIS PART IS OBSOLETE FOR THE NEXT QT UPGRADE **** # # We piggyback on QMAKE_LIBDIR_FLAGS to make sure -L${WRKSRC}/lib is passed to # the linker before -L/usr/local/lib. By default, the opposite happens, which # is a problem when a Qt port is being upgraded, since an existing library # would end up being picked up instead of those built in ${WRKSRC}/lib. Since # qmake appends the value of QMAKE_LIBDIR to QMAKE_LIBDIR_FLAGS, we can use the # latter to get the linker path order right. qmake is smart enough to strip # occurrences of ${WRKSRC}/lib from .pc and .prl files when installing them. # See QTBUG-40825 and ports bugs 194088, 195105 and 198720. ${ECHO_CMD} 'QMAKE_LIBDIR_FLAGS = -L${CONFIGURE_WRKSRC}/lib' >> ${CONFIGURE_WRKSRC}/.qmake.cache ${ECHO_CMD} 'QMAKE_DEFAULT_LIBDIRS += ${LOCALBASE}/lib /usr/lib /lib' >> ${CONFIGURE_WRKSRC}/.qmake.cache ${ECHO_CMD} 'QMAKE_DEFAULT_INCDIRS += ${LOCALBASE}/include /usr/include' >> ${CONFIGURE_WRKSRC}/.qmake.cache # Allow linking of further libraries to the configure directory. . if !empty(_QT5_ADDITIONAL_LINK) . for dep in ${_QT5_ADDITIONAL_LINK} ${MKDIR} ${CONFIGURE_WRKSRC}/lib . if ! empty(USE_QT:M${dep}) ${LN} -sf ${QT_LIBDIR}/${qt-${dep}_LIB} ${CONFIGURE_WRKSRC}/lib . endif . endfor . endif . if ${QT_DEFINES:N-*} # There **are** defines, so we need to **add** this port to the # qconfig-modules.h header; make @need_add empty and comment out # the @need_remove lines in the script (see below in qt-post-install). # If there are no defines, do it the other way around. _sub_need_add= _sub_need_remove= \#\# . else _sub_need_add= \#\# _sub_need_remove= . endif # If a port installs Qt version-specific binaries (e.g. "designer" which # existed as a Qt4 application and exists as a Qt5 application and will # probably be a Qt6 application) the port should set `QT_BINARIES=yes`. . if defined(QT_BINARIES) _sub_need_bin= . else _sub_need_bin= \#\# . endif . if ${QT_MODNAME} == core # QtCore (e.g. devel/qt5-core) is the one that starts the header, # and is also the one that can clean it up when deinstalled. _sub_need_clean= . else _sub_need_clean= \#\# . endif # The Qt modules have an install- and deinstall-step for wrangling # the qconfig-modules.h header, but qmake does not. . if ${PORTNAME} != "qmake" post-install: qt-post-install . endif # PORTNAME != qmake qt-post-install: # We can't use SUB_FILES with the shared pkg-change.in. # We need it to be a script instead of a group of @unexecs. # Do two steps of processing -- introducing the Qt variables, # and replacing the @tags with comment (or nothing) characters # according to the port's settings -- in one sed and write # to pkg-change.tmp. Then split it up and minify for the # install and deinstall step. @${SED} -e 's,%%QT_MODNAME%%,${QT_MODNAME},g' \ -e 's,%%QT_INCDIR%%,${QT_INCDIR},g' \ -e 's,@need_add,${_sub_need_add},' \ -e 's,@need_remove,${_sub_need_remove},' \ -e 's,@need_clean,${_sub_need_clean},' \ -e 's,@need_bin,${_sub_need_bin},' \ ${PORTSDIR}/devel/${_QT_RELNAME}/${FILESDIR:T}/pkg-change.in > \ ${WRKDIR}/pkg-change.tmp @${SED} -e 's,@install,,' -e 's,@deinstall,##,' ${WRKDIR}/pkg-change.tmp | ${SED} -e '/##/d' > ${PKGINSTALL} @${SED} -e 's,@install,##,' -e 's,@deinstall,,' ${WRKDIR}/pkg-change.tmp | ${SED} -e '/##/d' > ${PKGDEINSTALL} # Drop all leading spaces in the script, to minify @${REINPLACE_CMD} 's/^ *//' ${PKGINSTALL} ${PKGDEINSTALL} . if ${QT_DEFINES:N-*} @${MKDIR} ${STAGEDIR}${QT_INCDIR}/QtCore/modules @${ECHO_CMD} -n \ > ${STAGEDIR}${QT_INCDIR}/QtCore/modules/qconfig-${QT_MODNAME}.h . for def in ${QT_DEFINES:N-*:O:u:C/=.*$//} @${ECHO_CMD} "#if !defined(QT_${def}) && !defined(QT_NO_${def})" \ >> ${STAGEDIR}${QT_INCDIR}/QtCore/modules/qconfig-${QT_MODNAME}.h ${ECHO_CMD} "# define QT_${def}" \ >> ${STAGEDIR}${QT_INCDIR}/QtCore/modules/qconfig-${QT_MODNAME}.h @${ECHO_CMD} "#endif" \ >> ${STAGEDIR}${QT_INCDIR}/QtCore/modules/qconfig-${QT_MODNAME}.h @${ECHO_CMD} \ >> ${STAGEDIR}${QT_INCDIR}/QtCore/modules/qconfig-${QT_MODNAME}.h . endfor @${ECHO_CMD} "${PREFIX}/${QT_INCDIR_REL}/QtCore/modules/qconfig-${QT_MODNAME}.h" \ >> ${TMPPLIST} . endif # ${QT_DEFINES:N-*} . if ${QT_CONFIG:N-*} @${MKDIR} ${STAGEDIR}${QT_MKSPECDIR}/modules ${ECHO_CMD} "QT_CONFIG += ${QT_CONFIG:N-*:O:u}" \ > ${STAGEDIR}${QT_MKSPECDIR}/modules/qt_config_${QT_MODNAME}.pri @${ECHO_CMD} "${PREFIX}/${QT_MKSPECDIR_REL}/modules/qt_config_${QT_MODNAME}.pri" \ >> ${TMPPLIST} . endif # ${QT_CONFIG:N-*} . endif # M5 . if ${_QT_VER:M6} post-stage: qt6-post-stage # Clean-up of empty directories, as we install # * cmake to ${LOCALBASE}/lib/cmake not ${QT_LIBDIR}/cmake. # * pkgconfig to ${LOCALBASE}/libexec/pkgconfig not ${QT_LIBDIR}/pkgconfig qt6-post-stage: ${RM} -r ${STAGEDIR}${QT_LIBDIR}/cmake ${RM} -r ${STAGEDIR}${QT_LIBDIR}/pkgconfig . endif qt-create-kde-distfile: ${MKDIR} ${DISTDIR}/${DIST_SUBDIR} ${SH} ${PORTSDIR}/devel/${_QT_RELNAME}/files/create_kde-qt_release.sh \ ${_QT_DIST} \ ${DISTDIR}/${DIST_SUBDIR} \ ${_KDE_${_QT_DIST}_VERSION} \ ${_KDE_${_QT_DIST}_ORIGIN_TAG} \ ${_KDE_${_QT_DIST}_BRANCH} .endif # defined(_QT_DIST_MK_INCLUDED) diff --git a/www/qt5-webengine/Makefile b/www/qt5-webengine/Makefile index 9913c92faa68..0f2fbe833971 100644 --- a/www/qt5-webengine/Makefile +++ b/www/qt5-webengine/Makefile @@ -1,175 +1,178 @@ # QtWebEngine itself is a very thin layer of Qt code on top of a large part of # Chromium (everything up to the content/ layer). As such, most of the work in # this port revolves around taming Chromium and getting it to build on FreeBSD. # While it does build at the moment, there are several items that should be # investigated or improved: # - We are using several stub files, especially in Chromium's base/ and net/ # layers. We should look at implementing the missing bits instead. # - We are currently not using any sandboxing mechanism. # - We need to see if more "use_system_" flags can be passed. # - The process of porting QtWebEngine needs to be documented so we can move to # newer releases more easily. # # Also note that, due to the insane amount of patches this port needs, it tends # to lag behind the rest of the official Qt5 ones, which is why we set # QT5_VERSION and DISTINFO_FILE here. # In order to successfully build this port in poudriere you need to add # MAX_FILES_qt5_webengine=4096 to /usr/local/etc/poudriere.conf PORTNAME= webengine DISTVERSION= ${QT5_VERSION}${QT5_KDE_PATCH} CATEGORIES= www PKGNAMEPREFIX= qt5- MAINTAINER= kde@FreeBSD.org COMMENT= Qt 5 library to render web content BUILD_DEPENDS= bison:devel/bison \ ${LOCALBASE}/include/linux/input.h:devel/evdev-proto \ ${LOCALBASE}/include/linux/videodev2.h:multimedia/v4l_compat LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg \ libdbus-1.so:devel/dbus \ libdouble-conversion.so:devel/double-conversion \ libevent.so:devel/libevent \ libfontconfig.so:x11-fonts/fontconfig \ libfreetype.so:print/freetype2 \ libharfbuzz.so:print/harfbuzz \ libjsoncpp.so:devel/jsoncpp \ liblcms2.so:graphics/lcms2 \ libnspr4.so:devel/nspr \ libnss3.so:security/nss \ libopenh264.so:multimedia/openh264 \ libopus.so:audio/opus \ libpci.so:devel/libpci \ libpng.so:graphics/png \ + libre2.so:devel/re2 \ libsnappy.so:archivers/snappy \ libvpx.so:multimedia/libvpx \ libwebp.so:graphics/webp DISTINFO_FILE= ${.CURDIR}/distinfo QT5_VERSION= ${_KDE_webengine_VERSION} # Add extra-patch-no-mempcpy-nasm only when there's no mempcpy() in base. # Nested variable expansion avoids executing the test when not needed for # expanding EXTRA_PATCHES. # mempcpy was introduced in ee37f64cf875255338f917a9da76c643cf59786c EXTRA_PATCHES+= ${"${:!${GREP} mempcpy ${CROSS_SYSROOT}/usr/include/string.h \ || ${TRUE}!}" == "":?${PATCHDIR}/extra-patch-no-mempcpy-nasm:} OPTIONS_SINGLE= AUDIO OPTIONS_SINGLE_AUDIO= ALSA PULSEAUDIO SNDIO OPTIONS_DEFAULT= ALSA AUDIO_DESC= Audio backend # Need the alsa plugins to get sound at runtime, otherwise messages # that the pcm_oss plugin can't be opened. ALSA_LIB_DEPENDS= libasound.so:audio/alsa-lib ALSA_RUN_DEPENDS= alsa-plugins>=0:audio/alsa-plugins ALSA_VARS= QMAKE_CONFIGURE_ARGS+=-alsa ALSA_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-alsa PULSEAUDIO_LIB_DEPENDS= libpulse.so:audio/pulseaudio PULSEAUDIO_VARS= QMAKE_CONFIGURE_ARGS+=-pulseaudio PULSEAUDIO_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-pulseaudio SNDIO_LIB_DEPENDS= libsndio.so:audio/sndio SNDIO_VARS= QMAKE_CONFIGURE_ARGS+=-sndio SNDIO_VARS_OFF= QMAKE_CONFIGURE_ARGS+=-no-sndio # We pass `norecursive' to USES=qmake because src/plugins/plugins.pro checks # whether webenginewidgets is available, which fails when qmake processes all # .pro files at once. USES= gl gnome gperf jpeg minizip ninja:build nodejs:build,lts \ - perl5 pkgconfig python:2.7,build qmake:norecursive,outsource \ + perl5 pkgconfig python:build qmake:norecursive,outsource \ qt-dist:5,webengine shebangfix xorg USE_GL= gl USE_GNOME= glib20 libxml2 libxslt USE_PERL5= build USE_QT= core declarative gui location network printsupport \ webchannel widgets \ buildtools:build designer:build qmake:build USE_XORG= x11 xcb xcomposite xcursor xdamage xext xfixes xi xkbfile \ xorgproto xrandr xrender xscrnsaver xtst QMAKE_CONFIGURE_ARGS= -proprietary-codecs -system-ffmpeg # We could just set it to an empty string as well. "all" does not account for # dependencies correctly in the generated Makefiles, use the right target here. ALL_TARGET= first # We need ar(1) from ports because the Chromium code uses the @file syntax. # We then need to ensure ld(1) from ports is used because of the archives ar(1) # generated. USE_BINUTILS= yes CC+= "-B${LOCALBASE}/bin" CXX+= "-B${LOCALBASE}/bin" # The build system reads the environment variable $NINJA_PATH to decide whether # to boostrap ninja or not (and also to invoke it afterwards). CC and CXX are # read by some Chromium code to determine which compiler to invoke when running # some configuration tests. # Since we use USES=qmake:norecursive, we also need to pass some variables to # MAKE_ENV because part of the configuration process happens during the build. CONFIGURE_ENV+= NINJAFLAGS="-j${MAKE_JOBS_NUMBER}" \ NINJA_PATH="${LOCALBASE}/bin/ninja" \ PATH=${CONFIGURE_WRKSRC}/bin:${LOCALBASE}/bin:${PATH} MAKE_ENV+= CC="${CC}" CXX="${CXX}" \ C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include \ ${CONFIGURE_ENV} QT_BINARIES= yes .include .if ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64 PLIST_SUB+= BE="" LE="@comment " .else PLIST_SUB+= BE="@comment " LE="" .endif post-extract: # Install FreeBSD's freebsd.pri file. ${CP} ${FILESDIR}/freebsd.pri ${WRKSRC}/src/buildtools/config/freebsd.pri post-extract-SNDIO-on: @cd ${WRKSRC}/src/3rdparty/chromium/media/audio && ${MKDIR} sndio openbsd @${CP} ${FILESDIR}/sndio_*put.* \ ${WRKSRC}/src/3rdparty/chromium/media/audio/sndio @${CP} ${FILESDIR}/audio_manager_openbsd.* \ ${WRKSRC}/src/3rdparty/chromium/media/audio/openbsd post-patch: @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|' \ ${WRKSRC}/src/3rdparty/chromium/base/linux_util.cc \ ${WRKSRC}/src/3rdparty/chromium/base/test/BUILD.gn \ ${WRKSRC}/src/3rdparty/chromium/build/toolchain/gcc_toolchain.gni \ ${WRKSRC}/src/3rdparty/chromium/chrome/common/chrome_paths.cc \ ${WRKSRC}/src/3rdparty/chromium/third_party/pdfium/core/fxge/fx_ge_linux.cpp \ ${WRKSRC}/src/3rdparty/gn/build/gen.py + @${REINPLACE_CMD} -E -e 's|^(MODULE_VERSION = ).*|\1${QT5_VERSION}|' \ + ${WRKSRC}/.qmake.conf .if ${ARCH:Mmips*} || ${ARCH:Mpowerpc*} || ${ARCH} == sparc64 @${REINPLACE_CMD} -e 's/icudtl.dat/icudtb.dat/' \ ${WRKSRC}/src/core/core_module.pro .endif pre-configure: # Link in ${PYTHON_CMD} to ${CONFIGURE_WRKSRC}/bin -- the scripts hardcode 'python' # in too many places to reasonably patch. So just link in ${PYTHON_CMD} to work around # $LOCALBASE/bin/python being python3 if the default versions is set to 3.x. ${MKDIR} ${CONFIGURE_WRKSRC}/bin && ${LN} -s ${PYTHON_CMD} ${CONFIGURE_WRKSRC}/bin/python # Unbundle a few dependencies. cd ${WRKSRC}/src/3rdparty/chromium && ${SETENV} ${CONFIGURE_ENV} ${PYTHON_CMD} \ ./build/linux/unbundle/replace_gn_files.py --system-libraries\ fontconfig freetype harfbuzz-ng libdrm libevent libpng libwebp libxml libxslt openh264 opus || ${FALSE} # Rerun syncqt.pl -- otherwise the resulting package misses some forwarding headers. cd ${WRKSRC} && ${QT_BINDIR}/syncqt.pl -version ${QT5_VERSION} -# Fix version mismatches for CMake post-build: +# Fix version mismatches for CMake .for module in Pdf PdfWidgets WebEngine WebEngineCore WebEngineWidgets @${REINPLACE_CMD} -e '/${QT5_VERSION} $${_Qt5${module}_FIND_VERSION_EXACT}/s|${QT5_VERSION}|'"$$(${MAKE} -C ../../devel/qt5-core -VQT5_VERSION)"'|' \ ${BUILD_WRKSRC}/lib/cmake/Qt5${module}/Qt5${module}Config.cmake .endfor .include diff --git a/www/qt5-webengine/distinfo b/www/qt5-webengine/distinfo index 29cf9116a9e9..79b60c2ddad1 100644 --- a/www/qt5-webengine/distinfo +++ b/www/qt5-webengine/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1694754981 -SHA256 (KDE/Qt/5.15.15/kde-qtwebengine-5.15.15p0.tar.xz) = 1251d3fb06033483b4252ff43f1a5a11edfa00ec0746dd89787a8ce15654e442 -SIZE (KDE/Qt/5.15.15/kde-qtwebengine-5.15.15p0.tar.xz) = 315062708 +TIMESTAMP = 1700087947 +SHA256 (KDE/Qt/5.15.15/kde-qtwebengine-5.15.15p11.tar.xz) = e9cb2c943d411b06e559829ac8cdc31ea5612a35cf8e0b5554974394686508eb +SIZE (KDE/Qt/5.15.15/kde-qtwebengine-5.15.15p11.tar.xz) = 314961788 diff --git a/www/qt5-webengine/files/patch-configure.pri b/www/qt5-webengine/files/patch-configure.pri index 2db5be749dfe..32fe11de92cd 100644 --- a/www/qt5-webengine/files/patch-configure.pri +++ b/www/qt5-webengine/files/patch-configure.pri @@ -1,12 +1,69 @@ ---- configure.pri.orig 2020-11-07 01:22:36 UTC +* Remove checks for Python2 [1] +* Add support for FreeBSD + +[1] Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-python3.patch?ref_type=heads + +--- configure.pri.orig 2023-07-20 09:52:10 UTC +++ configure.pri -@@ -123,6 +123,9 @@ defineTest(qtConfTest_detectPlatform) { +@@ -7,20 +7,7 @@ defineTest(isPythonVersionSupported) { + equals(QMAKE_HOST.os, Windows): EXE_SUFFIX = .exe + + defineTest(isPythonVersionSupported) { +- python = $$system_quote($$system_path($$1)) +- python_version = $$system('$$python -c "import sys; print(sys.version_info[0:3])"') +- python_version ~= s/[()]//g +- python_version = $$split(python_version, ',') +- python_major_version = $$first(python_version) +- greaterThan(python_major_version, 2) { +- qtLog("Python version 3 is not supported by Chromium.") +- return(false) +- } +- python_minor_version = $$member(python_version, 1) +- python_patch_version = $$member(python_version, 2) +- greaterThan(python_major_version, 1): greaterThan(python_minor_version, 6): greaterThan(python_patch_version, 4): return(true) +- qtLog("Unsupported python version: $${python_major_version}.$${python_minor_version}.$${python_patch_version}.") +- return(false) ++ return(true) + } + + defineTest(qtConfTest_detectJumboBuild) { +@@ -52,10 +39,10 @@ defineTest(qtConfReport_jumboBuild) { + qtConfReportPadded($${1}, $$mergeLimit) + } + +-defineTest(qtConfTest_detectPython2) { +- python = $$qtConfFindInPath("python2$$EXE_SUFFIX") ++defineTest(qtConfTest_detectPython) { ++ python = $$qtConfFindInPath("python$$EXE_SUFFIX") + isEmpty(python) { +- qtLog("'python2$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") ++ qtLog("'python$$EXE_SUFFIX' not found in PATH. Checking for 'python$$EXE_SUFFIX'.") + python = $$qtConfFindInPath("python$$EXE_SUFFIX") + } + isEmpty(python) { +@@ -63,11 +50,11 @@ defineTest(qtConfTest_detectPython2) { + return(false) + } + !isPythonVersionSupported($$python) { +- qtLog("A suitable Python 2 executable could not be located.") ++ qtLog("A suitable Python executable could not be located.") + return(false) + } + +- # Make tests.python2.location available in configure.json. ++ # Make tests.python.location available in configure.json. + $${1}.location = $$clean_path($$python) + export($${1}.location) + $${1}.cache += location +@@ -122,6 +109,9 @@ defineTest(qtConfTest_detectPlatform) { + } macos:qtwebengine_isMacOsPlatformSupported() { $${1}.platform = "macos" - } ++ } + unix:qtwebengine_isLinuxPlatformSupported() { + $${1}.platform = "linux" -+ } + } ios:qtwebengine_isMacOsPlatformSupported() { $${1}.platform = "ios" - } diff --git a/www/qt5-webengine/files/patch-mkspecs_features_functions.prf b/www/qt5-webengine/files/patch-mkspecs_features_functions.prf index 7410d6d6af83..b8ac1d14ef88 100644 --- a/www/qt5-webengine/files/patch-mkspecs_features_functions.prf +++ b/www/qt5-webengine/files/patch-mkspecs_features_functions.prf @@ -1,37 +1,60 @@ ---- mkspecs/features/functions.prf.orig 2021-12-15 16:12:54 UTC +* Rename Python2 related functions to Python generic ones [1] +* Add support for FreeBSD +* Add detection for PowerPC64 + +[1] Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-python3.patch?ref_type=heads + +--- mkspecs/features/functions.prf.orig 2023-07-20 09:52:10 UTC +++ mkspecs/features/functions.prf -@@ -84,6 +84,10 @@ defineReplace(gnWebEngineArgs) { +@@ -44,11 +44,11 @@ defineReplace(pythonPath) { + + # Returns the unquoted path to the python executable. + defineReplace(pythonPath) { +- isEmpty(QMAKE_PYTHON2) { ++ isEmpty(QMAKE_PYTHON) { + # Fallback for building QtWebEngine with Qt < 5.8 +- QMAKE_PYTHON2 = python ++ QMAKE_PYTHON = python + } +- return($$QMAKE_PYTHON2) ++ return($$QMAKE_PYTHON) + } + + # Returns the python executable for use with shell / make targets. +@@ -89,6 +89,10 @@ defineReplace(gnWebEngineArgs) { include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri) include($$QTWEBENGINE_ROOT/src/core/config/windows.pri) } + freebsd { + include($$QTWEBENGINE_ROOT/src/buildtools/config/freebsd.pri) + include($$QTWEBENGINE_ROOT/src/core/config/linux.pri) + } isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.) return($$gn_args) } -@@ -93,6 +97,7 @@ defineReplace(gnPdfArgs) { +@@ -98,6 +102,7 @@ defineReplace(gnPdfArgs) { macos: include($$QTWEBENGINE_ROOT/src/buildtools/config/mac_osx.pri) ios: include($$QTWEBENGINE_ROOT/src/pdf/config/ios.pri) win32: include($$QTWEBENGINE_ROOT/src/buildtools/config/windows.pri) + freebsd: include($$QTWEBENGINE_ROOT/src/buildtools/config/freebsd.pri) include($$QTWEBENGINE_ROOT/src/pdf/config/common.pri) isEmpty(gn_args): error(No gn_args found please make sure you have valid configuration.) return($$gn_args) -@@ -107,6 +112,7 @@ defineReplace(gnArch) { +@@ -112,6 +117,7 @@ defineReplace(gnArch) { contains(qtArch, "mips"): return(mipsel) contains(qtArch, "mips64"): return(mips64el) contains(qtArch, "mips64el"): return(mips64el) + contains(qtArch, "power64"): return(ppc64) return(unknown) } -@@ -114,6 +120,7 @@ defineReplace(gnOS) { +@@ -119,6 +125,7 @@ defineReplace(gnOS) { macos: return(mac) win32: return(win) linux: return(linux) + freebsd: return(freebsd) error(Unsupported platform) return(unknown) } diff --git a/www/qt5-webengine/files/patch-python3-chromium b/www/qt5-webengine/files/patch-python3-chromium new file mode 100644 index 000000000000..b9b730755db2 --- /dev/null +++ b/www/qt5-webengine/files/patch-python3-chromium @@ -0,0 +1,2140 @@ +* Convert to newer Python and remove Python2 related artifacts + +Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-chromium-python3.patch?ref_type=heads + +--- src/3rdparty/chromium/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/BUILD.gn +@@ -239,7 +239,6 @@ group("gn_all") { + "//media/capture:capture_unittests", + "//media/cast:cast_unittests", + "//third_party/angle/src/tests:angle_white_box_tests", +- "//third_party/catapult/telemetry:bitmaptools($host_toolchain)", + ] + } else if (is_ios && !use_qt) { + deps += [ +@@ -354,7 +353,6 @@ group("gn_all") { + "//net/android:net_junit_tests", + "//services:services_junit_tests", + "//testing/android/junit:junit_unit_tests", +- "//third_party/catapult/devil", + "//third_party/smhasher:murmurhash3", + "//tools/android:android_tools", + "//tools/android:memconsumer", +@@ -959,7 +957,6 @@ if (is_chromeos) { + "//third_party/dawn/src/tests:dawn_unittests", + + # Blocked on https://github.com/catapult-project/catapult/issues/2297 +- #"//third_party/catapult/telemetry:bitmaptools", + "//tools/perf/clear_system_cache", + "//ui/ozone/gl:ozone_gl_unittests", + ] +@@ -1037,7 +1034,6 @@ if (!is_ios && !use_qt) { + data_deps = [ + "//chrome:chrome", + "//chrome/test/chromedriver", +- "//third_party/catapult/third_party/typ", + ] + if (is_win) { + data_deps += [ "//build/win:copy_cdb_to_output" ] +@@ -1084,7 +1080,6 @@ if (!is_ios && !use_qt) { + "//third_party/blink/public:blink_devtools_inspector_resources", + "//third_party/blink/public/mojom:mojom_platform_js_data_deps", + "//third_party/blink/renderer/core/html:js_files_for_form_controls_web_tests", +- "//third_party/catapult/third_party/typ", + "//third_party/mesa_headers", + "//tools/imagediff", + ] +@@ -1152,7 +1147,6 @@ if (!is_ios && !use_qt) { + + if (is_android) { + data += [ +- "//third_party/catapult/", + "//build/android/", + ] + } +@@ -1259,11 +1253,6 @@ if (!is_ios && !use_qt) { + "//third_party/blink/web_tests/StaleTestExpectations", + "//third_party/blink/web_tests/TestExpectations", + "//third_party/blink/web_tests/VirtualTestSuites", +- "//third_party/catapult/common/py_utils/", +- "//third_party/catapult/devil/", +- "//third_party/catapult/dependency_manager/", +- "//third_party/catapult/third_party/zipfile/", +- "//third_party/catapult/third_party/typ/", + "//third_party/depot_tools/pylint", + "//third_party/depot_tools/pylint-1.5", + "//third_party/depot_tools/pylint_main.py", +--- src/3rdparty/chromium/build/print_python_deps.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/build/print_python_deps.py +@@ -1,4 +1,4 @@ +-#!/usr/bin/python2.7 ++#!/usr/bin/python + # Copyright 2016 The Chromium Authors. All rights reserved. + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. +@@ -80,7 +80,7 @@ def _GetTargetPythonVersion(module): + if shebang.startswith('#!'): + # Examples: + # '#!/usr/bin/python' +- # '#!/usr/bin/python2.7' ++ # '#!/usr/bin/python' + # '#!/usr/bin/python3' + # '#!/usr/bin/env python3' + # '#!/usr/bin/env vpython' +@@ -152,7 +152,7 @@ def main(): + + # Trybots run with vpython as default Python, but with a different config + # from //.vpython. To make the is_vpython test work, and to match the behavior +- # of dev machines, the shebang line must be run with python2.7. ++ # of dev machines, the shebang line must be run with python. + # + # E.g. $HOME/.vpython-root/dd50d3/bin/python + # E.g. /b/s/w/ir/cache/vpython/ab5c79/bin/python +--- src/3rdparty/chromium/chrome/chrome_paks.gni.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/chrome/chrome_paks.gni +@@ -94,7 +94,6 @@ template("chrome_extra_paks") { + "$root_gen_dir/chrome/common_resources.pak", + "$root_gen_dir/components/autofill/core/browser/autofill_address_rewriter_resources.pak", + "$root_gen_dir/components/components_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", + "$root_gen_dir/net/net_resources.pak", +@@ -110,7 +109,6 @@ template("chrome_extra_paks") { + "//components/autofill/core/browser:autofill_address_rewriter_resources", + "//components/resources", + "//content:content_resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//skia:skia_resources", +--- src/3rdparty/chromium/chrome/test/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/chrome/test/BUILD.gn +@@ -7103,8 +7103,6 @@ if (!is_fuchsia && !is_android) { + "//chrome/test/data/password/captured_sites/", + "//chrome/test/data/web_page_replay_go_helper_scripts/automation_helper.js", + "//components/test/data/autofill/web_page_replay_support_files/", +- "//third_party/catapult/telemetry/telemetry/bin/", +- "//third_party/catapult/web_page_replay_go/deterministic.js", + ] + + if (is_linux || is_chromeos || is_win) { +@@ -7141,7 +7139,6 @@ if (!is_fuchsia && !is_android) { + + # TODO(uwyiming@chromium.org) create a gn target for Web Page Replay Go (WPR Go) and only WPR Go. + # So that test targets requiring WPR Go does not pull down the whole telemetry tool chain. +- "//third_party/catapult:telemetry_chrome_test_support", + "//third_party/hunspell", + "//third_party/icu", + "//third_party/libpng", +@@ -7171,7 +7168,6 @@ if (!is_fuchsia && !is_android) { + deps = [ "//tools/perf/chrome_telemetry_build:telemetry_chrome_test" ] + + data = [ +- "//third_party/catapult/telemetry/telemetry/internal/bin/", + "//tools/perf/run_telemetry_tests", + + # For isolate contract. +@@ -7189,7 +7185,6 @@ if (!is_fuchsia && !is_android) { + group("telemetry_gpu_unittests") { + testonly = true + deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//tools/metrics:metrics_python_tests", + ] + data = [ +@@ -7313,7 +7308,6 @@ if (is_mac || is_win || is_android) { + "//testing/scripts", + "//testing/test_env.py", + "//testing/xvfb.py", +- "//third_party/catapult", + "//tools", + ] + } +--- src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/components/resources/protobufs/binary_proto_generator.py +@@ -7,7 +7,7 @@ + Converts a given ASCII proto into a binary resource. + + """ +- ++from __future__ import print_function + import abc + import imp + import optparse +@@ -196,12 +196,12 @@ class BinaryProtoGenerator: + self._ImportProtoModules(opts.path) + + if not self.VerifyArgs(opts): +- print "Wrong arguments" ++ print("Wrong arguments") + return 1 + + try: + self._GenerateBinaryProtos(opts) + except Exception as e: +- print "ERROR: Failed to render binary version of %s:\n %s\n%s" % ( +- opts.infile, str(e), traceback.format_exc()) ++ print("ERROR: Failed to render binary version of %s:\n %s\n%s" % ++ (opts.infile, str(e), traceback.format_exc())) + return 1 +--- src/3rdparty/chromium/content/browser/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/content/browser/BUILD.gn +@@ -2169,7 +2169,6 @@ jumbo_static_library("browser") { + if (!is_android) { + deps += [ + "//components/vector_icons", +- "//content/browser/tracing:resources", + ] + } + +--- src/3rdparty/chromium/content/browser/tracing/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/content/browser/tracing/BUILD.gn +@@ -1,51 +0,0 @@ +-# Copyright 2014 The Chromium Authors. All rights reserved. +-# Use of this source code is governed by a BSD-style license that can be +-# found in the LICENSE file. +- +-import("//tools/grit/grit_rule.gni") +- +-# generate_about_tracing puts its files in this directory +-tracing_gen_dir = "$root_gen_dir/content/browser/tracing" +- +-# The script just writes filename with no dirs to the .grd, so we always need +-# this file to be in the same directory as the inputs. +-tracing_grd = "$tracing_gen_dir/tracing_resources.grd" +- +-action("generate_tracing_grd") { +- visibility = [ ":*" ] # Depend on ":resources" to get this. +- script = "generate_trace_viewer_grd.py" +- +- input_pages = [ +- "$tracing_gen_dir/about_tracing.html", +- "$tracing_gen_dir/about_tracing.js", +- ] +- inputs = input_pages +- outputs = [ tracing_grd ] +- +- args = rebase_path(input_pages, target_gen_dir) + [ +- "--output", +- rebase_path(tracing_grd, root_build_dir), +- ] +- +- deps = [ "//third_party/catapult/tracing:generate_about_tracing" ] +-} +- +-grit("resources") { +- source = tracing_grd +- +- # Required because the .grd is generated. +- enable_input_discovery_for_gn_analyze = false +- +- outputs = [ +- "grit/tracing_resources.h", +- "tracing_resources.pak", +- ] +- +- # resource_ids has an entry for our .grd file that looks like: +- # "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd" +- # and what we pass here should make that resolve to our .grd file. +- defines = +- [ "SHARED_INTERMEDIATE_DIR=" + rebase_path(root_gen_dir, root_build_dir) ] +- +- deps = [ ":generate_tracing_grd" ] +-} +--- src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/content/browser/tracing/generate_trace_viewer_grd.py +@@ -74,7 +74,7 @@ def main(argv): + for filename in parsed_args.source_files: + add_file_to_grd(doc, os.path.basename(filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +--- src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/content/browser/tracing/tracing_ui.cc +@@ -27,7 +27,6 @@ + #include "base/strings/stringprintf.h" + #include "base/trace_event/trace_event.h" + #include "base/values.h" +-#include "content/browser/tracing/grit/tracing_resources.h" + #include "content/browser/tracing/tracing_controller_impl.h" + #include "content/public/browser/browser_context.h" + #include "content/public/browser/browser_thread.h" +@@ -242,8 +241,6 @@ TracingUI::TracingUI(WebUI* web_ui) + WebUIDataSource* source = WebUIDataSource::Create(kChromeUITracingHost); + source->DisableTrustedTypesCSP(); + source->UseStringsJs(); +- source->SetDefaultResource(IDR_TRACING_HTML); +- source->AddResourcePath("tracing.js", IDR_TRACING_JS); + source->SetRequestFilter(base::BindRepeating(OnShouldHandleRequest), + base::BindRepeating(OnTracingRequest)); + WebUIDataSource::Add(browser_context, source); +--- src/3rdparty/chromium/content/shell/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/content/shell/BUILD.gn +@@ -390,7 +390,6 @@ repack("pak") { + sources = [ + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", + "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", +@@ -413,7 +412,6 @@ repack("pak") { + "//content:dev_ui_content_resources", + "//content/app/resources", + "//content/browser/resources/media:media_internals_resources", +- "//content/browser/tracing:resources", + "//content/browser/webrtc/resources", + "//mojo/public/js:resources", + "//net:net_resources", +--- src/3rdparty/chromium/fuchsia/engine/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/fuchsia/engine/BUILD.gn +@@ -43,7 +43,6 @@ repack("web_engine_pak") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -66,7 +65,6 @@ repack("web_engine_pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//gpu/command_buffer/service", + "//mojo/public/js:resources", + "//net:net_resources", +--- src/3rdparty/chromium/headless/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/headless/BUILD.gn +@@ -37,7 +37,6 @@ repack("pak") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/headless/headless_lib_resources.pak", +@@ -65,7 +64,6 @@ repack("pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//third_party/blink/public:resources", +--- src/3rdparty/chromium/mojo/public/tools/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/BUILD.gn +@@ -14,5 +14,4 @@ group("mojo_python_unittests") { + "//testing/xvfb.py", + ] + deps = [ "//mojo/public/tools/mojom/mojom:tests" ] +- data_deps = [ "//third_party/catapult/third_party/typ/" ] + } +--- src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/bindings/BUILD.gn +@@ -2,9 +2,11 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") + import("//mojo/public/tools/bindings/mojom.gni") + import("//third_party/jinja2/jinja2.gni") + ++# TODO(crbug.com/1194274): Investigate nondeterminism in Py3 builds. + action("precompile_templates") { + sources = mojom_generator_sources + sources += [ +--- src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/bindings/gen_data_files_list.py +@@ -18,7 +18,6 @@ import sys + import re + import sys + +-from cStringIO import StringIO + from optparse import OptionParser + + sys.path.insert( +@@ -41,12 +40,9 @@ def main(): + pattern = re.compile(options.pattern) + files = [f for f in os.listdir(options.directory) if pattern.match(f)] + +- stream = StringIO() +- for f in files: +- print(f, file=stream) ++ contents = '\n'.join(f for f in files) + '\n' ++ WriteFile(contents, options.output) + +- WriteFile(stream.getvalue(), options.output) +- stream.close() + + if __name__ == '__main__': + sys.exit(main()) +--- src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/bindings/generators/mojom_java_generator.py +@@ -25,6 +25,10 @@ from util import build_utils + 'build', 'android', 'gyp')) + from util import build_utils + ++# TODO(crbug.com/1174969): Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ long = int + + GENERATOR_PREFIX = 'java' + +--- src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/generator.py +@@ -136,9 +136,14 @@ def WriteFile(contents, full_path): + + def WriteFile(contents, full_path): + # If |contents| is same with the file content, we skip updating. ++ if not isinstance(contents, bytes): ++ data = contents.encode('utf8') ++ else: ++ data = contents ++ + if os.path.isfile(full_path): + with open(full_path, 'rb') as destination_file: +- if destination_file.read() == contents: ++ if destination_file.read() == data: + return + + # Make sure the containing directory exists. +@@ -146,11 +151,8 @@ def WriteFile(contents, full_path): + fileutil.EnsureDirectoryExists(full_dir) + + # Dump the data to disk. +- with open(full_path, "wb") as f: +- if not isinstance(contents, bytes): +- f.write(contents.encode('utf-8')) +- else: +- f.write(contents) ++ with open(full_path, 'wb') as f: ++ f.write(data) + + + def AddComputedData(module): +--- src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/module.py +@@ -398,7 +398,8 @@ class StructField(Field): + + + class StructField(Field): +- pass ++ def __hash__(self): ++ return super(Field, self).__hash__() + + + class UnionField(Field): +--- src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/mojo/public/tools/mojom/mojom/generate/template_expander.py +@@ -75,9 +75,9 @@ def PrecompileTemplates(generator_modules, output_dir) + os.path.dirname(module.__file__), generator.GetTemplatePrefix()) + ])) + jinja_env.filters.update(generator.GetFilters()) +- jinja_env.compile_templates( +- os.path.join(output_dir, "%s.zip" % generator.GetTemplatePrefix()), +- extensions=["tmpl"], +- zip="stored", +- py_compile=True, +- ignore_errors=False) ++ jinja_env.compile_templates(os.path.join( ++ output_dir, "%s.zip" % generator.GetTemplatePrefix()), ++ extensions=["tmpl"], ++ zip="stored", ++ py_compile=sys.version_info.major < 3, ++ ignore_errors=False) +--- src/3rdparty/chromium/testing/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/testing/BUILD.gn +@@ -27,7 +27,6 @@ group("run_perf_test") { + + data_deps = [ + ":test_scripts_shared", +- "//third_party/catapult/tracing:convert_chart_json", + ] + + if (is_android) { +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py +@@ -344,7 +344,7 @@ def make_default_value_expr(idl_type, default_value): + """ + assert default_value.is_type_compatible_with(idl_type) + +- class DefaultValueExpr: ++ class DefaultValueExpr(object): + _ALLOWED_SYMBOLS_IN_DEPS = ("isolate") + + def __init__(self, initializer_expr, initializer_deps, +@@ -502,7 +502,7 @@ def make_v8_to_blink_value(blink_var_name, + assert isinstance(blink_var_name, str) + assert isinstance(v8_value_expr, str) + assert isinstance(idl_type, web_idl.IdlType) +- assert (argument_index is None or isinstance(argument_index, (int, long))) ++ assert (argument_index is None or isinstance(argument_index, int)) + assert (default_value is None + or isinstance(default_value, web_idl.LiteralConstant)) + +@@ -622,7 +622,7 @@ def make_v8_to_blink_value_variadic(blink_var_name, v8 + """ + assert isinstance(blink_var_name, str) + assert isinstance(v8_array, str) +- assert isinstance(v8_array_start_index, (int, long)) ++ assert isinstance(v8_array_start_index, int) + assert isinstance(idl_type, web_idl.IdlType) + + pattern = ("auto&& ${{{_1}}} = " +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/callback_interface.py +@@ -177,7 +177,7 @@ def generate_callback_interface(callback_interface_ide + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=None, + attribute_entries=[], +- constant_entries=filter(is_unconditional, constant_entries), ++ constant_entries=list(filter(is_unconditional, constant_entries)), + exposed_construct_entries=[], + operation_entries=[]) + (install_interface_template_decl, install_interface_template_def, +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py +@@ -503,13 +503,13 @@ class CompositeNode(CodeNode): + gensym_kwargs = {} + template_vars = {} + for arg in args: +- assert isinstance(arg, (CodeNode, int, long, str)) ++ assert isinstance(arg, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_args.append("${{{}}}".format(gensym)) + template_vars[gensym] = arg + for key, value in kwargs.items(): +- assert isinstance(key, (int, long, str)) +- assert isinstance(value, (CodeNode, int, long, str)) ++ assert isinstance(key, (int, str)) ++ assert isinstance(value, (CodeNode, int, str)) + gensym = CodeNode.gensym() + gensym_kwargs[key] = "${{{}}}".format(gensym) + template_vars[gensym] = value +@@ -602,7 +602,7 @@ class ListNode(CodeNode): + def insert(self, index, node): + if node is None: + return +- assert isinstance(index, (int, long)) ++ assert isinstance(index, int) + assert isinstance(node, CodeNode) + assert node.outer is None and node.prev is None + +@@ -721,7 +721,7 @@ class SymbolScopeNode(SequenceNode): + if not scope_chains: + return counts + +- self_index = iter(scope_chains).next().index(self) ++ self_index = next(iter(scope_chains)).index(self) + scope_chains = map( + lambda scope_chain: scope_chain[self_index + 1:], scope_chains) + scope_to_likeliness = {} +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_expr.py +@@ -109,7 +109,7 @@ def expr_and(terms): + + if any(term.is_always_false for term in terms): + return _Expr(False) +- terms = filter(lambda x: not x.is_always_true, terms) ++ terms = list(filter(lambda x: not x.is_always_true, terms)) + if not terms: + return _Expr(True) + if len(terms) == 1: +@@ -124,7 +124,7 @@ def expr_or(terms): + + if any(term.is_always_true for term in terms): + return _Expr(True) +- terms = filter(lambda x: not x.is_always_false, terms) ++ terms = list(filter(lambda x: not x.is_always_false, terms)) + if not terms: + return _Expr(False) + if len(terms) == 1: +@@ -222,7 +222,7 @@ def expr_from_exposure(exposure, + elif exposure.only_in_secure_contexts is False: + secure_context_term = _Expr(True) + else: +- terms = map(ref_enabled, exposure.only_in_secure_contexts) ++ terms = list(map(ref_enabled, exposure.only_in_secure_contexts)) + secure_context_term = expr_or( + [_Expr("${is_in_secure_context}"), + expr_not(expr_and(terms))]) +@@ -275,10 +275,11 @@ def expr_from_exposure(exposure, + + # [ContextEnabled] + if exposure.context_enabled_features: +- terms = map( +- lambda feature: _Expr( +- "${{context_feature_settings}}->is{}Enabled()".format( +- feature)), exposure.context_enabled_features) ++ terms = list( ++ map( ++ lambda feature: _Expr( ++ "${{context_feature_settings}}->is{}Enabled()".format( ++ feature)), exposure.context_enabled_features)) + context_enabled_terms.append( + expr_and([_Expr("${context_feature_settings}"), + expr_or(terms)])) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_format.py +@@ -23,7 +23,7 @@ class _TemplateFormatter(string.Formatter): + self._template_formatter_indexing_count_ = 0 + + def get_value(self, key, args, kwargs): +- if isinstance(key, (int, long)): ++ if isinstance(key, int): + return args[key] + assert isinstance(key, str) + if not key: +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/codegen_utils.py +@@ -116,4 +116,4 @@ def write_code_node_to_file(code_node, filepath): + # stderr=format_result.error_message)) + # + # web_idl.file_io.write_to_file_if_changed(filepath, format_result.contents) +- web_idl.file_io.write_to_file_if_changed(filepath, rendered_text) ++ web_idl.file_io.write_to_file_if_changed(filepath, rendered_text.encode('utf-8')) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/dictionary.py +@@ -993,7 +993,7 @@ def make_dict_trace_func(cg_context): + _2 = _blink_member_name(member).value_var + return TextNode(_format(pattern, _1=_1, _2=_2)) + +- body.extend(map(make_trace_member_node, own_members)) ++ body.extend(list(map(make_trace_member_node, own_members))) + body.append(TextNode("BaseClass::Trace(visitor);")) + + return func_decl, func_def +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/interface.py +@@ -582,7 +582,7 @@ def _make_blink_api_call(code_node, + overriding_args=None): + assert isinstance(code_node, SymbolScopeNode) + assert isinstance(cg_context, CodeGenContext) +- assert num_of_args is None or isinstance(num_of_args, (int, long)) ++ assert num_of_args is None or isinstance(num_of_args, int) + assert (overriding_args is None + or (isinstance(overriding_args, (list, tuple)) + and all(isinstance(arg, str) for arg in overriding_args))) +@@ -1196,8 +1196,10 @@ def make_overload_dispatcher(cg_context): + did_use_break = did_use_break or can_fail + + conditional = expr_or( +- map(lambda item: expr_from_exposure(item.function_like.exposure), +- items)) ++ list( ++ map( ++ lambda item: expr_from_exposure(item.function_like.exposure ++ ), items))) + if not conditional.is_always_true: + node = CxxUnlikelyIfNode(cond=conditional, body=node) + +@@ -4642,7 +4644,7 @@ class _PropEntryConstructorGroup(_PropEntryBase): + def __init__(self, is_context_dependent, exposure_conditional, world, + constructor_group, ctor_callback_name, ctor_func_length): + assert isinstance(ctor_callback_name, str) +- assert isinstance(ctor_func_length, (int, long)) ++ assert isinstance(ctor_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, constructor_group) +@@ -4670,7 +4672,7 @@ class _PropEntryOperationGroup(_PropEntryBase): + op_func_length, + no_alloc_direct_callback_name=None): + assert isinstance(op_callback_name, str) +- assert isinstance(op_func_length, (int, long)) ++ assert isinstance(op_func_length, int) + + _PropEntryBase.__init__(self, is_context_dependent, + exposure_conditional, world, operation_group) +@@ -5175,9 +5177,9 @@ def make_install_interface_template(cg_context, functi + ]) + + if class_like.identifier == "CSSStyleDeclaration": +- css_properties = filter( +- lambda attr: "CSSProperty" in attr.extended_attributes, +- class_like.attributes) ++ css_properties = list( ++ filter(lambda attr: "CSSProperty" in attr.extended_attributes, ++ class_like.attributes)) + if css_properties: + prop_name_list = "".join( + map(lambda attr: "\"{}\", ".format(attr.identifier), +@@ -5567,8 +5569,8 @@ ${instance_object} = ${v8_context}->Global()->GetProto + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantCallbackTable, base::size(kConstantCallbackTable));") +- constant_callback_entries = filter(lambda entry: entry.const_callback_name, +- constant_entries) ++ constant_callback_entries = list(filter(lambda entry: entry.const_callback_name, ++ constant_entries)) + install_properties(table_name, constant_callback_entries, + _make_constant_callback_registration_table, + installer_call_text) +@@ -5584,8 +5586,8 @@ ${instance_object} = ${v8_context}->Global()->GetProto + "V8DOMConfiguration::InstallConstants(${isolate}, " + "${interface_template}, ${prototype_template}, " + "kConstantValueTable, base::size(kConstantValueTable));") +- constant_value_entries = filter( +- lambda entry: not entry.const_callback_name, constant_entries) ++ constant_value_entries = list(filter( ++ lambda entry: not entry.const_callback_name, constant_entries)) + install_properties(table_name, constant_value_entries, + _make_constant_value_registration_table, + installer_call_text) +@@ -6336,8 +6338,8 @@ def make_v8_context_snapshot_api(cg_context, component + assert isinstance(component, web_idl.Component) + + derived_interfaces = cg_context.interface.deriveds +- derived_names = map(lambda interface: interface.identifier, +- derived_interfaces) ++ derived_names = list( ++ map(lambda interface: interface.identifier, derived_interfaces)) + derived_names.append(cg_context.interface.identifier) + if not ("Window" in derived_names or "HTMLDocument" in derived_names): + return None, None +@@ -6411,9 +6413,11 @@ def _make_v8_context_snapshot_get_reference_table_func + collect_callbacks(named_properties_object_callback_defs) + collect_callbacks(cross_origin_property_callback_defs) + +- entry_nodes = map( +- lambda name: TextNode("reinterpret_cast({}),".format(name)), +- filter(None, callback_names)) ++ entry_nodes = list( ++ map( ++ lambda name: TextNode("reinterpret_cast({}),".format(name ++ )), ++ filter(None, callback_names))) + table_node = ListNode([ + TextNode("using namespace ${class_name}Callbacks;"), + TextNode("static const intptr_t kReferenceTable[] = {"), +@@ -6451,10 +6455,11 @@ def _make_v8_context_snapshot_install_props_per_contex + class_name=None, + prop_install_mode=PropInstallMode.V8_CONTEXT_SNAPSHOT, + trampoline_var_name=None, +- attribute_entries=filter(selector, attribute_entries), +- constant_entries=filter(selector, constant_entries), +- exposed_construct_entries=filter(selector, exposed_construct_entries), +- operation_entries=filter(selector, operation_entries)) ++ attribute_entries=list(filter(selector, attribute_entries)), ++ constant_entries=list(filter(selector, constant_entries)), ++ exposed_construct_entries=list( ++ filter(selector, exposed_construct_entries)), ++ operation_entries=list(filter(selector, operation_entries))) + + return func_decl, func_def + +@@ -6810,11 +6815,11 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.UNCONDITIONAL, + trampoline_var_name=tp_install_unconditional_props, +- attribute_entries=filter(is_unconditional, attribute_entries), +- constant_entries=filter(is_unconditional, constant_entries), +- exposed_construct_entries=filter(is_unconditional, +- exposed_construct_entries), +- operation_entries=filter(is_unconditional, operation_entries)) ++ attribute_entries=list(filter(is_unconditional, attribute_entries)), ++ constant_entries=list(filter(is_unconditional, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_unconditional, exposed_construct_entries)), ++ operation_entries=list(filter(is_unconditional, operation_entries))) + (install_context_independent_props_decl, + install_context_independent_props_def, + install_context_independent_props_trampoline) = make_install_properties( +@@ -6823,11 +6828,14 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_INDEPENDENT, + trampoline_var_name=tp_install_context_independent_props, +- attribute_entries=filter(is_context_independent, attribute_entries), +- constant_entries=filter(is_context_independent, constant_entries), +- exposed_construct_entries=filter(is_context_independent, +- exposed_construct_entries), +- operation_entries=filter(is_context_independent, operation_entries)) ++ attribute_entries=list( ++ filter(is_context_independent, attribute_entries)), ++ constant_entries=list(filter(is_context_independent, ++ constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_independent, exposed_construct_entries)), ++ operation_entries=list( ++ filter(is_context_independent, operation_entries))) + (install_context_dependent_props_decl, install_context_dependent_props_def, + install_context_dependent_props_trampoline) = make_install_properties( + cg_context, +@@ -6835,11 +6843,13 @@ def generate_interface(interface_identifier): + class_name=impl_class_name, + prop_install_mode=PropInstallMode.CONTEXT_DEPENDENT, + trampoline_var_name=tp_install_context_dependent_props, +- attribute_entries=filter(is_context_dependent, attribute_entries), +- constant_entries=filter(is_context_dependent, constant_entries), +- exposed_construct_entries=filter(is_context_dependent, +- exposed_construct_entries), +- operation_entries=filter(is_context_dependent, operation_entries)) ++ attribute_entries=list(filter(is_context_dependent, ++ attribute_entries)), ++ constant_entries=list(filter(is_context_dependent, constant_entries)), ++ exposed_construct_entries=list( ++ filter(is_context_dependent, exposed_construct_entries)), ++ operation_entries=list(filter(is_context_dependent, ++ operation_entries))) + (install_interface_template_decl, install_interface_template_def, + install_interface_template_trampoline) = make_install_interface_template( + cg_context, +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py +@@ -105,7 +105,7 @@ class MakoRenderer(object): + on_error = self._caller_stack_on_error + if (len(current) <= len(on_error) + and all(current[i] == on_error[i] +- for i in xrange(len(current)))): ++ for i in range(len(current)))): + pass # Error happened in a deeper caller. + else: + self._caller_stack_on_error = list(self._caller_stack) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/style_format.py +@@ -70,8 +70,13 @@ def _invoke_format_command(command_line, filename, con + + + def _invoke_format_command(command_line, filename, contents): +- proc = subprocess.Popen( +- command_line, stdin=subprocess.PIPE, stdout=subprocess.PIPE) ++ kwargs = {} ++ if sys.version_info.major != 2: ++ kwargs['encoding'] = 'utf-8' ++ proc = subprocess.Popen(command_line, ++ stdin=subprocess.PIPE, ++ stdout=subprocess.PIPE, ++ **kwargs) + stdout_output, stderr_output = proc.communicate(input=contents) + exit_code = proc.wait() + +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/bind_gen/task_queue.py +@@ -2,6 +2,7 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import functools + import multiprocessing + + from .package_initializer import package_initializer +@@ -76,7 +77,7 @@ class TaskQueue(object): + if not report_progress: + return + +- done_count = reduce( ++ done_count = functools.reduce( + lambda count, worker_task: count + bool(worker_task.ready()), + self._worker_tasks, 0) + report_progress(len(self._worker_tasks), done_count) +@@ -85,4 +86,4 @@ def _task_queue_run_tasks(tasks): + def _task_queue_run_tasks(tasks): + for task in tasks: + func, args, kwargs = task +- apply(func, args, kwargs) ++ func(*args, **kwargs) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/code_generator.py +@@ -13,6 +13,7 @@ from idl_types import set_ancestors, IdlType + import sys + + from idl_types import set_ancestors, IdlType ++from itertools import groupby + from v8_globals import includes + from v8_interface import constant_filters + from v8_types import set_component_dirs +@@ -43,6 +44,7 @@ import jinja2 + # after path[0] == invoking script dir + sys.path.insert(1, THIRD_PARTY_DIR) + import jinja2 ++from jinja2.filters import make_attrgetter, environmentfilter + + + def generate_indented_conditional(code, conditional): +@@ -88,6 +90,13 @@ def runtime_enabled_if(code, name): + return generate_indented_conditional(code, function) + + ++@environmentfilter ++def do_stringify_key_group_by(environment, value, attribute): ++ expr = make_attrgetter(environment, attribute) ++ key = lambda item: '' if expr(item) is None else str(expr(item)) ++ return groupby(sorted(value, key=key), expr) ++ ++ + def initialize_jinja_env(cache_dir): + jinja_env = jinja2.Environment( + loader=jinja2.FileSystemLoader(TEMPLATES_DIR), +@@ -117,6 +126,7 @@ def initialize_jinja_env(cache_dir): + }) + jinja_env.filters.update(constant_filters()) + jinja_env.filters.update(method_filters()) ++ jinja_env.filters["stringifykeygroupby"] = do_stringify_key_group_by + return jinja_env + + +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/generate_origin_trial_features.py +@@ -80,7 +80,7 @@ def read_idl_file(reader, idl_filename): + assert len(interfaces) == 1, ( + "Expected one interface in file %r, found %d" % + (idl_filename, len(interfaces))) +- return (interfaces.values()[0], includes) ++ return (list(interfaces.values())[0], includes) + + + def interface_is_global(interface): +@@ -281,7 +281,7 @@ def main(): + + info_provider = create_component_info_provider( + os.path.normpath(options.info_dir), options.target_component) +- idl_filenames = map(str.strip, open(options.idl_files_list)) ++ idl_filenames = list(map(str.strip, open(options.idl_files_list))) + + generate_origin_trial_features(info_provider, options, idl_filenames) + return 0 +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_definitions.py +@@ -394,7 +394,8 @@ class IdlInterface(object): + else: + raise ValueError('Unrecognized node class: %s' % child_class) + +- if len(filter(None, [self.iterable, self.maplike, self.setlike])) > 1: ++ if len(list(filter(None, ++ [self.iterable, self.maplike, self.setlike]))) > 1: + raise ValueError( + 'Interface can only have one of iterable<>, maplike<> and setlike<>.' + ) +@@ -512,7 +513,10 @@ class IdlAttribute(TypedObject): + def accept(self, visitor): + visitor.visit_attribute(self) + ++ def __lt__(self, other): ++ return self.name < other.name + ++ + ################################################################################ + # Constants + ################################################################################ +@@ -852,7 +856,7 @@ class IdlIncludes(object): + ################################################################################ + + +-class Exposure: ++class Exposure(object): + """An Exposure holds one Exposed or RuntimeEnabled condition. + Each exposure has two properties: exposed and runtime_enabled. + Exposure(e, r) corresponds to [Exposed(e r)]. Exposure(e) corresponds to +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_reader.py +@@ -55,8 +55,8 @@ def validate_blink_idl_definitions(idl_filename, idl_f + definitions. There is no filename convention in this case. + - Otherwise, an IDL file is invalid. + """ +- targets = ( +- definitions.interfaces.values() + definitions.dictionaries.values()) ++ targets = (list(definitions.interfaces.values()) + ++ list(definitions.dictionaries.values())) + number_of_targets = len(targets) + if number_of_targets > 1: + raise Exception( +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/idl_types.py +@@ -349,7 +349,7 @@ class IdlUnionType(IdlTypeBase): + return True + + def single_matching_member_type(self, predicate): +- matching_types = filter(predicate, self.flattened_member_types) ++ matching_types = list(filter(predicate, self.flattened_member_types)) + if len(matching_types) > 1: + raise ValueError('%s is ambiguous.' % self.name) + return matching_types[0] if matching_types else None +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/utilities.py +@@ -196,8 +196,9 @@ class ComponentInfoProviderModules(ComponentInfoProvid + + @property + def callback_functions(self): +- return dict(self._component_info_core['callback_functions'].items() + +- self._component_info_modules['callback_functions'].items()) ++ return dict( ++ list(self._component_info_core['callback_functions'].items()) + ++ list(self._component_info_modules['callback_functions'].items())) + + @property + def specifier_for_export(self): +@@ -209,8 +210,8 @@ def load_interfaces_info_overall_pickle(info_dir): + + + def load_interfaces_info_overall_pickle(info_dir): +- with open(os.path.join(info_dir, +- 'interfaces_info.pickle')) as interface_info_file: ++ with open(os.path.join(info_dir, 'interfaces_info.pickle'), ++ mode='rb') as interface_info_file: + return pickle.load(interface_info_file) + + +@@ -236,23 +237,20 @@ def create_component_info_provider_core(info_dir): + + def create_component_info_provider_core(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info = pickle.load(component_info_file) + return ComponentInfoProviderCore(interfaces_info, component_info) + + + def create_component_info_provider_modules(info_dir): + interfaces_info = load_interfaces_info_overall_pickle(info_dir) +- with open( +- os.path.join(info_dir, 'core', +- 'component_info_core.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'core', 'component_info_core.pickle'), ++ mode='rb') as component_info_file: + component_info_core = pickle.load(component_info_file) +- with open( +- os.path.join( +- info_dir, 'modules', +- 'component_info_modules.pickle')) as component_info_file: ++ with open(os.path.join(info_dir, 'modules', ++ 'component_info_modules.pickle'), ++ mode='rb') as component_info_file: + component_info_modules = pickle.load(component_info_file) + return ComponentInfoProviderModules(interfaces_info, component_info_core, + component_info_modules) +@@ -356,7 +354,7 @@ def write_pickle_file(pickle_filename, data): + pickle_filename = abs(pickle_filename) + # If |data| is same with the file content, we skip updating. + if os.path.isfile(pickle_filename): +- with open(pickle_filename) as pickle_file: ++ with open(pickle_filename, 'rb') as pickle_file: + try: + if pickle.load(pickle_file) == data: + return +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_interface.py +@@ -189,7 +189,7 @@ def context_enabled_features(attributes): + return sorted([ + member for member in members + if member.get(KEY) and not member.get('exposed_test') +- ]) ++ ], key=lambda item: item['name']) + + def member_filter_by_name(members, name): + return [member for member in members if member[KEY] == name] +@@ -612,7 +612,8 @@ def interface_context(interface, interfaces, component + sorted( + origin_trial_features(interface, context['constants'], + context['attributes'], context['methods']) + +- context_enabled_features(context['attributes'])), ++ context_enabled_features(context['attributes']), ++ key=lambda item: item['name']), + }) + if context['optional_features']: + includes.add('platform/bindings/v8_per_context_data.h') +@@ -1356,9 +1357,9 @@ def resolution_tests_methods(effective_overloads): + + # Extract argument and IDL type to simplify accessing these in each loop. + arguments = [method['arguments'][index] for method in methods] +- arguments_methods = zip(arguments, methods) ++ arguments_methods = list(zip(arguments, methods)) + idl_types = [argument['idl_type_object'] for argument in arguments] +- idl_types_methods = zip(idl_types, methods) ++ idl_types_methods = list(zip(idl_types, methods)) + + # We can’t do a single loop through all methods or simply sort them, because + # a method may be listed in multiple steps of the resolution algorithm, and +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_methods.py +@@ -46,6 +46,10 @@ from v8_utilities import (has_extended_attribute_value + import v8_utilities + from v8_utilities import (has_extended_attribute_value, is_unforgeable) + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str ++ + + def method_is_visible(method, interface_is_partial): + if 'overloads' in method: +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/v8_utilities.py +@@ -271,7 +271,7 @@ EXPOSED_WORKERS = set([ + ]) + + +-class ExposureSet: ++class ExposureSet(object): + """An ExposureSet is a collection of Exposure instructions.""" + + def __init__(self, exposures=None): +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/callback_interface.py +@@ -91,11 +91,13 @@ class CallbackInterface(UserDefinedType, WithExtendedA + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/database.py +@@ -156,4 +156,4 @@ class Database(object): + return self._view_by_kind(Database._Kind.UNION) + + def _view_by_kind(self, kind): +- return self._impl.find_by_kind(kind).values() ++ return list(self._impl.find_by_kind(kind).values()) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/exposure.py +@@ -8,8 +8,11 @@ class _Feature(str): + class _Feature(str): + """Represents a runtime-enabled feature.""" + ++ def __new__(cls, value): ++ return str.__new__(cls, value) ++ + def __init__(self, value): +- str.__init__(self, value) ++ str.__init__(self) + self._is_context_dependent = ( + RuntimeEnabledFeatures.is_context_dependent(self)) + +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/function_like.py +@@ -71,8 +71,9 @@ class FunctionLike(WithIdentifier): + def num_of_required_arguments(self): + """Returns the number of required arguments.""" + return len( +- filter(lambda arg: not (arg.is_optional or arg.is_variadic), +- self.arguments)) ++ list( ++ filter(lambda arg: not (arg.is_optional or arg.is_variadic), ++ self.arguments))) + + + class OverloadGroup(WithIdentifier): +@@ -171,8 +172,7 @@ class OverloadGroup(WithIdentifier): + Returns the effective overload set. + https://heycam.github.io/webidl/#compute-the-effective-overload-set + """ +- assert argument_count is None or isinstance(argument_count, +- (int, long)) ++ assert argument_count is None or isinstance(argument_count, int) + + N = argument_count + S = [] +@@ -188,21 +188,21 @@ class OverloadGroup(WithIdentifier): + + S.append( + OverloadGroup.EffectiveOverloadItem( +- X, map(lambda arg: arg.idl_type, X.arguments), +- map(lambda arg: arg.optionality, X.arguments))) ++ X, list(map(lambda arg: arg.idl_type, X.arguments)), ++ list(map(lambda arg: arg.optionality, X.arguments)))) + + if X.is_variadic: +- for i in xrange(n, max(maxarg, N)): +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for _ in xrange(n, i + 1): ++ for i in range(n, max(maxarg, N)): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for _ in range(n, i + 1): + t.append(X.arguments[-1].idl_type) + o.append(X.arguments[-1].optionality) + S.append(OverloadGroup.EffectiveOverloadItem(X, t, o)) + +- t = map(lambda arg: arg.idl_type, X.arguments) +- o = map(lambda arg: arg.optionality, X.arguments) +- for i in xrange(n - 1, -1, -1): ++ t = list(map(lambda arg: arg.idl_type, X.arguments)) ++ o = list(map(lambda arg: arg.optionality, X.arguments)) ++ for i in range(n - 1, -1, -1): + if X.arguments[i].optionality == IdlType.Optionality.REQUIRED: + break + S.append(OverloadGroup.EffectiveOverloadItem(X, t[:i], o[:i])) +@@ -222,7 +222,7 @@ class OverloadGroup(WithIdentifier): + for item in items) + assert len(items) > 1 + +- for index in xrange(len(items[0].type_list)): ++ for index in range(len(items[0].type_list)): + # Assume that the given items are valid, and we only need to test + # the two types. + if OverloadGroup.are_distinguishable_types( +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/idl_compiler.py +@@ -149,8 +149,8 @@ class IdlCompiler(object): + for old_ir in old_irs: + new_ir = make_copy(old_ir) + self._ir_map.add(new_ir) +- new_ir.attributes = filter(not_disabled, new_ir.attributes) +- new_ir.operations = filter(not_disabled, new_ir.operations) ++ new_ir.attributes = list(filter(not_disabled, new_ir.attributes)) ++ new_ir.operations = list(filter(not_disabled, new_ir.operations)) + + def _record_defined_in_partial_and_mixin(self): + old_irs = self._ir_map.irs_of_kinds( +@@ -231,7 +231,7 @@ class IdlCompiler(object): + only_to_members_of_partial_or_mixin=False) + propagate_to_exposure(propagate) + +- map(process_member_like, ir.iter_all_members()) ++ list(map(process_member_like, ir.iter_all_members())) + + def process_member_like(ir): + propagate = functools.partial(propagate_extattr, ir=ir) +@@ -257,7 +257,7 @@ class IdlCompiler(object): + + self._ir_map.move_to_new_phase() + +- map(process_interface_like, old_irs) ++ list(map(process_interface_like, old_irs)) + + def _determine_blink_headers(self): + irs = self._ir_map.irs_of_kinds( +@@ -422,9 +422,9 @@ class IdlCompiler(object): + assert not new_interface.deriveds + derived_set = identifier_to_derived_set.get( + new_interface.identifier, set()) +- new_interface.deriveds = map( +- lambda id_: self._ref_to_idl_def_factory.create(id_), +- sorted(derived_set)) ++ new_interface.deriveds = list( ++ map(lambda id_: self._ref_to_idl_def_factory.create(id_), ++ sorted(derived_set))) + + def _supplement_missing_html_constructor_operation(self): + # Temporary mitigation of misuse of [HTMLConstructor] +@@ -553,7 +553,8 @@ class IdlCompiler(object): + self._ir_map.add(new_ir) + + for group in new_ir.iter_all_overload_groups(): +- exposures = map(lambda overload: overload.exposure, group) ++ exposures = list(map(lambda overload: overload.exposure, ++ group)) + + # [Exposed] + if any(not exposure.global_names_and_features +@@ -653,8 +654,8 @@ class IdlCompiler(object): + constructs = set() + for global_name in global_names: + constructs.update(exposed_map.get(global_name, [])) +- new_ir.exposed_constructs = map( +- self._ref_to_idl_def_factory.create, sorted(constructs)) ++ new_ir.exposed_constructs = list( ++ map(self._ref_to_idl_def_factory.create, sorted(constructs))) + + assert not new_ir.legacy_window_aliases + if new_ir.identifier != 'Window': +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/interface.py +@@ -180,8 +180,9 @@ class Interface(UserDefinedType, WithExtendedAttribute + self._constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._constructors)), + owner=self) for group_ir in ir.constructor_groups + ]) + assert len(self._constructor_groups) <= 1 +@@ -192,8 +193,9 @@ class Interface(UserDefinedType, WithExtendedAttribute + self._named_constructor_groups = tuple([ + ConstructorGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._named_constructors), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._named_constructors)), + owner=self) for group_ir in ir.named_constructor_groups + ]) + self._operations = tuple([ +@@ -203,22 +205,23 @@ class Interface(UserDefinedType, WithExtendedAttribute + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=self) for group_ir in ir.operation_groups + ]) + self._exposed_constructs = tuple(ir.exposed_constructs) + self._legacy_window_aliases = tuple(ir.legacy_window_aliases) + self._indexed_and_named_properties = None +- indexed_and_named_property_operations = filter( +- lambda x: x.is_indexed_or_named_property_operation, +- self._operations) ++ indexed_and_named_property_operations = list( ++ filter(lambda x: x.is_indexed_or_named_property_operation, ++ self._operations)) + if indexed_and_named_property_operations: + self._indexed_and_named_properties = IndexedAndNamedProperties( + indexed_and_named_property_operations, owner=self) + self._stringifier = None +- stringifier_operation_irs = filter(lambda x: x.is_stringifier, +- ir.operations) ++ stringifier_operation_irs = list( ++ filter(lambda x: x.is_stringifier, ir.operations)) + if stringifier_operation_irs: + assert len(stringifier_operation_irs) == 1 + op_ir = make_copy(stringifier_operation_irs[0]) +@@ -231,8 +234,9 @@ class Interface(UserDefinedType, WithExtendedAttribute + attribute = None + if operation.stringifier_attribute: + attr_id = operation.stringifier_attribute +- attributes = filter(lambda x: x.identifier == attr_id, +- self._attributes) ++ attributes = list( ++ filter(lambda x: x.identifier == attr_id, ++ self._attributes)) + assert len(attributes) == 1 + attribute = attributes[0] + self._stringifier = Stringifier(operation, attribute, owner=self) +@@ -578,8 +582,9 @@ class Iterable(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -666,8 +671,9 @@ class Maplike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +@@ -755,8 +761,9 @@ class Setlike(WithDebugInfo): + self._operation_groups = tuple([ + OperationGroup( + group_ir, +- filter(lambda x: x.identifier == group_ir.identifier, +- self._operations), ++ list( ++ filter(lambda x: x.identifier == group_ir.identifier, ++ self._operations)), + owner=owner) for group_ir in ir.operation_groups + ]) + +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/ir_builder.py +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import sys ++ + from .argument import Argument + from .ast_group import AstGroup + from .attribute import Attribute +@@ -30,6 +32,11 @@ from .typedef import Typedef + from .typedef import Typedef + + ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ ++ + def load_and_register_idl_definitions(filepaths, register_ir, + create_ref_to_idl_def, idl_type_factory): + """ +@@ -160,7 +167,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) + +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + attributes = [] + constants = [] + operations = [] +@@ -302,7 +309,7 @@ class _IRBuilder(object): + child_nodes = list(node.GetChildren()) + inherited = self._take_inheritance(child_nodes) + extended_attributes = self._take_extended_attributes(child_nodes) +- own_members = map(self._build_dictionary_member, child_nodes) ++ own_members = list(map(self._build_dictionary_member, child_nodes)) + + return Dictionary.IR( + identifier=Identifier(node.GetName()), +@@ -336,7 +343,7 @@ class _IRBuilder(object): + + child_nodes = list(node.GetChildren()) + extended_attributes = self._take_extended_attributes(child_nodes) +- members = map(self._build_interface_member, child_nodes) ++ members = list(map(self._build_interface_member, child_nodes)) + constants = [] + operations = [] + for member in members: +@@ -456,8 +463,8 @@ class _IRBuilder(object): + assert len(child_nodes) == 1 + child = child_nodes[0] + if child.GetClass() == 'Arguments': +- arguments = map(build_extattr_argument, +- child.GetChildren()) ++ arguments = list( ++ map(build_extattr_argument, child.GetChildren())) + elif child.GetClass() == 'Call': + assert len(child.GetChildren()) == 1 + grand_child = child.GetChildren()[0] +@@ -486,7 +493,9 @@ class _IRBuilder(object): + + assert node.GetClass() == 'ExtAttributes' + return ExtendedAttributes( +- filter(None, map(build_extended_attribute, node.GetChildren()))) ++ list( ++ filter(None, map(build_extended_attribute, ++ node.GetChildren())))) + + def _build_inheritance(self, node): + assert node.GetClass() == 'Inherit' +@@ -506,7 +515,7 @@ class _IRBuilder(object): + + def _build_iterable(self, node): + assert node.GetClass() == 'Iterable' +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 or len(types) == 2 + if len(types) == 1: # value iterator + key_type, value_type = (None, types[0]) +@@ -584,7 +593,7 @@ class _IRBuilder(object): + def _build_maplike(self, node, interface_identifier): + assert node.GetClass() == 'Maplike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 2 + key_type, value_type = types + is_readonly = bool(node.GetProperty('READONLY')) +@@ -676,7 +685,7 @@ class _IRBuilder(object): + def _build_setlike(self, node, interface_identifier): + assert node.GetClass() == 'Setlike' + assert isinstance(interface_identifier, Identifier) +- types = map(self._build_type, node.GetChildren()) ++ types = list(map(self._build_type, node.GetChildren())) + assert len(types) == 1 + value_type = types[0] + is_readonly = bool(node.GetProperty('READONLY')) +@@ -838,7 +847,7 @@ class _IRBuilder(object): + + def build_union_type(node, extended_attributes): + return self._idl_type_factory.union_type( +- member_types=map(self._build_type, node.GetChildren()), ++ member_types=list(map(self._build_type, node.GetChildren())), + is_optional=is_optional, + extended_attributes=extended_attributes, + debug_info=self._build_debug_info(node)) +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/make_copy.py +@@ -3,6 +3,13 @@ + # found in the LICENSE file. + + ++import sys ++ ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ long = int ++ basestring = str ++ + def make_copy(obj, memo=None): + """ + Creates a copy of the given object, which should be an IR or part of IR. +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/scripts/web_idl/namespace.py +@@ -107,11 +107,13 @@ class Namespace(UserDefinedType, WithExtendedAttribute + for operation_ir in ir.operations + ]) + self._operation_groups = tuple([ +- OperationGroup( +- operation_group_ir, +- filter(lambda x: x.identifier == operation_group_ir.identifier, +- self._operations), +- owner=self) for operation_group_ir in ir.operation_groups ++ OperationGroup(operation_group_ir, ++ list( ++ filter( ++ lambda x: x.identifier == operation_group_ir ++ .identifier, self._operations)), ++ owner=self) ++ for operation_group_ir in ir.operation_groups + ]) + + @property +--- src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/bindings/templates/dictionary_v8.cc.tmpl +@@ -59,9 +59,9 @@ void {{v8_class}}::ToImpl(v8::Isolate* isolate, v8::Lo + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +@@ -147,9 +147,9 @@ bool toV8{{cpp_class}}(const {{cpp_class}}* impl, v8:: + DCHECK(executionContext); + {% endif %}{# has_origin_trial_members #} + {% endif %}{# members #} +- {% for origin_trial_test, origin_trial_member_list in members | groupby('origin_trial_feature_name') %} ++ {% for origin_trial_test, origin_trial_member_list in members | stringifykeygroupby('origin_trial_feature_name') %} + {% filter origin_trial_enabled(origin_trial_test, "executionContext") %} +- {% for feature_name, member_list in origin_trial_member_list | groupby('runtime_enabled_feature_name') %} ++ {% for feature_name, member_list in origin_trial_member_list | stringifykeygroupby('runtime_enabled_feature_name') %} + {% filter runtime_enabled(feature_name) %} + {% for member in member_list %} + v8::Local {{member.v8_value}}; +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/make_style_shorthands.py +@@ -71,7 +71,7 @@ class Expansion(object): + def enabled_longhands(self): + include = lambda longhand: not longhand[ + 'runtime_flag'] or self.is_enabled(longhand['runtime_flag']) +- return filter(include, self._longhands) ++ return list(filter(include, self._longhands)) + + @property + def index(self): +@@ -87,8 +87,9 @@ def create_expansions(longhands): + + def create_expansions(longhands): + flags = collect_runtime_flags(longhands) +- expansions = map(lambda mask: Expansion(longhands, flags, mask), +- range(1 << len(flags))) ++ expansions = list( ++ map(lambda mask: Expansion(longhands, flags, mask), ++ range(1 << len(flags)))) + assert len(expansions) > 0 + # We generate 2^N expansions for N flags, so enforce some limit. + assert len(flags) <= 4, 'Too many runtime flags for a single shorthand' +@@ -114,14 +115,14 @@ class StylePropertyShorthandWriter(json5_generator.Wri + + self._longhand_dictionary = defaultdict(list) + for property_ in json5_properties.shorthands: +- property_['longhand_enum_keys'] = map(enum_key_for_css_property, +- property_['longhands']) +- property_['longhand_property_ids'] = map(id_for_css_property, +- property_['longhands']) ++ property_['longhand_enum_keys'] = list( ++ map(enum_key_for_css_property, property_['longhands'])) ++ property_['longhand_property_ids'] = list( ++ map(id_for_css_property, property_['longhands'])) + +- longhands = map( +- lambda name: json5_properties.properties_by_name[name], +- property_['longhands']) ++ longhands = list( ++ map(lambda name: json5_properties.properties_by_name[name], ++ property_['longhands'])) + property_['expansions'] = create_expansions(longhands) + for longhand_enum_key in property_['longhand_enum_keys']: + self._longhand_dictionary[longhand_enum_key].append(property_) +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/core/css/properties/make_css_property_instances.py +@@ -42,8 +42,8 @@ class CSSPropertyInstancesWriter(json5_generator.Write + aliases = self._css_properties.aliases + + # Lists of PropertyClassData. +- self._property_classes_by_id = map(self.get_class, properties) +- self._alias_classes_by_id = map(self.get_class, aliases) ++ self._property_classes_by_id = list(map(self.get_class, properties)) ++ self._alias_classes_by_id = list(map(self.get_class, aliases)) + + # Sort by enum value. + self._property_classes_by_id.sort(key=lambda t: t.enum_value) +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +@@ -95,7 +95,7 @@ def main(): + + open(args.output_file, 'wb').write( + generate_gperf(gperf_path, +- open(infile).read(), gperf_args)) ++ open(infile).read(), gperf_args).encode('utf-8')) + + + if __name__ == '__main__': +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_file.py +@@ -66,7 +66,7 @@ class InFile(object): + self._defaults = defaults + self._valid_values = copy.deepcopy( + valid_values if valid_values else {}) +- self._parse(map(str.strip, lines)) ++ self._parse(list(map(str.strip, lines))) + + @classmethod + def load_from_files(self, file_paths, defaults, valid_values, +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/in_generator.py +@@ -32,9 +32,14 @@ import shutil + import os.path + import shlex + import shutil ++import sys + import optparse + + from in_file import InFile ++ ++# TODO: Remove this once Python2 is obsoleted. ++if sys.version_info.major != 2: ++ basestring = str + + + ######################################################### +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/make_runtime_features.py +@@ -138,7 +138,7 @@ class RuntimeFeatureWriter(BaseRuntimeFeatureWriter): + except Exception: + # If trouble unpickling, overwrite + pass +- with open(os.path.abspath(file_name), 'w') as pickle_file: ++ with open(os.path.abspath(file_name), 'wb') as pickle_file: + pickle.dump(features_map, pickle_file) + + def _template_inputs(self): +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_factory.cc.tmpl +@@ -26,7 +26,7 @@ static {{namespace}}FunctionMap* g_{{namespace|lower}} + + static {{namespace}}FunctionMap* g_{{namespace|lower}}_constructors = nullptr; + +-{% for tag in tags|sort if not tag.noConstructor %} ++{% for tag in tags|sort(attribute='name') if not tag.noConstructor %} + static {{namespace}}Element* {{namespace}}{{tag.name.to_upper_camel_case()}}Constructor( + Document& document, const CreateElementFlags flags) { + {% if tag.runtimeEnabled %} +@@ -52,7 +52,7 @@ static void Create{{namespace}}FunctionMap() { + // Empty array initializer lists are illegal [dcl.init.aggr] and will not + // compile in MSVC. If tags list is empty, add check to skip this. + static const Create{{namespace}}FunctionMapData data[] = { +- {% for tag in tags|sort if not tag.noConstructor %} ++ {% for tag in tags|sort(attribute='name') if not tag.noConstructor %} + { {{cpp_namespace}}::{{tag|symbol}}Tag, {{namespace}}{{tag.name.to_upper_camel_case()}}Constructor }, + {% endfor %} + }; +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.cc.tmpl +@@ -22,7 +22,7 @@ HTMLTypeMap CreateHTMLTypeMap() { + const char* name; + HTMLElementType type; + } kTags[] = { +- {% for tag in tags|sort %} ++ {% for tag in tags|sort(attribute='name') %} + { "{{tag.name}}", HTMLElementType::k{{tag.js_interface}} }, + {% endfor %} + }; +@@ -42,7 +42,7 @@ HTMLElementType htmlElementTypeForTag(const AtomicStri + if (it == html_type_map.end()) + return HTMLElementType::kHTMLUnknownElement; + +- {% for tag in tags|sort %} ++ {% for tag in tags|sort(attribute='name') %} + {% if tag.runtimeEnabled %} + if (tagName == "{{tag.name}}") { + if (!RuntimeEnabledFeatures::{{tag.runtimeEnabled}}Enabled(document->GetExecutionContext())) { +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/element_type_helpers.h.tmpl +@@ -15,7 +15,7 @@ class Document; + class Document; + + // Type checking. +-{% for tag in tags|sort if not tag.multipleTagNames and not tag.noTypeHelpers %} ++{% for tag in tags|sort(attribute='name') if not tag.multipleTagNames and not tag.noTypeHelpers %} + class {{tag.interface}}; + template <> + inline bool IsElementOfType(const Node& node) { +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/macros.tmpl +@@ -25,7 +25,7 @@ + + + {% macro trie_leaf(index, object, return_macro, lowercase_data) %} +-{% set name, value = object.items()[0] %} ++{% set name, value = (object.items()|list)[0] %} + {% if name|length %} + if ( + {%- for c in name -%} +@@ -45,7 +45,7 @@ return {{ return_macro(value) }}; + + + {% macro trie_switch(trie, index, return_macro, lowercase_data) %} +-{% if trie|length == 1 and trie.values()[0] is string %} ++{% if trie|length == 1 and (trie.values()|list)[0] is string %} + {{ trie_leaf(index, trie, return_macro, lowercase_data) -}} + {% else %} + {% if lowercase_data %} +--- src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/build/scripts/templates/make_qualified_names.h.tmpl +@@ -24,12 +24,12 @@ namespace {{cpp_namespace}} { + {{symbol_export}}extern const WTF::AtomicString& {{namespace_prefix}}NamespaceURI; + + // Tags +-{% for tag in tags|sort %} ++{% for tag in tags|sort(attribute='name') %} + {{symbol_export}}extern const blink::{{namespace}}QualifiedName& {{tag|symbol}}Tag; + {% endfor %} + + // Attributes +-{% for attr in attrs|sort %} ++{% for attr in attrs|sort(attribute='name') %} + {{symbol_export}}extern const blink::QualifiedName& {{attr|symbol}}Attr; + {% endfor %} + +--- src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/dawn/generator/generator_lib.py +@@ -201,6 +201,10 @@ def _compute_python_dependencies(root_dir=None): + + paths = set() + for path in module_paths: ++ # Builtin/namespaced modules may return None for the file path. ++ if not path: ++ continue ++ + path = os.path.abspath(path) + + if not path.startswith(root_dir): +--- src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/devtools-frontend/src/BUILD.gn +@@ -2,6 +2,8 @@ + # Use of this source code is governed by a BSD-style license that can be + # found in the LICENSE file. + ++import("//build/config/python.gni") ++ + import("//third_party/blink/public/public_features.gni") + import("./all_devtools_files.gni") + import("./all_devtools_modules.gni") +--- src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_inspector_overlay.py +@@ -45,7 +45,8 @@ def rollup(input_path, output_path, filename, max_size + ['--format', 'iife', '-n', 'InspectorOverlay'] + ['--input', target] + + ['--plugin', rollup_plugin], + stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) ++ stderr=subprocess.PIPE, ++ text=True) + out, error = rollup_process.communicate() + if not out: + raise Exception("rollup failed: " + error) +--- src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/build_release_applications.py +@@ -10,7 +10,7 @@ and the application loader into a single script + and the application loader into a single script. + """ + +-from cStringIO import StringIO ++from io import StringIO + from os import path + from os.path import join + import copy +@@ -145,8 +145,7 @@ class ReleaseBuilder(object): + resource_content = read_file(path.join(self.application_dir, resource_name)) + if not (resource_name.endswith('.html') + or resource_name.endswith('md')): +- resource_content += resource_source_url(resource_name).encode( +- 'utf-8') ++ resource_content += resource_source_url(resource_name) + resource_content = resource_content.replace('\\', '\\\\') + resource_content = resource_content.replace('\n', '\\n') + resource_content = resource_content.replace('"', '\\"') +@@ -173,7 +172,9 @@ class ReleaseBuilder(object): + def _concatenate_application_script(self, output): + output.write('Root.allDescriptors.push(...%s);' % self._release_module_descriptors()) + if self.descriptors.extends: +- output.write('Root.applicationDescriptor.modules.push(...%s);' % json.dumps(self.descriptors.application.values())) ++ output.write( ++ 'Root.applicationDescriptor.modules.push(...%s);' % ++ json.dumps(list(self.descriptors.application.values()))) + else: + output.write('Root.applicationDescriptor = %s;' % self.descriptors.application_json()) + +--- src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/generate_devtools_grd.py +@@ -123,7 +123,7 @@ def main(argv): + + try: + os.makedirs(path.join(output_directory, 'Images')) +- except OSError, e: ++ except OSError as e: + if e.errno != errno.EEXIST: + raise e + +@@ -147,7 +147,7 @@ def main(argv): + shutil.copy(path.join(dirname, filename), path.join(output_directory, 'Images')) + add_file_to_grd(doc, path.join('Images', filename)) + +- with open(parsed_args.output_filename, 'w') as output_file: ++ with open(parsed_args.output_filename, 'wb') as output_file: + output_file.write(doc.toxml(encoding='UTF-8')) + + +--- src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/devtools-frontend/src/scripts/build/modular_build.py +@@ -7,6 +7,8 @@ Utilities for the modular DevTools build. + Utilities for the modular DevTools build. + """ + ++from __future__ import print_function ++ + import collections + from os import path + import os +@@ -40,7 +42,7 @@ def load_and_parse_json(filename): + try: + return json.loads(read_file(filename)) + except: +- print 'ERROR: Failed to parse %s' % filename ++ print('ERROR: Failed to parse %s' % filename) + raise + + class Descriptors: +@@ -57,7 +59,7 @@ class Descriptors: + + def application_json(self): + result = dict() +- result['modules'] = self.application.values() ++ result['modules'] = list(self.application.values()) + return json.dumps(result) + + def all_compiled_files(self): +--- src/3rdparty/chromium/third_party/jinja2/tests.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/jinja2/tests.py +@@ -10,7 +10,7 @@ import re + """ + import operator + import re +-from collections import Mapping ++from collections.abc import Mapping + from jinja2.runtime import Undefined + from jinja2._compat import text_type, string_types, integer_types + import decimal +--- src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/third_party/webrtc/test/BUILD.gn +@@ -258,10 +258,6 @@ rtc_library("perf_test") { + absl_deps = [ "//third_party/abseil-cpp/absl/types:optional" ] + if (rtc_enable_protobuf) { + sources += [ "testsupport/perf_test_histogram_writer.cc" ] +- deps += [ +- "//third_party/catapult/tracing/tracing:histogram", +- "//third_party/catapult/tracing/tracing:reserved_infos", +- ] + } else { + sources += [ "testsupport/perf_test_histogram_writer_no_protobuf.cc" ] + } +@@ -566,7 +562,6 @@ if (rtc_include_tests) { + + if (rtc_enable_protobuf) { + sources += [ "testsupport/perf_test_histogram_writer_unittest.cc" ] +- deps += [ "//third_party/catapult/tracing/tracing:histogram" ] + } + + data = test_support_unittests_resources +--- src/3rdparty/chromium/tools/binary_size/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/binary_size/BUILD.gn +@@ -18,7 +18,6 @@ python_library("sizes_py") { + python_library("sizes_py") { + testonly = true + pydeps_file = "sizes.pydeps" +- data_deps = [ "//third_party/catapult/tracing:convert_chart_json" ] + } + + if (is_linux || is_chromeos) { +--- src/3rdparty/chromium/tools/grit/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/grit/BUILD.gn +@@ -33,7 +33,6 @@ group("grit_python_unittests") { + "//testing/scripts/run_isolated_script_test.py", + "//testing/xvfb.py", + "//tools/grit/", +- "//third_party/catapult/third_party/typ/", + ] + } + +--- src/3rdparty/chromium/tools/grit/grit/util.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/grit/grit/util.py +@@ -211,7 +211,7 @@ def ReadFile(filename, encoding): + mode = 'rb' + encoding = None + else: +- mode = 'rU' ++ mode = 'r' + + with io.open(abs(filename), mode, encoding=encoding) as f: + return f.read() +--- src/3rdparty/chromium/tools/gritsettings/resource_ids.spec.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/gritsettings/resource_ids.spec +@@ -499,12 +499,6 @@ + "content/shell/shell_resources.grd": { + "includes": [2940], + }, +- +- # This file is generated during the build. +- "<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.grd": { +- "META": {"sizes": {"includes": [20],}}, +- "includes": [2960], +- }, + # END content/ section. + + # START ios/web/ section. +--- src/3rdparty/chromium/tools/metrics/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/metrics/BUILD.gn +@@ -56,7 +56,6 @@ group("metrics_python_tests") { + "//testing/scripts/common.py", + "//testing/xvfb.py", + "//testing/test_env.py", +- "//third_party/catapult/third_party/typ/", + + # Scripts we depend on. Their unit tests are also included. + "//tools/json_comment_eater/json_comment_eater.py", +--- src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/metrics/ukm/gen_builders.py +@@ -48,9 +48,10 @@ def ReadFilteredData(path): + data = ukm_model.UKM_XML_TYPE.Parse(ukm_file.read()) + event_tag = ukm_model._EVENT_TYPE.tag + metric_tag = ukm_model._METRIC_TYPE.tag +- data[event_tag] = filter(ukm_model.IsNotObsolete, data[event_tag]) ++ data[event_tag] = list(filter(ukm_model.IsNotObsolete, data[event_tag])) + for event in data[event_tag]: +- event[metric_tag] = filter(ukm_model.IsNotObsolete, event[metric_tag]) ++ event[metric_tag] = list( ++ filter(ukm_model.IsNotObsolete, event[metric_tag])) + return data + + +--- src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/metrics/ukm/ukm_model.py +@@ -42,7 +42,7 @@ _STATISTICS_TYPE = models.ObjectNodeType( + _STATISTICS_TYPE = models.ObjectNodeType( + 'statistics', + attributes=[ +- ('export', str, r'^(?i)(|true|false)$'), ++ ('export', str, r'(?i)^(|true|false)$'), + ], + children=[ + models.ChildType(_QUANTILES_TYPE.tag, _QUANTILES_TYPE, multiple=False), +@@ -94,7 +94,7 @@ _EVENT_TYPE = models.ObjectNodeType( + 'event', + attributes=[ + ('name', str, r'^[A-Za-z0-9.]+$'), +- ('singular', str, r'^(?i)(|true|false)$'), ++ ('singular', str, r'(?i)^(|true|false)$'), + ], + alphabetization=[ + (_OBSOLETE_TYPE.tag, _KEEP_ORDER), +--- src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/perf/chrome_telemetry_build/BUILD.gn +@@ -107,7 +107,6 @@ group("telemetry_chrome_test_without_chrome") { + "//tools/perf/core/", # chrome_telemetry_build/ depends on core/ + ] + data_deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//tools/metrics:metrics_python_tests", + ] + +@@ -151,7 +150,5 @@ group("telemetry_chrome_test_without_chrome") { + "//build/android:devil_chromium_py", + "//build/android:stack_tools", + ] +- } else if (!is_fuchsia) { +- data_deps += [ "//third_party/catapult/telemetry:bitmaptools" ] + } + } +--- src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/perf/core/perfetto_binary_roller/BUILD.gn +@@ -7,7 +7,6 @@ generate_wrapper("upload_trace_processor") { + generate_wrapper("upload_trace_processor") { + testonly = true + data_deps = [ +- "//third_party/catapult:telemetry_chrome_test_support", + "//third_party/perfetto/src/trace_processor:trace_processor_shell", + ] + data = [ +--- src/3rdparty/chromium/tools/polymer/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/tools/polymer/BUILD.gn +@@ -10,6 +10,5 @@ group("polymer_tools_python_unittests") { + "//testing/scripts/run_isolated_script_test.py", + "//testing/xvfb.py", + "//tools/polymer/", +- "//third_party/catapult/third_party/typ/", + ] + } +--- src/3rdparty/chromium/ui/ozone/generate_constructor_list.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/ui/ozone/generate_constructor_list.py +@@ -45,12 +45,15 @@ Example Output: ./ui/ozone/generate_constructor_list.p + } // namespace ui + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetTypedefName(typename): +@@ -68,7 +71,7 @@ def GetConstructorName(typename, platform): + This is just "Create" + typename + platform. + """ + +- return 'Create' + typename + string.capitalize(platform) ++ return 'Create' + typename + platform.capitalize() + + + def GenerateConstructorList(out, namespace, export, typenames, platforms, +@@ -163,12 +166,14 @@ def main(argv): + sys.exit(1) + + # Write to standard output or file specified by --output_cc. +- out_cc = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + +- GenerateConstructorList(out_cc, options.namespace, options.export, ++ out_cc_str = StringIO() ++ GenerateConstructorList(out_cc_str, options.namespace, options.export, + typenames, platforms, includes, usings) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() +--- src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/ui/ozone/generate_ozone_platform_list.py +@@ -49,12 +49,15 @@ Example Output: ./generate_ozone_platform_list.py --de + + """ + ++try: ++ from StringIO import StringIO # for Python 2 ++except ImportError: ++ from io import StringIO # for Python 3 + import optparse + import os + import collections + import re + import sys +-import string + + + def GetConstantName(name): +@@ -63,7 +66,7 @@ def GetConstantName(name): + We just capitalize the platform name and prepend "CreateOzonePlatform". + """ + +- return 'kPlatform' + string.capitalize(name) ++ return 'kPlatform' + name.capitalize() + + + def GeneratePlatformListText(out, platforms): +@@ -149,9 +152,9 @@ def main(argv): + platforms.insert(0, options.default) + + # Write to standard output or file specified by --output_{cc,h}. +- out_cc = sys.stdout +- out_h = sys.stdout +- out_txt = sys.stdout ++ out_cc = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_h = getattr(sys.stdout, 'buffer', sys.stdout) ++ out_txt = getattr(sys.stdout, 'buffer', sys.stdout) + if options.output_cc: + out_cc = open(options.output_cc, 'wb') + if options.output_h: +@@ -159,9 +162,16 @@ def main(argv): + if options.output_txt: + out_txt = open(options.output_txt, 'wb') + +- GeneratePlatformListText(out_txt, platforms) +- GeneratePlatformListHeader(out_h, platforms) +- GeneratePlatformListSource(out_cc, platforms) ++ out_txt_str = StringIO() ++ out_h_str = StringIO() ++ out_cc_str = StringIO() ++ ++ GeneratePlatformListText(out_txt_str, platforms) ++ out_txt.write(out_txt_str.getvalue().encode('utf-8')) ++ GeneratePlatformListHeader(out_h_str, platforms) ++ out_h.write(out_h_str.getvalue().encode('utf-8')) ++ GeneratePlatformListSource(out_cc_str, platforms) ++ out_cc.write(out_cc_str.getvalue().encode('utf-8')) + + if options.output_cc: + out_cc.close() +--- src/3rdparty/chromium/v8/tools/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/v8/tools/BUILD.gn +@@ -31,10 +31,6 @@ group("v8_android_test_runner_deps") { + + if (is_android && !build_with_chromium) { + data_deps = [ "//build/android:test_runner_py" ] +- data = [ +- # This is used by android.py, but not included by test_runner_py above. +- "//third_party/catapult/devil/devil/android/perf/", +- ] + } + } + +--- src/3rdparty/chromium/weblayer/shell/BUILD.gn.orig 2023-07-14 13:25:01 UTC ++++ src/3rdparty/chromium/weblayer/shell/BUILD.gn +@@ -161,7 +161,6 @@ repack("support_pak") { + "$root_gen_dir/components/strings/components_locale_settings_en-US.pak", + "$root_gen_dir/components/strings/components_strings_en-US.pak", + "$root_gen_dir/content/app/resources/content_resources_100_percent.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -182,7 +181,6 @@ repack("support_pak") { + "//content:content_resources", + "//content:dev_ui_content_resources", + "//content/app/resources", +- "//content/browser/tracing:resources", + "//mojo/public/js:resources", + "//net:net_resources", + "//third_party/blink/public:resources", diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_ranges_algorithm.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_ranges_algorithm.h new file mode 100644 index 000000000000..7eb58c41d392 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_ranges_algorithm.h @@ -0,0 +1,15 @@ +--- src/3rdparty/chromium/base/ranges/algorithm.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/base/ranges/algorithm.h +@@ -60,9 +60,9 @@ class BinaryPredicateProjector { + + private: + template +- using InvokeResult = invoke_result_t, +- invoke_result_t>; ++ using InvokeResult = std::invoke_result_t, ++ std::invoke_result_t>; + + template > + constexpr std::pair GetProjs(priority_tag<3>) const { diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_task_thread__pool_job__task__source.cc b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_task_thread__pool_job__task__source.cc new file mode 100644 index 000000000000..cbf8d99a87f7 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_task_thread__pool_job__task__source.cc @@ -0,0 +1,14 @@ +--- src/3rdparty/chromium/base/task/thread_pool/job_task_source.cc.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/base/task/thread_pool/job_task_source.cc +@@ -29,8 +29,9 @@ static_assert( + constexpr size_t kMaxWorkersPerJob = 32; + static_assert( + kMaxWorkersPerJob <= +- std::numeric_limits::type>::max(), ++ std::numeric_limits< ++ std::invoke_result::type>::max(), + "AcquireTaskId return type isn't big enough to fit kMaxWorkersPerJob"); + + } // namespace diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_template__util.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_template__util.h new file mode 100644 index 000000000000..21a63155ed73 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_template__util.h @@ -0,0 +1,27 @@ +--- src/3rdparty/chromium/base/template_util.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/base/template_util.h +@@ -124,24 +124,8 @@ struct priority_tag<0> {}; + + // TODO(crbug.com/554293): Remove this when all platforms have this in the std + // namespace and it works with gcc as needed. +-#if defined(CR_USE_FALLBACKS_FOR_OLD_EXPERIMENTAL_GLIBCXX) || \ +- defined(CR_USE_FALLBACKS_FOR_GCC_WITH_LIBCXX) +-template +-struct is_trivially_copyable { +-// TODO(danakj): Remove this when android builders are all using a newer version +-// of gcc, or the android ndk is updated to a newer libc++ that does this for +-// us. +-#if _GNUC_VER >= 501 +- static constexpr bool value = __is_trivially_copyable(T); +-#else +- static constexpr bool value = +- __has_trivial_copy(T) && __has_trivial_destructor(T); +-#endif +-}; +-#else + template + using is_trivially_copyable = std::is_trivially_copyable; +-#endif + + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7 + // Workaround for g++7 and earlier family. diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_threading_hang__watcher.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_threading_hang__watcher.h new file mode 100644 index 000000000000..cc08adaffe78 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_base_threading_hang__watcher.h @@ -0,0 +1,12 @@ +--- src/3rdparty/chromium/base/threading/hang_watcher.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/base/threading/hang_watcher.h +@@ -420,7 +420,8 @@ class BASE_EXPORT HangWatchDeadline { + + private: + using TimeTicksInternalRepresentation = +- std::result_of::type; ++ std::invoke_result::type; + static_assert(std::is_same::value, + "Bit manipulations made by HangWatchDeadline need to be" + "adapted if internal representation of TimeTicks changes."); diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn b/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn index 34b3afbecbef..660b06bee167 100644 --- a/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_build_config_compiler_BUILD.gn @@ -1,100 +1,129 @@ ---- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2021-12-15 16:12:54 UTC +--- src/3rdparty/chromium/build/config/compiler/BUILD.gn.orig 2023-11-09 11:32:20 UTC +++ src/3rdparty/chromium/build/config/compiler/BUILD.gn @@ -134,7 +134,7 @@ declare_args() { # # TODO(crbug.com/977230): Enabling this when 'use_xcode_clang' is true may # call an old clang that doesn't support auto-init. - init_stack_vars = !is_android && !use_xcode_clang + init_stack_vars = !is_android && !use_xcode_clang && !is_bsd # This argument is to control whether enabling text section splitting in the # final binary. When enabled, the separated text sections with prefix @@ -297,7 +297,7 @@ config("compiler") { } # Linker warnings. - if (fatal_linker_warnings && !is_apple && current_os != "aix") { + if (fatal_linker_warnings && !is_apple && !is_bsd && current_os != "aix") { ldflags += [ "-Wl,--fatal-warnings" ] } if (fatal_linker_warnings && is_apple && @@ -310,6 +310,7 @@ config("compiler") { if (use_qt && is_clang) { cflags += [ + "-Wno-enum-constexpr-conversion", "-Wno-unknown-attributes", "-Wno-unknown-pragmas", "-Wno-unknown-warning-option" -@@ -407,7 +408,7 @@ config("compiler") { +@@ -408,7 +409,7 @@ config("compiler") { # Compiler instrumentation can introduce dependencies in DSOs to symbols in # the executable they are loaded into, so they are unresolved at link-time. - if (!using_sanitizer) { + if (!using_sanitizer && !is_bsd) { ldflags += [ "-Wl,-z,defs", "-Wl,--as-needed", -@@ -795,7 +796,7 @@ config("compiler_cpu_abi") { +@@ -566,7 +567,7 @@ config("compiler") { + # Override Chromium's default for projects that wish to stay on C++11. + cflags_cc += [ "-std=${standard_prefix}++11" ] + } else { +- cflags_cc += [ "-std=${standard_prefix}++14" ] ++ cflags_cc += [ "-std=${standard_prefix}++17" ] + } + } else if (!is_win && !is_nacl) { + if (target_os == "android") { +@@ -583,7 +584,7 @@ config("compiler") { + if (cxx11_override) { + cflags_cc += [ "-std=c++11" ] + } else { +- cflags_cc += [ "-std=c++14" ] ++ cflags_cc += [ "-std=c++17" ] + } + } + +@@ -796,7 +797,7 @@ config("compiler_cpu_abi") { cflags += [ "-mtune=$arm_tune" ] } } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && !is_bsd) { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] } -@@ -1148,7 +1149,7 @@ config("compiler_deterministic") { +@@ -1149,7 +1150,7 @@ config("compiler_deterministic") { "-Xclang", ".", ] - if (!is_win) { + if (!is_win && !is_bsd) { # We don't use clang -cc1as on Windows (yet? https://crbug.com/762167) asmflags = [ "-Wa,-fdebug-compilation-dir,." ] } -@@ -1550,7 +1551,7 @@ config("default_warnings") { +@@ -1535,6 +1536,10 @@ config("default_warnings") { + # which we no longer use. Check if it makes sense to remove + # this as well. http://crbug.com/316352 + "-Wno-unneeded-internal-declaration", ++ ++ # Reduce build log bloat by about 20MB ++ "-Wno-deprecated-copy", ++ "-Wno-implicit-float-conversion", + ] + + # use_xcode_clang only refers to the iOS toolchain, host binaries use +@@ -1551,7 +1556,7 @@ config("default_warnings") { cflags += [ "-Wno-nonportable-include-path" ] } - if (current_toolchain == host_toolchain || !use_xcode_clang) { + if ((current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) { # Flags NaCl (Clang 3.7) and Xcode 9.2 (Clang clang-900.0.39.2) do not # recognize. cflags += [ -@@ -1724,7 +1725,7 @@ config("no_chromium_code") { +@@ -1725,7 +1730,7 @@ config("no_chromium_code") { # suppressing them individually, we just blanket suppress them here. "-Wno-unused-variable", ] - if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang)) { + if (!is_nacl && (current_toolchain == host_toolchain || !use_xcode_clang) && !is_bsd) { cflags += [ # TODO(https://crbug.com/1031169): Clean up and enable. "-Wno-misleading-indentation", -@@ -1802,7 +1803,7 @@ config("thin_archive") { +@@ -1803,7 +1808,7 @@ config("thin_archive") { # Mac and iOS use the mac-specific "libtool" command, not ar, which doesn't # have a "thin archive" mode (it does accept -T, but it means truncating # archive names to 16 characters, which is not what we want). - if ((is_posix && !is_nacl && !is_apple) || is_fuchsia) { + if ((is_posix && !is_nacl && !is_apple && !is_bsd) || is_fuchsia) { arflags = [ "-T" ] } else if (is_win && use_lld) { arflags = [ "/llvmlibthin" ] -@@ -2343,7 +2344,7 @@ config("symbols") { +@@ -2344,7 +2349,7 @@ config("symbols") { # flag, so we can use use -g1 for pnacl and nacl-clang compiles. # gcc nacl is is_nacl && !is_clang, pnacl and nacl-clang are && is_clang. if (!is_nacl || is_clang) { - cflags += [ "-g2" ] + cflags += [ "-g0" ] } # TODO(https://crbug.com/1050118): Investigate missing debug info on mac. -@@ -2385,7 +2386,7 @@ config("symbols") { +@@ -2386,7 +2391,7 @@ config("symbols") { # DWARF info may be corrupt; offsets in a range list entry are in different # sections" there. Maybe just a bug in nacl_switch_32.S. if (!is_apple && !is_nacl && current_cpu != "x86" && - (use_gold || use_lld)) { + (use_gold || use_lld) && !is_bsd) { if (is_clang) { # This flag enables the GNU-format pubnames and pubtypes sections, # which lld needs in order to generate a correct GDB index. diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_program__manager.cc b/www/qt5-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_program__manager.cc index e98c15fa4ea7..9c43b706b170 100644 --- a/www/qt5-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_program__manager.cc +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_gpu_command__buffer_service_program__manager.cc @@ -1,14 +1,23 @@ ---- src/3rdparty/chromium/gpu/command_buffer/service/program_manager.cc.orig 2021-12-15 16:12:54 UTC +--- src/3rdparty/chromium/gpu/command_buffer/service/program_manager.cc.orig 2023-11-09 11:32:20 UTC +++ src/3rdparty/chromium/gpu/command_buffer/service/program_manager.cc @@ -30,7 +30,11 @@ #include "gpu/command_buffer/service/program_cache.h" #include "gpu/command_buffer/service/shader_manager.h" #include "gpu/config/gpu_preferences.h" +#if defined(OS_BSD) +#include +#else #include "third_party/re2/src/re2/re2.h" +#endif #include "ui/gl/gl_version_info.h" #include "ui/gl/progress_reporter.h" +@@ -620,7 +624,7 @@ std::string Program::ProcessLogInfo(const std::string& + output += hashed_name; + } + +- return output + input.as_string(); ++ return output + std::string(input); + } + + void Program::UpdateLogInfo() { diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_page_scrolling_text__fragment__selector__generator.cc b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_page_scrolling_text__fragment__selector__generator.cc new file mode 100644 index 000000000000..184a0ca18fe0 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_blink_renderer_core_page_scrolling_text__fragment__selector__generator.cc @@ -0,0 +1,10 @@ +--- src/3rdparty/chromium/third_party/blink/renderer/core/page/scrolling/text_fragment_selector_generator.cc.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/third_party/blink/renderer/core/page/scrolling/text_fragment_selector_generator.cc +@@ -6,6 +6,7 @@ + + #include "base/metrics/histogram_macros.h" + #include "base/time/default_tick_clock.h" ++#include "third_party/abseil-cpp/absl/base/macros.h" + #include "third_party/blink/public/common/browser_interface_broker_proxy.h" + #include "third_party/blink/public/platform/interface_registry.h" + #include "third_party/blink/renderer/core/editing/ephemeral_range.h" diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_cjs__publicmethods.cpp b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_cjs__publicmethods.cpp index 66e832a6f2d0..46b78eb4bf79 100644 --- a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_cjs__publicmethods.cpp +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_fxjs_cjs__publicmethods.cpp @@ -1,106 +1,106 @@ --- src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp.orig 2021-12-15 16:12:54 UTC +++ src/3rdparty/chromium/third_party/pdfium/fxjs/cjs_publicmethods.cpp @@ -87,6 +87,103 @@ constexpr const wchar_t* kTimeFormats[] = {L"HH:MM", L constexpr const wchar_t* kTimeFormats[] = {L"HH:MM", L"h:MM tt", L"HH:MM:ss", L"h:MM:ss tt"}; +#if defined(__FreeBSD__) +/* + * cvt.c - IEEE floating point formatting routines for FreeBSD + * from GNU libc-4.6.27 + */ + +/* + * ap_ecvt converts to decimal + * the number of digits is specified by ndigit + * decpt is set to the position of the decimal point + * sign is set to 0 for positive, 1 for negative + */ + +#define NDIG 80 + +static char * + ap_cvt(double arg, int ndigits, int *decpt, int *sign, int eflag) +{ -+ register int r2; ++ int r2; + double fi, fj; -+ register char *p, *p1; ++ char *p, *p1; + static char buf[NDIG]; + + if (ndigits >= NDIG - 1) + ndigits = NDIG - 2; + r2 = 0; + *sign = 0; + p = &buf[0]; + if (arg < 0) { + *sign = 1; + arg = -arg; + } + arg = modf(arg, &fi); + p1 = &buf[NDIG]; + /* + * Do integer part + */ + if (fi != 0) { + p1 = &buf[NDIG]; + while (fi != 0) { + fj = modf(fi / 10, &fi); + *--p1 = (int) ((fj + .03) * 10) + '0'; + r2++; + } + while (p1 < &buf[NDIG]) + *p++ = *p1++; + } + else if (arg > 0) { + while ((fj = arg * 10) < 1) { + arg = fj; + r2--; + } + } + p1 = &buf[ndigits]; + if (eflag == 0) + p1 += r2; + *decpt = r2; + if (p1 < &buf[0]) { + buf[0] = '\0'; + return (buf); + } + while (p <= p1 && p < &buf[NDIG]) { + arg *= 10; + arg = modf(arg, &fj); + *p++ = (int) fj + '0'; + } + if (p1 >= &buf[NDIG]) { + buf[NDIG - 1] = '\0'; + return (buf); + } + p = p1; + *p1 += 5; + while (*p1 > '9') { + *p1 = '0'; + if (p1 > buf) + ++ * --p1; + else { + *p1 = '1'; + (*decpt)++; + if (eflag == 0) { + if (p > buf) + *p = '0'; + p++; + } + } + } + *p = '\0'; + return (buf); +} + +static char * + fcvt(double arg, int ndigits, int *decpt, int *sign) +{ + return (ap_cvt(arg, ndigits, decpt, sign, 0)); +} +#endif // defined(__FreeBSD__) + template T StrTrim(const T& str) { T result = str; diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_third__party_base_template__util.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_third__party_base_template__util.h new file mode 100644 index 000000000000..c8599fe5c416 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_pdfium_third__party_base_template__util.h @@ -0,0 +1,27 @@ +--- src/3rdparty/chromium/third_party/pdfium/third_party/base/template_util.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/third_party/pdfium/third_party/base/template_util.h +@@ -109,24 +109,8 @@ struct is_iterator +-struct is_trivially_copyable { +-// TODO(danakj): Remove this when android builders are all using a newer version +-// of gcc, or the android ndk is updated to a newer libc++ that does this for +-// us. +-#if _GNUC_VER >= 501 +- static constexpr bool value = __is_trivially_copyable(T); +-#else +- static constexpr bool value = +- __has_trivial_copy(T) && __has_trivial_destructor(T); +-#endif +-}; +-#else + template + using is_trivially_copyable = std::is_trivially_copyable; +-#endif + + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7 + // Workaround for g++7 and earlier family. diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_circular__queue.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_circular__queue.h index 227cbf7dfcfd..c645504dcfae 100644 --- a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_circular__queue.h +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_circular__queue.h @@ -1,35 +1,25 @@ ---- src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h.orig 2023-07-14 13:25:01 UTC +--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h.orig 2023-11-09 11:32:20 UTC +++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/circular_queue.h -@@ -67,25 +67,21 @@ class CircularQueue { +@@ -67,6 +67,11 @@ class CircularQueue { ignore_result(generation); } -- T* operator->() { + Iterator(const Iterator&) noexcept = default; + Iterator& operator=(const Iterator&) noexcept = default; + Iterator(Iterator&&) noexcept = default; + Iterator& operator=(Iterator&&) noexcept = default; + -+ T* operator->() const { + T* operator->() const { #if PERFETTO_DCHECK_IS_ON() PERFETTO_DCHECK(generation_ == queue_->generation()); - #endif - return queue_->Get(pos_); - } - -- const T* operator->() const { -- return const_cast::Iterator*>(this)->operator->(); -- } -+ T& operator*() const { return *(operator->()); } +@@ -77,10 +82,6 @@ class CircularQueue { + T& operator*() const { return *(operator->()); } -- T& operator*() { return *(operator->()); } -- const T& operator*() const { return *(operator->()); } -- value_type& operator[](difference_type i) { return *(*this + i); } - - const value_type& operator[](difference_type i) const { - return const_cast::Iterator&>(*this)[i]; - } Iterator& operator++() { Add(1); diff --git a/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_subprocess.h b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_subprocess.h new file mode 100644 index 000000000000..238db0ee477e --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_chromium_third__party_perfetto_include_perfetto_ext_base_subprocess.h @@ -0,0 +1,11 @@ +--- src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/subprocess.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/chromium/third_party/perfetto/include/perfetto/ext/base/subprocess.h +@@ -173,7 +173,7 @@ class Subprocess { + }; + + explicit Subprocess(std::initializer_list exec_cmd = {}); +- Subprocess(Subprocess&&); ++ Subprocess(Subprocess&&) noexcept; + Subprocess& operator=(Subprocess&&); + ~Subprocess(); // It will KillAndWaitForTermination() if still alive. + diff --git a/www/qt5-webengine/files/patch-src_3rdparty_gn_base_template__util.h b/www/qt5-webengine/files/patch-src_3rdparty_gn_base_template__util.h new file mode 100644 index 000000000000..753ada758331 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_3rdparty_gn_base_template__util.h @@ -0,0 +1,27 @@ +--- src/3rdparty/gn/base/template_util.h.orig 2023-11-09 11:32:20 UTC ++++ src/3rdparty/gn/base/template_util.h +@@ -112,24 +112,8 @@ struct is_iterator +-struct is_trivially_copyable { +-// TODO(danakj): Remove this when android builders are all using a newer version +-// of gcc, or the android ndk is updated to a newer libc++ that does this for +-// us. +-#if _GNUC_VER >= 501 +- static constexpr bool value = __is_trivially_copyable(T); +-#else +- static constexpr bool value = +- __has_trivial_copy(T) && __has_trivial_destructor(T); +-#endif +-}; +-#else + template + using is_trivially_copyable = std::is_trivially_copyable; +-#endif + + #if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7 + // Workaround for g++7 and earlier family. diff --git a/www/qt5-webengine/files/patch-src_buildtools_config_support.pri b/www/qt5-webengine/files/patch-src_buildtools_config_support.pri index a0692c4788d5..a09e6b92f707 100644 --- a/www/qt5-webengine/files/patch-src_buildtools_config_support.pri +++ b/www/qt5-webengine/files/patch-src_buildtools_config_support.pri @@ -1,51 +1,81 @@ ---- src/buildtools/config/support.pri.orig 2020-11-07 01:22:36 UTC +* Rename Python2 functions to generic Python ones [1] +* Add support for FreeBSD + +[1] Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-python3.patch?ref_type=heads + +--- src/buildtools/config/support.pri.orig 2023-07-20 09:52:10 UTC +++ src/buildtools/config/support.pri -@@ -5,7 +5,7 @@ defineTest(qtwebengine_skipBuild) { +@@ -5,7 +5,7 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { # this should match webengine-core-support defineReplace(qtwebengine_checkWebEngineCoreError) { - !linux:!win32:!macos { + !linux:!win32:!macos:!unix { qtwebengine_skipBuild("QtWebEngine can be built only on Linux, Windows or macOS.") return(false) } -@@ -23,14 +23,14 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { +@@ -21,17 +21,17 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { + !qtwebengine_checkForGperf(QtWebEngine):return(false) + !qtwebengine_checkForBison(QtWebEngine):return(false) !qtwebengine_checkForFlex(QtWebEngine):return(false) - !qtwebengine_checkForPython2(QtWebengine):return(false) +- !qtwebengine_checkForPython2(QtWebEngine):return(false) ++ !qtwebengine_checkForPython(QtWebEngine):return(false) + !qtwebengine_checkForNodejs(QtWebEngine):return(false) !qtwebengine_checkForSanitizer(QtWebEngine):return(false) - linux:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false) - linux:!qtwebengine_checkForHostPkgCfg(QtWebEngine):return(false) + unix:!qtwebengine_checkForPkgCfg(QtWebEngine):return(false) + unix:!qtwebengine_checkForHostPkgCfg(QtWebEngine):return(false) linux:!qtwebengine_checkForGlibc(QtWebEngine):return(false) - linux:!qtwebengine_checkForKhronos(QtWebEngine):return(false) - linux:!qtwebengine_checkForPackage(QtWebEngine,nss):return(false) - linux:!qtwebengine_checkForPackage(QtWebEngine,dbus):return(false) - linux:!qtwebengine_checkForPackage(QtWebEngine,fontconfig):return(false) - linux:!qtwebengine_checkForQpaXcb(QtWebEngine):return(false) + unix:!qtwebengine_checkForKhronos(QtWebEngine):return(false) + unix:!qtwebengine_checkForPackage(QtWebEngine,nss):return(false) + unix:!qtwebengine_checkForPackage(QtWebEngine,dbus):return(false) + unix:!qtwebengine_checkForPackage(QtWebEngine,fontconfig):return(false) + unix:!qtwebengine_checkForQpaXcb(QtWebEngine):return(false) win32:!qtwebengine_checkForCompiler64(QtWebEngine):return(false) win32:!qtwebengine_checkForWinVersion(QtWebEngine):return(false) return(true) -@@ -38,7 +38,7 @@ defineReplace(qtwebengine_checkWebEngineCoreError) { +@@ -39,7 +39,7 @@ defineReplace(qtwebengine_checkPdfError) { # this shuold match webengine-qtpdf-support defineReplace(qtwebengine_checkPdfError) { - !linux:!win32:!macos:!ios { + !linux:!win32:!macos:!ios:!unix { qtwebengine_skipBuild("QtPdf can be built only on Linux, Windows, macOS or iOS.") return(false) } -@@ -54,6 +54,8 @@ defineReplace(qtwebengine_checkPdfError) { +@@ -51,10 +51,12 @@ defineReplace(qtwebengine_checkPdfError) { + !qtwebengine_checkForGperf(QtPdf):return(false) + !qtwebengine_checkForBison(QtPdf):return(false) + !qtwebengine_checkForFlex(QtPdf):return(false) +- !qtwebengine_checkForPython2(QtPdf):return(false) ++ !qtwebengine_checkForPython(QtPdf):return(false) !qtwebengine_checkForSanitizer(QtPdf):return(false) linux:!qtwebengine_checkForPkgCfg(QtPdf):return(false) linux:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false) + unix:!qtwebengine_checkForPkgCfg(QtPdf):return(false) + unix:!qtwebengine_checkForHostPkgCfg(QtPdf):return(false) win32:!qtwebengine_checkForWinVersion(QtPdf):return(false) return(true) } +@@ -143,10 +145,10 @@ defineTest(qtwebengine_checkForFlex) { + return(true) + } + +-defineTest(qtwebengine_checkForPython2) { ++defineTest(qtwebengine_checkForPython) { + module = $$1 +- !qtConfig(webengine-python2) { +- qtwebengine_skipBuild("Python version 2 (2.7.5 or later) is required to build $${module}.") ++ !qtConfig(webengine-python) { ++ qtwebengine_skipBuild("Python is required to build $${module}.") + return(false) + } + return(true) diff --git a/www/qt5-webengine/files/patch-src_buildtools_configure.json b/www/qt5-webengine/files/patch-src_buildtools_configure.json index 0c30b9f7d87b..bc68f912b9b5 100644 --- a/www/qt5-webengine/files/patch-src_buildtools_configure.json +++ b/www/qt5-webengine/files/patch-src_buildtools_configure.json @@ -1,52 +1,106 @@ ---- src/buildtools/configure.json.orig 2020-11-07 01:22:36 UTC +* Rename Python2 functions to generic Python ones [1] +* Add support for FreeBSD + +[1] Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-python3.patch?ref_type=heads + +--- src/buildtools/configure.json.orig 2023-11-09 12:28:27 UTC +++ src/buildtools/configure.json -@@ -362,7 +362,7 @@ +@@ -147,7 +147,8 @@ + "int id = 0;", + "fre2.Add(s, {}, &id);", + "const RE2 &re2 = fre2.GetRE2(id);" +- ] ++ ], ++ "qmake" : "CONFIG += c++1z" + }, + "headers": "re2/filtered_re2.h", + "sources": [ +@@ -316,9 +317,9 @@ + "label": "system ninja", + "type": "detectNinja" + }, +- "webengine-python2": { +- "label": "python2", +- "type": "detectPython2", ++ "webengine-python": { ++ "label": "python", ++ "type": "detectPython", + "log": "location" + }, + "webengine-winversion": { +@@ -385,7 +386,7 @@ "features": { "webengine-core-support": { "label": "Support Qt WebEngine Core", - "condition": "(config.linux || config.win32 || config.macos) + "condition": "(config.unix || config.win32 || config.macos) && !config.static && module.gui && features.webengine-submodule -@@ -374,21 +374,21 @@ +@@ -395,24 +396,24 @@ + && features.webengine-gperf + && features.webengine-bison && features.webengine-flex - && features.webengine-python2 +- && features.webengine-python2 ++ && features.webengine-python + && features.webengine-nodejs && (!config.sanitizer || features.webengine-sanitizer) - && (!config.linux || features.pkg-config) - && (!config.linux || features.webengine-host-pkg-config) + && (!config.unix || features.pkg-config) + && (!config.unix || features.webengine-host-pkg-config) && (!config.linux || features.webengine-system-glibc) - && (!config.linux || features.webengine-system-khr) - && (!config.linux || features.webengine-system-nss) - && (!config.linux || features.webengine-system-dbus) - && (!config.linux || features.webengine-system-fontconfig) - && (!config.linux || !features.pkg-config || !features.xcb || features.webengine-ozone-x11) + && (!config.unix || features.webengine-system-khr) + && (!config.unix || features.webengine-system-nss) + && (!config.unix || features.webengine-system-dbus) + && (!config.unix || features.webengine-system-fontconfig) + && (!config.unix || !features.pkg-config || !features.xcb || features.webengine-ozone-x11) && (!config.win32 || features.webengine-win-compiler64) && (!config.win32 || features.webengine-winversion)", "output": [ "privateFeature" ] }, "webengine-qtpdf-support": { "label": "Support Qt Pdf", - "condition": "(config.linux || config.win32 || config.macos || config.ios) + "condition": "(config.unix || config.win32 || config.macos || config.ios) && module.gui && features.webengine-submodule && features.webengine-nowhitespace -@@ -399,8 +399,8 @@ +@@ -421,10 +422,10 @@ + && features.webengine-gperf + && features.webengine-bison && features.webengine-flex - && features.webengine-python2 +- && features.webengine-python2 ++ && features.webengine-python && (!config.sanitizer || features.webengine-sanitizer) - && (!config.linux || features.pkg-config) - && (!config.linux || features.webengine-host-pkg-config) + && (!config.unix || features.pkg-config) + && (!config.unix || features.webengine-host-pkg-config) && (!config.win32 || features.webengine-winversion)", "output": [ "privateFeature" ] }, +@@ -444,12 +445,12 @@ + "autoDetect": "features.private_tests", + "output": [ "privateFeature" ] + }, +- "webengine-python2": { +- "label": "python2", +- "condition": "tests.webengine-python2", ++ "webengine-python": { ++ "label": "python", ++ "condition": "tests.webengine-python", + "output": [ + "privateFeature", +- { "type": "varAssign", "name": "QMAKE_PYTHON2", "value": "tests.webengine-python2.location" } ++ { "type": "varAssign", "name": "QMAKE_PYTHON", "value": "tests.webengine-python.location" } + ] + }, + "webengine-gperf": { diff --git a/www/qt5-webengine/files/patch-src_core_config_linux.pri b/www/qt5-webengine/files/patch-src_core_config_linux.pri index c867587be127..90ee745d363a 100644 --- a/www/qt5-webengine/files/patch-src_core_config_linux.pri +++ b/www/qt5-webengine/files/patch-src_core_config_linux.pri @@ -1,23 +1,15 @@ --- src/core/config/linux.pri.orig 2021-12-15 16:12:54 UTC +++ src/core/config/linux.pri @@ -20,6 +20,12 @@ qtConfig(webengine-embedded-build) { gn_args += use_alsa=false } + qtConfig(webengine-sndio) { + gn_args += use_sndio=true + } else { + gn_args += use_sndio=false + } + !packagesExist(libpci): gn_args += use_libpci=false qtConfig(webengine-ozone-x11) { -@@ -39,6 +45,6 @@ qtConfig(webengine-embedded-build) { - qtConfig(webengine-system-libvpx): gn_args += use_system_libvpx=true - qtConfig(webengine-system-icu): gn_args += use_system_icu=true icu_use_data_file=false - qtConfig(webengine-system-ffmpeg): gn_args += use_system_ffmpeg=true -- qtConfig(webengine-system-re2): gn_args += use_system_re2=true -+ qtConfig(webengine-system-re2): gn_args += use_system_re2=false - qtConfig(webengine-system-lcms2): gn_args += use_system_lcms2=true - } diff --git a/www/qt5-webengine/files/patch-src_core_core__common.pri b/www/qt5-webengine/files/patch-src_core_core__common.pri new file mode 100644 index 000000000000..6bcb17838d36 --- /dev/null +++ b/www/qt5-webengine/files/patch-src_core_core__common.pri @@ -0,0 +1,11 @@ +--- src/core/core_common.pri.orig 2023-11-09 12:28:27 UTC ++++ src/core/core_common.pri +@@ -15,6 +15,6 @@ CONFIG -= ltcg + # LTO does not work for Chromium at the moment, so disable it completely for core. + CONFIG -= ltcg + +-# Chromium requires C++14 +-CONFIG += c++14 ++# Chromium requires C++17 ++CONFIG += c++1z + diff --git a/www/qt5-webengine/files/patch-src_core_qtwebengine__resources.gni b/www/qt5-webengine/files/patch-src_core_qtwebengine__resources.gni new file mode 100644 index 000000000000..3eb1f813df8c --- /dev/null +++ b/www/qt5-webengine/files/patch-src_core_qtwebengine__resources.gni @@ -0,0 +1,24 @@ +Remove dependency on catapult / Python2 + +Obtained from: + +https://gitlab.archlinux.org/archlinux/packaging/packages/qt5-webengine/-/raw/main/qt5-webengine-python3.patch?ref_type=heads + +--- src/core/qtwebengine_resources.gni.orig 2023-11-12 10:53:24 UTC ++++ src/core/qtwebengine_resources.gni +@@ -27,7 +27,6 @@ repack("qtwebengine_repack_resources") { + "$root_gen_dir/components/components_resources.pak", + "$root_gen_dir/components/dev_ui_components_resources.pak", + "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak", +- "$root_gen_dir/content/browser/tracing/tracing_resources.pak", + "$root_gen_dir/content/content_resources.pak", + "$root_gen_dir/content/dev_ui_content_resources.pak", + "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak", +@@ -44,7 +43,6 @@ repack("qtwebengine_repack_resources") { + "//components/resources:components_resources_grit", + "//components/resources:dev_ui_components_resources_grit", + "//content/browser/resources/media:media_internals_resources", +- "//content/browser/tracing:resources", + "//content:content_resources_grit", + "//content:dev_ui_content_resources_grit", + "//mojo/public/js:resources", diff --git a/www/qt5-webengine/files/patch-src_tools_qwebengine__convert__dict_qwebengine__convert__dict.pro b/www/qt5-webengine/files/patch-src_tools_qwebengine__convert__dict_qwebengine__convert__dict.pro new file mode 100644 index 000000000000..8b907a6feafc --- /dev/null +++ b/www/qt5-webengine/files/patch-src_tools_qwebengine__convert__dict_qwebengine__convert__dict.pro @@ -0,0 +1,11 @@ +--- src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro.orig 2023-11-09 12:28:27 UTC ++++ src/tools/qwebengine_convert_dict/qwebengine_convert_dict.pro +@@ -43,7 +43,7 @@ QMAKE_TARGET_DESCRIPTION = "Qt WebEngine Dictionary Co + + QMAKE_TARGET_DESCRIPTION = "Qt WebEngine Dictionary Converter" + +-CONFIG += c++14 ++CONFIG += c++1z + + # Support converting dictionaries in a prefix build, by supplying + # the path to the ICU data file located in the Qt build path, rather