From d3b70c2e97d88d36a50651c4f5af4b22e9d93e3d Mon Sep 17 00:00:00 2001 From: Funda Wang Date: Mon, 12 May 2025 00:26:04 +0800 Subject: [PATCH] fix build with gperf >= 3.2 --- backport-gperf-3.2.patch | 28 ++++++ qt6-qtwebengine.spec | 135 ++++++++++++++++------------ qtwebengine-6.8.2-glibc2.41.patch | 20 +++++ qtwebengine-6.8.3-pipewire1.4.patch | 19 ++++ 4 files changed, 144 insertions(+), 58 deletions(-) create mode 100644 backport-gperf-3.2.patch create mode 100644 qtwebengine-6.8.2-glibc2.41.patch create mode 100644 qtwebengine-6.8.3-pipewire1.4.patch diff --git a/backport-gperf-3.2.patch b/backport-gperf-3.2.patch new file mode 100644 index 0000000..46707bd --- /dev/null +++ b/backport-gperf-3.2.patch @@ -0,0 +1,28 @@ +From https://chromium-review.googlesource.com/c/chromium/src/+/6445471 + +Don't apply /*FALLTHROUGH*/ edit to gperf 3.2 output + +The gperf issue at https://savannah.gnu.org/bugs/index.php?53029 +has been resolved as of the 3.2 release, and not only is the +/*FALLTHROUGH*/ comment replacement no longer needed, it now +breaks the build with "error: fallthrough annotation does not +directly precede switch label". Only do the edit for 3.1. + +--- a/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py ++++ b/src/3rdparty/chromium/third_party/blink/renderer/build/scripts/gperf.py +@@ -35,10 +35,11 @@ def generate_gperf(gperf_path, gperf_input, gperf_args): + # https://savannah.gnu.org/bugs/index.php?53028 + gperf_output = re.sub(r'\bregister ', '', gperf_output) + # -Wimplicit-fallthrough needs an explicit fallthrough statement, +- # so replace gperf's /*FALLTHROUGH*/ comment with the statement. +- # https://savannah.gnu.org/bugs/index.php?53029 +- gperf_output = gperf_output.replace('/*FALLTHROUGH*/', +- ' [[fallthrough]];') ++ # so replace gperf 3.1's /*FALLTHROUGH*/ comment with the statement. ++ # https://savannah.gnu.org/bugs/index.php?53029 (fixed in 3.2) ++ if '/* C++ code produced by gperf version 3.1 */' in gperf_output: ++ gperf_output = gperf_output.replace('/*FALLTHROUGH*/', ++ ' [[fallthrough]];') + # -Wpointer-to-int-cast warns about casting pointers to smaller ints + # Replace {(int)(long)&(foo), bar} with + # {static_cast(reinterpret_cast(&(foo)), bar} diff --git a/qt6-qtwebengine.spec b/qt6-qtwebengine.spec index f211b60..670af1f 100644 --- a/qt6-qtwebengine.spec +++ b/qt6-qtwebengine.spec @@ -10,12 +10,6 @@ # package-notes causes FTBFS (#2043178) %undefine _package_note_flags -%global use_system_libwebp 1 -%global use_system_jsoncpp 1 -%global use_system_re2 0 - -%global use_system_libicu 1 - %global use_system_py_six 1 # NEON support on ARM (detected at runtime) - disable this if you are hitting # FTBFS due to e.g. GCC bug https://bugzilla.redhat.com/show_bug.cgi?id=1282495 @@ -44,7 +38,7 @@ Summary: Qt6 - QtWebEngine components Name: qt6-qtwebengine Version: 6.9.0 -Release: 1 +Release: 2 # See LICENSE.GPL LICENSE.LGPL LGPL_EXCEPTION.txt, for details # See also http://qt-project.org/doc/qt-5.0/qtdoc/licensing.html @@ -69,6 +63,12 @@ Patch1: qtwebengine-SIOCGSTAMP.patch Patch2: qtwebengine-link-pipewire.patch # Fix/workaround FTBFS on aarch64 with newer glibc Patch3: qtwebengine-aarch64-new-stat.patch +# From https://chromium-review.googlesource.com/c/chromium/src/+/6445471 +Patch4: backport-gperf-3.2.patch +# https://bugreports.qt.io/browse/QTBUG-134631 +Patch5: qtwebengine-6.8.2-glibc2.41.patch +# https://webrtc-review.googlesource.com/c/src/+/380500 +Patch6: qtwebengine-6.8.3-pipewire1.4.patch # FTBS warning: elaborated-type-specifier for a scoped enum must not # use the 'class' keyword @@ -114,48 +114,42 @@ BuildRequires: libstdc++-static BuildRequires: git-core BuildRequires: gperf BuildRequires: krb5-devel -%if 0%{?use_system_libicu} -BuildRequires: libicu-devel >= 68 -%endif +BuildRequires: libicu-devel >= 70 BuildRequires: libjpeg-devel BuildRequires: nodejs -%if 0%{?use_system_re2} -BuildRequires: re2-devel -Requires: re2 -%endif BuildRequires: snappy-devel -BuildConflicts: minizip-devel -Provides: bundled(minizip) = 2.8.1 +BuildRequires: minizip-devel BuildRequires: pkgconfig(alsa) BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(egl) BuildRequires: pkgconfig(epoxy) BuildRequires: pkgconfig(expat) BuildRequires: pkgconfig(fontconfig) -BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(freetype2) >= 2.4.2 BuildRequires: pkgconfig(gbm) BuildRequires: pkgconfig(gio-2.0) BuildRequires: pkgconfig(gl) BuildRequires: pkgconfig(glib-2.0) BuildRequires: pkgconfig(gobject-2.0) -BuildRequires: pkgconfig(harfbuzz) -%if 0%{?use_system_jsoncpp} +BuildRequires: pkgconfig(harfbuzz) >= 4.3.0 BuildRequires: pkgconfig(jsoncpp) -%endif BuildRequires: pkgconfig(lcms2) BuildRequires: pkgconfig(libcap) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libevent) +BuildRequires: pkgconfig(libopenjp2) BuildRequires: pkgconfig(libpci) BuildRequires: pkgconfig(libpipewire-0.3) BuildRequires: pkgconfig(libpng) BuildRequires: pkgconfig(libpulse) +BuildRequires: pkgconfig(libtiff-4) >= 4.2.0 BuildRequires: pkgconfig(libudev) -%if 0%{?use_system_libwebp} +BuildRequires: pkgconfig(libva) BuildRequires: pkgconfig(libwebp) >= 0.6.0 -%endif BuildRequires: pkgconfig(nss) -BuildRequires: pkgconfig(opus) +BuildRequires: pkgconfig(opus) >= 1.3.1 +BuildRequires: pkgconfig(libpci) +BuildRequires: pkgconfig(re2) >= 11.0.0 BuildRequires: pkgconfig(poppler-cpp) BuildRequires: pkgconfig(x11) BuildRequires: pkgconfig(xcomposite) @@ -172,16 +166,14 @@ BuildRequires: pkgconfig(xscrnsaver) BuildRequires: pkgconfig(xshmfence) BuildRequires: pkgconfig(xtst) BuildRequires: pkgconfig(zlib) -## https://bugreports.qt.io/browse/QTBUG-59094 -## requires libxml2 built with icu support -#BuildRequires: pkgconfig(libxslt) pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(libxslt) +BuildRequires: pkgconfig(libxml-2.0) BuildRequires: perl-interpreter BuildRequires: python3-devel BuildRequires: python3-html5lib -BuildRequires: pkgconfig(vpx) >= 1.8.0 -BuildRequires: pkgconfig(libavcodec) -BuildRequires: pkgconfig(libavformat) -BuildRequires: pkgconfig(libavutil) +BuildRequires: pkgconfig(libavcodec) >= 60.31.102 +BuildRequires: pkgconfig(libavformat) >= 60.16.100 +BuildRequires: pkgconfig(libavutil) >= 58.29.100 %if %{with doc} BuildRequires: /usr/bin/qdoc-qt6 %endif @@ -206,7 +198,7 @@ Requires: qt6-qtpdf%{?_isa} = %{version}-%{release} # Of course, Chromium itself is bundled. It cannot be unbundled because it is # not a library, but forked (modified) application code. -Provides: bundled(chromium) = 118.0.5993.220 +Provides: bundled(chromium) = 130.0.6723.192 # Bundled in src/3rdparty/chromium/third_party: # Check src/3rdparty/chromium/third_party/*/README.chromium for version numbers, @@ -244,22 +236,16 @@ Provides: bundled(leveldb) = 1.23 Provides: bundled(libjingle) # see src/3rdparty/chromium/third_party/libsrtp/CHANGES for the version number Provides: bundled(libsrtp) = 2.4.0 -# bundled as "libxml" -# see src/3rdparty/chromium/third_party/libxml/linux/include/libxml/xmlversion.h -Provides: bundled(libxml2) = 2.9.13 -# see src/3rdparty/chromium/third_party/libxslt/linux/config.h for version -Provides: bundled(libxslt) = 1.1.3 -Provides: bundled(libyuv) = 1819 +Provides: bundled(libyuv) = 1896 Provides: bundled(modp_b64) Provides: bundled(ots) -Provides: bundled(re2) # see src/3rdparty/chromium/third_party/protobuf/CHANGES.txt for the version -Provides: bundled(protobuf) = 3.13.0.1 +Provides: bundled(protobuf) = 21.11 Provides: bundled(qcms) = 4 Provides: bundled(skia) # bundled as "smhasher" Provides: bundled(SMHasher) = 0-147 -Provides: bundled(sqlite) = 3.39.4 +Provides: bundled(sqlite) = 3.46.0 Provides: bundled(usrsctp) Provides: bundled(webrtc) = 90 @@ -296,7 +282,7 @@ Provides: bundled(nsURLParsers) # Bundled outside of third_party, apparently not considered as such by Chromium: Provides: bundled(mojo) # see src/3rdparty/chromium/v8/include/v8_version.h for the version number -Provides: bundled(v8) = 11.8.172.18 +Provides: bundled(v8) = 13.0.245.25 # bundled by v8 (src/3rdparty/chromium/v8/src/base/ieee754.cc) # The version number is 5.3, the last version that upstream released, years ago: # http://www.netlib.org/fdlibm/readme @@ -381,12 +367,6 @@ ln -s /usr/lib/python%{python3_version}/site-packages/six.py src/3rdparty/chromi ln -s /usr/lib/python%{python3_version}/site-packages/six.py src/3rdparty/chromium/third_party/wpt_tools/wpt/tools/third_party/six/six.py %endif -%if 0%{?use_system_re2} -# http://bugzilla.redhat.com/1337585 -# can't just delete, but we'll overwrite with system headers to be on the safe side -cp -bv /usr/include/re2/*.h src/3rdparty/chromium/third_party/re2/src/re2/ -%endif - # copy the Chromium license so it is installed with the appropriate name cp -p src/3rdparty/chromium/LICENSE LICENSE.Chromium @@ -410,20 +390,58 @@ export LDFLAGS="%{build_ldflags} -Wl,--no-keep-memory" %cmake_qt6 \ -DCMAKE_TOOLCHAIN_FILE:STRING="%{_libdir}/cmake/Qt6/qt.toolchain.cmake" \ - -DFEATURE_qtpdf_build:BOOL=ON \ + -DFEATURE_webengine_build_gn:BOOL=ON \ + -DFEATURE_webengine_jumbo_build:BOOL=OFF \ -DFEATURE_webengine_developer_build:BOOL=OFF \ + -DFEATURE_qtwebengine_build:BOOL=ON \ + -DFEATURE_qtwebengine_core_build:BOOL=ON \ + -DFEATURE_qtwebengine_widgets_build:BOOL=ON \ + -DFEATURE_qtwebengine_quick_build:BOOL=ON \ + -DFEATURE_qtpdf_build:BOOL=ON \ + -DFEATURE_qtpdf_widgets_build:BOOL=ON \ + -DFEATURE_qtpdf_quick_build:BOOL=ON \ + -DFEATURE_webengine_system_re2:BOOL=ON \ + -DFEATURE_webengine_system_icu:BOOL=ON \ + -DFEATURE_webengine_system_libwebp:BOOL=ON \ + -DFEATURE_webengine_system_opus:BOOL=ON \ + -DFEATURE_webengine_system_ffmpeg:BOOL=ON \ + -DFEATURE_webengine_system_libvpx:BOOL=OFF \ + -DFEATURE_webengine_system_snappy:BOOL=ON \ + -DFEATURE_webengine_system_glib:BOOL=ON \ + -DFEATURE_webengine_system_zlib:BOOL=ON \ + -DFEATURE_webengine_system_minizip:BOOL=ON \ + -DFEATURE_webengine_system_libevent:BOOL=ON \ + -DFEATURE_webengine_system_libxml:BOOL=ON \ + -DFEATURE_webengine_system_lcms2:BOOL=ON \ + -DFEATURE_webengine_system_libpng:BOOL=ON \ + -DFEATURE_webengine_system_libtiff:BOOL=ON \ + -DFEATURE_webengine_system_libjpeg:BOOL=ON \ + -DFEATURE_webengine_system_libopenjpeg2:BOOL=ON \ + -DFEATURE_webengine_system_harfbuzz:BOOL=ON \ + -DFEATURE_webengine_system_freetype:BOOL=ON \ + -DFEATURE_webengine_system_libpci:BOOL=ON \ + -DFEATURE_webengine_system_libudev:BOOL=ON \ -DFEATURE_webengine_embedded_build:BOOL=OFF \ - -DFEATURE_webengine_extensions:BOOL=ON \ - -DFEATURE_webengine_jumbo_build:BOOL=OFF \ - -DFEATURE_webengine_kerberos:BOOL=ON \ - -DFEATURE_webengine_native_spellchecker:BOOL=OFF \ + -DFEATURE_webengine_pepper_plugins:BOOL=ON \ -DFEATURE_webengine_printing_and_pdf:BOOL=ON \ -DFEATURE_webengine_proprietary_codecs:BOOL=ON \ - -DFEATURE_webengine_system_icu:BOOL=%{?use_system_libicu} \ - -DFEATURE_webengine_system_libevent:BOOL=ON \ - -DFEATURE_webengine_system_ffmpeg:BOOL=ON \ + -DFEATURE_webengine_spellchecker:BOOL=ON \ + -DFEATURE_webengine_native_spellchecker:BOOL=OFF \ -DFEATURE_webengine_webrtc:BOOL=ON \ -DFEATURE_webengine_webrtc_pipewire:BOOL=ON \ + -DFEATURE_webengine_geolocation:BOOL=ON \ + -DFEATURE_webengine_webchannel:BOOL=ON \ + -DFEATURE_webengine_kerberos:BOOL=ON \ + -DFEATURE_webengine_extensions:BOOL=ON \ + -DFEATURE_webengine_ozone_x11:BOOL=ON \ + -DFEATURE_webengine_vulkan:BOOL=ON \ + -DFEATURE_webengine_vaapi:BOOL=ON \ + -DFEATURE_webengine_system_alsa:BOOL=ON \ + -DFEATURE_webengine_system_pulseaudio:BOOL=ON \ + -DFEATURE_webengine_system_gbm:BOOL=ON \ + -DFEATURE_webengine_v8_context_snapshot:BOOL=ON \ + -DFEATURE_webenginedriver:BOOL=ON \ + -DFEATURE_pdf_v8:BOOL=ON \ -DQT_BUILD_EXAMPLES:BOOL=%{?examples:ON}%{!?examples:OFF} \ -DQT_INSTALL_EXAMPLES_SOURCES=%{?examples:ON}%{!?examples:OFF} @@ -503,9 +521,6 @@ done %{_qt6_datadir}/resources/qtwebengine_resources.pak %{_qt6_datadir}/resources/qtwebengine_resources_100p.pak %{_qt6_datadir}/resources/qtwebengine_resources_200p.pak -%if ! 0%{?use_system_libicu} -%{_qt6_datadir}/resources/icudtl.dat -%endif %dir %{_qtwebengine_dictionaries_dir} %dir %{_qt6_translationdir}/qtwebengine_locales %lang(am) %{_qt6_translationdir}/qtwebengine_locales/am.pak @@ -655,6 +670,10 @@ done %changelog +* Sun May 11 2025 Funda Wang - 6.9.0-2 +- fix build with gper >= 3.2 +- use more system libs + * Wed Apr 30 2025 Funda Wang - 6.9.0-1 - update to 6.9.0 diff --git a/qtwebengine-6.8.2-glibc2.41.patch b/qtwebengine-6.8.2-glibc2.41.patch new file mode 100644 index 0000000..7fb572c --- /dev/null +++ b/qtwebengine-6.8.2-glibc2.41.patch @@ -0,0 +1,20 @@ +https://bugs.gentoo.org/949654 +https://bugreports.qt.io/browse/QTBUG-134631 +--- a/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc ++++ b/src/3rdparty/chromium/sandbox/linux/seccomp-bpf-helpers/syscall_parameters_restrictions.cc +@@ -36,4 +36,8 @@ + #include "sandbox/linux/system_headers/linux_time.h" + ++#if !defined(MAP_DROPPABLE) ++#define MAP_DROPPABLE 0x08 // Zero memory under memory pressure. ++#endif ++ + #if (BUILDFLAG(IS_LINUX) || BUILDFLAG(IS_CHROMEOS_LACROS)) && \ + !defined(__arm__) && !defined(__aarch64__) && \ +@@ -239,5 +243,5 @@ + const uint64_t kAllowedMask = MAP_SHARED | MAP_PRIVATE | MAP_ANONYMOUS | + MAP_STACK | MAP_NORESERVE | MAP_FIXED | +- MAP_DENYWRITE | MAP_LOCKED | ++ MAP_DENYWRITE | MAP_LOCKED | MAP_DROPPABLE | + kArchSpecificAllowedMask; + const Arg flags(3); diff --git a/qtwebengine-6.8.3-pipewire1.4.patch b/qtwebengine-6.8.3-pipewire1.4.patch new file mode 100644 index 0000000..50ea936 --- /dev/null +++ b/qtwebengine-6.8.3-pipewire1.4.patch @@ -0,0 +1,19 @@ +https://bugs.gentoo.org/951816 +https://issues.webrtc.org/issues/401732633 +https://webrtc-review.googlesource.com/c/src/+/380500 +--- a/src/3rdparty/chromium/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc ++++ b/src/3rdparty/chromium/third_party/webrtc/modules/video_capture/linux/pipewire_session.cc +@@ -61,5 +61,5 @@ + }; + +- pw_node_add_listener(proxy_, &node_listener_, &node_events, this); ++ pw_node_add_listener(reinterpret_cast(proxy_), &node_listener_, &node_events, this); + } + +@@ -95,5 +95,5 @@ + if (id == SPA_PARAM_EnumFormat && + info->params[i].flags & SPA_PARAM_INFO_READ) { +- pw_node_enum_params(that->proxy_, 0, id, 0, UINT32_MAX, nullptr); ++ pw_node_enum_params(reinterpret_cast(that->proxy_), 0, id, 0, UINT32_MAX, nullptr); + break; + } -- Gitee