unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#50014: [core-updates] QtWebKit build failures
@ 2021-08-11 21:14 Leo Famulari
  2021-08-16  9:33 ` Mathieu Othacehe
  0 siblings, 1 reply; 5+ messages in thread
From: Leo Famulari @ 2021-08-11 21:14 UTC (permalink / raw)
  To: 50014

[-- Attachment #1: Type: text/plain, Size: 7511 bytes --]

I noticed that QtWebKit fails to build on core-updates due to
incompatibility with current Python, ICU, glib, and bison.

I worked around those issues by cherry-picking upstream fixes
(attached).

However, the build still fails like this:

------
[ 95%] Linking CXX shared library ../../lib/libQt5WebKit.so
cd /tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build/Source/WebKit && /gnu/store/scy8sv893g08nc8bzjibn5l2828xbhcv-perl-5.34.0/bin/perl /tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/qtwebkit-5.212.0-alpha4/Tools/qt/generate-version-script.pl 5.15.2 > /tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build/QtWebKit.version
cd /tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build/Source/WebKit && /gnu/store/yb80jc3m4azrylgf7x05v7v1ngwddypc-cmake-minimal-3.20.2/bin/cmake -E cmake_link_script CMakeFiles/WebKit.dir/link.txt --verbose=1
/gnu/store/r0y0ll80a350fmfjdpb6m97fk8cm2af1-gcc-10.3.0/bin/c++ -fPIC -fvisibility=hidden -fvisibility-inlines-hidden  -fno-exceptions -fno-strict-aliasing -fno-rtti -std=c++11 -Wno-expansion-to-defined -O2 -g -DNDEBUG -Wl,--version-script,/tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build/QtWebKit.version -Wl,--no-undefined -Wl,--no-keep-memory -shared -Wl,-soname,libQt5WebKit.so.5 -o ../../lib/libQt5WebKit.so.5.212.0 CMakeFiles/WebKit.dir/WebKit_autogen/mocs_compilation.cpp.o CMakeFiles/WebKit.dir/Storage/StorageAreaImpl.cpp.o CMakeFiles/WebKit.dir/Storage/StorageAreaSync.cpp.o CMakeFiles/WebKit.dir/Storage/StorageNamespaceImpl.cpp.o CMakeFiles/WebKit.dir/Storage/StorageSyncManager.cpp.o CMakeFiles/WebKit.dir/Storage/StorageThread.cpp.o CMakeFiles/WebKit.dir/Storage/StorageTracker.cpp.o CMakeFiles/WebKit.dir/Storage/WebDatabaseProvider.cpp.o CMakeFiles/WebKit.dir/Storage/WebStorageNamespaceProvider.cpp.o CMakeFiles/WebKit.dir/WebCoreSupport/WebResourceLoadScheduler.cpp.o CMakeFiles/WebKit.dir/qt/Api/qhttpheader.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebdatabase.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebelement.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebfullscreenrequest.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebhistory.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebhistoryinterface.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebkitglobal.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebplugindatabase.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebpluginfactory.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebscriptworld.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebsecurityorigin.cpp.o CMakeFiles/WebKit.dir/qt/Api/qwebsettings.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/ChromeClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/ContextMenuClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/DragClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/EditorClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/FrameLoaderClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/FrameNetworkingContextQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/HistorySerialization.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/IconDatabaseClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/InitWebCoreQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/InspectorClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/InspectorServerQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/NotificationPresenterClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/PlatformStrategiesQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/PopupMenuQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/ProgressTrackerClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QWebFrameAdapter.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QWebFrameData.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QWebPageAdapter.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QtPlatformPlugin.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QtPluginWidgetAdapter.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/QtPrintContext.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/SearchPopupMenuQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/TextCheckerClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/TextureMapperLayerClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/UndoStepQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/VisitedLinkStoreQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/WebDatabaseProviderQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/WebEventConversion.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginDatabase.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginDebug.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginPackage.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginStream.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginView.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/GeolocationClientQt.cpp.o CMakeFiles/WebKit.dir/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp.o CMakeFiles/WebKit.dir/win/Plugins/PluginMainThreadScheduler.cpp.o CMakeFiles/WebKit.dir/win/Plugins/npapi.cpp.o CMakeFiles/WebKit.dir/qt/Plugins/PluginPackageQt.cpp.o CMakeFiles/WebKit.dir/qt/Plugins/PluginViewQt.cpp.o CMakeFiles/WebKit.dir/qrc_WebCore.cpp.o CMakeFiles/WebKit.dir/__/__/DerivedSources/WebInspectorUI/qrc_WebInspector.cpp.o  -Wl,-rpath,::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: ../../lib/libJavaScriptCore.a ../../lib/libWTF.a ../../lib/libWebCore.a -Wl,--whole-archive ../../lib/libWebKit2.a -Wl,--no-whole-archive /gnu/store/4j482s029id8anl9874vb7sg43mkb07l-qtdeclarative-5.15.2/lib/libQt5Quick.so.5.15.2 /gnu/store/78fd1ih49ii0mqwwcwk7spnp861lwcjq-qtwebchannel-5.15.2/lib/libQt5WebChannel.so.5.15.2 -licuuc /gnu/store/krd24np1a86kbawwhziy0bvix3if47i0-qtlocation-5.15.2/lib/libQt5Positioning.so.5.15.2 -lX11 -lXcomposite -lXrender ../../lib/libWebCore.a ../../lib/libJavaScriptCore.a ../../lib/libWTF.a -ldl -licui18n -lpthread ../../lib/libwoff2.a ../../lib/libbrotli.a /gnu/store/3s2rag4kzry92pbwpidcwrkvdzr6r1f5-qtsensors-5.15.2/lib/libQt5Sensors.so.5.15.2 -ljpeg -lpng -lz -lwebp -lxml2 -lxslt -lsqlite3 -lgio-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgstpbutils-1.0 -lgstaudio-1.0 -lgsttag-1.0 -lgstvideo-1.0 -lgstfft-1.0 -ljpeg -lpng -lz -lwebp -lxml2 -lxslt -lsqlite3 -lgio-2.0 -lgstapp-1.0 -lgstbase-1.0 -lgstreamer-1.0 -lgstpbutils-1.0 -lgstaudio-1.0 -lgsttag-1.0 -lgstvideo-1.0 -lgstfft-1.0 -licuuc -lgobject-2.0 -lglib-2.0 ../../lib/libANGLESupport.a /gnu/store/p3lvckrn3ypc314s03hnckyx0szrl71s-qtbase-5.15.2/lib/libQt5Gui.so.5.15.2 /gnu/store/4j482s029id8anl9874vb7sg43mkb07l-qtdeclarative-5.15.2/lib/libQt5QmlModels.so.5.15.2 /gnu/store/4j482s029id8anl9874vb7sg43mkb07l-qtdeclarative-5.15.2/lib/libQt5Qml.so.5.15.2 /gnu/store/p3lvckrn3ypc314s03hnckyx0szrl71s-qtbase-5.15.2/lib/libQt5Network.so.5.15.2 /gnu/store/p3lvckrn3ypc314s03hnckyx0szrl71s-qtbase-5.15.2/lib/libQt5Core.so.5.15.2 -lrt -lX11
ld: ../../lib/libWebCore.a: error adding symbols: malformed archive
collect2: error: ld returned 1 exit status
make[2]: *** [Source/WebKit/CMakeFiles/WebKit.dir/build.make:2030: lib/libQt5WebKit.so.5.212.0] Error 1
make[2]: Leaving directory '/tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build'
make[1]: *** [CMakeFiles/Makefile2:1612: Source/WebKit/CMakeFiles/WebKit.dir/all] Error 2
make[1]: Leaving directory '/tmp/guix-build-qtwebkit-5.212.0-alpha4.drv-0/build'
make: *** [Makefile:169: all] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: () exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 17292.3 seconds
command "make" failed with status 2
builder for `/gnu/store/imqay9l31ma0vrn24gb38qggiv15qp1g-qtwebkit-5.212.0-alpha4.drv' failed with exit code 1
------

Any ideas?

[-- Attachment #2: qtwebkit.patch --]
[-- Type: text/plain, Size: 20098 bytes --]

From 84c78938898c35477f36cf240829727dbe660248 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Tue, 10 Aug 2021 15:23:53 -0400
Subject: [PATCH 1/4] gnu: QtWebKit: Fix building with Python 3.9.

* gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/qt.scm (qtwebkit)[source]: Use it.
---
 gnu/local.mk                                  |  1 +
 ...twebkit-fix-building-with-python-3.9.patch | 35 +++++++++++++++++++
 gnu/packages/qt.scm                           |  3 +-
 3 files changed, 38 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 35769c6e15..ae0e9f73da 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1645,6 +1645,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/quassel-qt-514-compat.patch		\
   %D%/packages/patches/quickswitch-fix-dmenu-check.patch	\
   %D%/packages/patches/qtwebkit-pbutils-include.patch		\
+  %D%/packages/patches/qtwebkit-fix-building-with-python-3.9.patch	\
   %D%/packages/patches/randomjungle-disable-static-build.patch	\
   %D%/packages/patches/rapicorn-isnan.patch			\
   %D%/packages/patches/rapidjson-gcc-compat.patch		\
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
new file mode 100644
index 0000000000..9f9674de33
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-python-3.9.patch
@@ -0,0 +1,35 @@
+Fix building with Python 3.9:
+
+https://github.com/qtwebkit/qtwebkit/issues/993
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/78360c01c796b6260bf828bc9c8a0ef73c5132fd
+
+From 78360c01c796b6260bf828bc9c8a0ef73c5132fd Mon Sep 17 00:00:00 2001
+From: Konstantin Tokarev <annulen@yandex.ru>
+Date: Wed, 3 Jun 2020 15:01:42 +0300
+Subject: [PATCH] Fix compilation with Python 3.9: avoid passing encoding to
+ json.load()
+
+In Python 2.7 UTF-8 is assumed by default, while in Python 3 this argument
+is not supported.
+
+Change-Id: Ic459d60a6b20bc1838d8771bc36ac41614fe61a9
+---
+ Source/JavaScriptCore/generate-bytecode-files | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Source/JavaScriptCore/generate-bytecode-files b/Source/JavaScriptCore/generate-bytecode-files
+index c5dab429c7b0f..af3431275ecf9 100644
+--- a/Source/JavaScriptCore/generate-bytecode-files
++++ b/Source/JavaScriptCore/generate-bytecode-files
+@@ -163,7 +163,7 @@ if __name__ == "__main__":
+         initBytecodesFile = openOrExit(initASMFileName, "w")
+ 
+     try:
+-        bytecodeSections = json.load(bytecodeFile, encoding = "utf-8")
++        bytecodeSections = json.load(bytecodeFile)
+     except:
+         print("Unexpected error parsing {0}: {1}".format(bytecodeJSONFile, sys.exc_info()))
+ 
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index f80ea336d8..4482d38a98 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2624,7 +2624,8 @@ different kinds of sliders, and much more.")
         (sha256
          (base32
           "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
-        (patches (search-patches "qtwebkit-pbutils-include.patch"))))
+        (patches (search-patches "qtwebkit-pbutils-include.patch"
+                                 "qtwebkit-fix-building-with-python-3.9.patch"))))
     (build-system cmake-build-system)
     (native-inputs
      `(("perl" ,perl)
-- 
2.32.0


From 8660a85abc34ab05c3c7ff6e6813440edfca5bf3 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Tue, 10 Aug 2021 18:02:42 -0400
Subject: [PATCH 2/4] gnu: QtWebKit: Fix building with ICU 68.

* gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/qt.scm (qtwebkit)[source]: Use it
---
 gnu/local.mk                                  |   1 +
 .../qtwebkit-fix-building-with-icu-68.patch   | 152 ++++++++++++++++++
 gnu/packages/qt.scm                           |   1 +
 3 files changed, 154 insertions(+)
 create mode 100644 gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index ae0e9f73da..190d758516 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1646,6 +1646,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/quickswitch-fix-dmenu-check.patch	\
   %D%/packages/patches/qtwebkit-pbutils-include.patch		\
   %D%/packages/patches/qtwebkit-fix-building-with-python-3.9.patch	\
+  %D%/packages/patches/qtwebkit-fix-building-with-icu-68.patch	\
   %D%/packages/patches/randomjungle-disable-static-build.patch	\
   %D%/packages/patches/rapicorn-isnan.patch			\
   %D%/packages/patches/rapidjson-gcc-compat.patch		\
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
new file mode 100644
index 0000000000..acbfc4c4c8
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-icu-68.patch
@@ -0,0 +1,152 @@
+Fix building with ICU > 68.
+
+https://bugs.gentoo.org/753260
+
+Patch adapted from Gentoo:
+
+https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=335f29d266c5b169ff1e781f9851a3a203f3198c
+
+From 335f29d266c5b169ff1e781f9851a3a203f3198c Mon Sep 17 00:00:00 2001
+From: Andreas Sturmlechner <asturm@gentoo.org>
+Date: Fri, 6 Nov 2020 09:22:15 +0100
+Subject: dev-qt/qtwebkit: Fix build with ICU-68
+
+Thanks-to: Lars Wendler <polynomial-c@gentoo.org>
+Closes: https://bugs.gentoo.org/753260
+Package-Manager: Portage-3.0.9, Repoman-3.0.2
+Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
+---
+ .../qtwebkit-5.212.0_pre20200309-icu-68.patch      | 120 +++++++++++++++++++++
+ 1 file changed, 120 insertions(+)
+ create mode 100644 dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch
+
+(limited to 'dev-qt/qtwebkit/files/qtwebkit-5.212.0_pre20200309-icu-68.patch')
+
+diff --git a/Source/WebCore/platform/text/TextCodecICU.cpp b/Source/WebCore/platform/text/TextCodecICU.cpp
+index dd6ff06..e0f4bd7 100644
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+diff --git a/Source/WebCore/platform/text/icu/UTextProvider.h b/Source/WebCore/platform/text/icu/UTextProvider.h
+index c254fc4..6d1e1cb 100644
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text, int64_t nativeIndex, int
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+index cd6852c..6a864b1 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t index, UBool forward)
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UText* text)
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+diff --git a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+index 7aaac48..9ae0d36 100644
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLength(UText* text)
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBoo
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 4482d38a98..525fe2f80b 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2625,6 +2625,7 @@ different kinds of sliders, and much more.")
          (base32
           "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
         (patches (search-patches "qtwebkit-pbutils-include.patch"
+                                 "qtwebkit-fix-building-with-icu-68.patch"
                                  "qtwebkit-fix-building-with-python-3.9.patch"))))
     (build-system cmake-build-system)
     (native-inputs
-- 
2.32.0


From 52af6e4caa205ee204ad668859be78db818e54c8 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Wed, 11 Aug 2021 00:23:02 -0400
Subject: [PATCH 3/4] gnu: QtWebKit: Fix building with glib 2.68.

* gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/qt.scm (qtwebkit)[source]: Use it.
---
 gnu/local.mk                                  |  1 +
 ...qtwebkit-fix-building-with-glib-2.68.patch | 21 +++++++++++++++++++
 gnu/packages/qt.scm                           |  1 +
 3 files changed, 23 insertions(+)
 create mode 100644 gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 190d758516..1f31b70085 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1647,6 +1647,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/qtwebkit-pbutils-include.patch		\
   %D%/packages/patches/qtwebkit-fix-building-with-python-3.9.patch	\
   %D%/packages/patches/qtwebkit-fix-building-with-icu-68.patch	\
+  %D%/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch	\
   %D%/packages/patches/randomjungle-disable-static-build.patch	\
   %D%/packages/patches/rapicorn-isnan.patch			\
   %D%/packages/patches/rapidjson-gcc-compat.patch		\
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
new file mode 100644
index 0000000000..63840f4bbc
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch
@@ -0,0 +1,21 @@
+Fix building with glib 2.68:
+
+https://github.com/qtwebkit/qtwebkit/issues/1057
+
+Patch copied from upstream pull request:
+
+https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b
+
+diff -aurN qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h
+--- qtwebkit-5.212.0-alpha4/Source/WTF/wtf/glib/GRefPtr.h	2020-03-04 18:16:37.000000000 +0100
++++ qtwebkit-5.212.0-alpha4-mod/Source/WTF/wtf/glib/GRefPtr.h	2021-04-05 06:58:44.763328636 +0200
+@@ -29,9 +29,6 @@
+ #include <wtf/RefPtr.h>
+ #include <algorithm>
+ 
+-extern "C" void g_object_unref(gpointer);
+-extern "C" gpointer g_object_ref_sink(gpointer);
+-
+ namespace WTF {
+ 
+ enum GRefPtrAdoptType { GRefPtrAdopt };
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index 525fe2f80b..a6b3f65f1f 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2625,6 +2625,7 @@ different kinds of sliders, and much more.")
          (base32
           "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
         (patches (search-patches "qtwebkit-pbutils-include.patch"
+                                 "qtwebkit-fix-building-with-glib-2.68.patch"
                                  "qtwebkit-fix-building-with-icu-68.patch"
                                  "qtwebkit-fix-building-with-python-3.9.patch"))))
     (build-system cmake-build-system)
-- 
2.32.0


From f3432fcee181dc1ff2813edf423aff14312245f7 Mon Sep 17 00:00:00 2001
From: Leo Famulari <leo@famulari.name>
Date: Wed, 11 Aug 2021 11:35:04 -0400
Subject: [PATCH 4/4] gnu: QtWebKit: Fix building with Bison 3.7.

* gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/qt.scm (qtwebkit)[source]: Use it.
---
 gnu/local.mk                                  |  1 +
 ...qtwebkit-fix-building-with-bison-3.7.patch | 54 +++++++++++++++++++
 gnu/packages/qt.scm                           |  1 +
 3 files changed, 56 insertions(+)
 create mode 100644 gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 1f31b70085..239072bd54 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1645,6 +1645,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/quassel-qt-514-compat.patch		\
   %D%/packages/patches/quickswitch-fix-dmenu-check.patch	\
   %D%/packages/patches/qtwebkit-pbutils-include.patch		\
+  %D%/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch \
   %D%/packages/patches/qtwebkit-fix-building-with-python-3.9.patch	\
   %D%/packages/patches/qtwebkit-fix-building-with-icu-68.patch	\
   %D%/packages/patches/qtwebkit-fix-building-with-glib-2.68.patch	\
diff --git a/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
new file mode 100644
index 0000000000..ddaf8e2849
--- /dev/null
+++ b/gnu/packages/patches/qtwebkit-fix-building-with-bison-3.7.patch
@@ -0,0 +1,54 @@
+Fix build with Bison 3.7
+
+https://bugs.gentoo.org/736499
+
+Patch copied from upstream source repository:
+
+https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31
+
+From d92b11fea65364fefa700249bd3340e0cd4c5b31 Mon Sep 17 00:00:00 2001
+From: Dmitry Shachnev <mitya57@gmail.com>
+Date: Tue, 4 Aug 2020 21:04:06 +0300
+Subject: [PATCH] Let Bison generate the header directly, to fix build with
+ Bison 3.7
+
+Starting with Bison 3.7, the generated C++ file #include's the header
+by default, instead of duplicating it. So we should not delete it.
+
+Remove the code to add #ifdef guards to the header, since Bison adds
+them itself since version 2.6.3.
+---
+ Source/WebCore/css/makegrammar.pl | 21 +--------------------
+ 1 file changed, 1 insertion(+), 20 deletions(-)
+
+diff --git a/Source/WebCore/css/makegrammar.pl b/Source/WebCore/css/makegrammar.pl
+index 5d63b08102eb5..9435701c70612 100644
+--- a/Source/WebCore/css/makegrammar.pl
++++ b/Source/WebCore/css/makegrammar.pl
+@@ -73,25 +73,6 @@
+ }
+ 
+ my $fileBase = File::Spec->join($outputDir, $filename);
+-my @bisonCommand = ($bison, "-d", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
++my @bisonCommand = ($bison, "--defines=$fileBase.h", "-p", $symbolsPrefix, $grammarFilePath, "-o", "$fileBase.cpp");
+ push @bisonCommand, "--no-lines" if $^O eq "MSWin32"; # Work around bug in bison >= 3.0 on Windows where it puts backslashes into #line directives.
+ system(@bisonCommand) == 0 or die;
+-
+-open HEADER, ">$fileBase.h" or die;
+-print HEADER << "EOF";
+-#ifndef CSSGRAMMAR_H
+-#define CSSGRAMMAR_H
+-EOF
+-
+-open HPP, "<$fileBase.cpp.h" or open HPP, "<$fileBase.hpp" or die;
+-while (<HPP>) {
+-    print HEADER;
+-}
+-close HPP;
+-
+-print HEADER "#endif\n";
+-close HEADER;
+-
+-unlink("$fileBase.cpp.h");
+-unlink("$fileBase.hpp");
+-
diff --git a/gnu/packages/qt.scm b/gnu/packages/qt.scm
index a6b3f65f1f..5c0576c880 100644
--- a/gnu/packages/qt.scm
+++ b/gnu/packages/qt.scm
@@ -2625,6 +2625,7 @@ different kinds of sliders, and much more.")
          (base32
           "1rm9sjkabxna67dl7myx9d9vpdyfxfdhrk9w7b94srkkjbd2d8cw"))
         (patches (search-patches "qtwebkit-pbutils-include.patch"
+                                 "qtwebkit-fix-building-with-bison-3.7.patch"
                                  "qtwebkit-fix-building-with-glib-2.68.patch"
                                  "qtwebkit-fix-building-with-icu-68.patch"
                                  "qtwebkit-fix-building-with-python-3.9.patch"))))
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* bug#50014: [core-updates] QtWebKit build failures
  2021-08-11 21:14 bug#50014: [core-updates] QtWebKit build failures Leo Famulari
@ 2021-08-16  9:33 ` Mathieu Othacehe
  2021-08-17 16:34   ` Leo Famulari
  0 siblings, 1 reply; 5+ messages in thread
From: Mathieu Othacehe @ 2021-08-16  9:33 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 50014


Hello Leo,

> ld: ../../lib/libWebCore.a: error adding symbols: malformed archive

I missed your thread and ended up applying the same set of patches, to
reach the same error.

According to
https://stackoverflow.com/questions/45654547/linker-could-not-read-symbols-malformed-archive,
this could be caused by some size limit of archives.

I tried to set:

--8<---------------cut here---------------start------------->8---
  "-DCMAKE_BUILD_TYPE=Release"
--8<---------------cut here---------------end--------------->8---

because it seems that it defaults to "RelWithDebInfo" that adds debug
symbols, but I doesn't help :(.

Mathieu




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50014: [core-updates] QtWebKit build failures
  2021-08-16  9:33 ` Mathieu Othacehe
@ 2021-08-17 16:34   ` Leo Famulari
  2021-08-28 16:17     ` Guillaume Le Vaillant
  0 siblings, 1 reply; 5+ messages in thread
From: Leo Famulari @ 2021-08-17 16:34 UTC (permalink / raw)
  To: Mathieu Othacehe; +Cc: 50014

On Mon, Aug 16, 2021 at 11:33:36AM +0200, Mathieu Othacehe wrote:
> I missed your thread and ended up applying the same set of patches, to
> reach the same error.

I see.

I haven't tried building from a branch yet, rather than cherry-picking a
handful of patches.

The warning message on their release page says that releases will come
from the qtwebkit-dev branch but, on GitHub, the default branch is
qtwebkit-dev-wip. And there is work on the qtwebkit-5.212 branch that is
more recent than the qtwebkit-5.212.0-alpha4 tag, which is what our
package is based on.

So, I think that someone should try these branches, and maybe try to
figure out which is the right one to try...




^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50014: [core-updates] QtWebKit build failures
  2021-08-17 16:34   ` Leo Famulari
@ 2021-08-28 16:17     ` Guillaume Le Vaillant
  2021-08-30 19:56       ` Leo Famulari
  0 siblings, 1 reply; 5+ messages in thread
From: Guillaume Le Vaillant @ 2021-08-28 16:17 UTC (permalink / raw)
  To: Leo Famulari; +Cc: 50014-done

[-- Attachment #1: Type: text/plain, Size: 315 bytes --]

Hi Leo,

I found the cause of the "error adding symbols: Malformed archive".
It happens because the maximum number of open file descriptors is too
low. I pushed a fix (f3152cf3021892ba7e2f3d837207eb1ee64bfdb6) raising
the limit from 1024 to 4096 in the build phase on top of your 4 patches,
and the build succeeds.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 247 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#50014: [core-updates] QtWebKit build failures
  2021-08-28 16:17     ` Guillaume Le Vaillant
@ 2021-08-30 19:56       ` Leo Famulari
  0 siblings, 0 replies; 5+ messages in thread
From: Leo Famulari @ 2021-08-30 19:56 UTC (permalink / raw)
  To: Guillaume Le Vaillant; +Cc: 50014-done

On Sat, Aug 28, 2021 at 04:17:38PM +0000, Guillaume Le Vaillant wrote:
> Hi Leo,
> 
> I found the cause of the "error adding symbols: Malformed archive".
> It happens because the maximum number of open file descriptors is too
> low. I pushed a fix (f3152cf3021892ba7e2f3d837207eb1ee64bfdb6) raising
> the limit from 1024 to 4096 in the build phase on top of your 4 patches,
> and the build succeeds.

Excellent, thank you!




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-30 19:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-11 21:14 bug#50014: [core-updates] QtWebKit build failures Leo Famulari
2021-08-16  9:33 ` Mathieu Othacehe
2021-08-17 16:34   ` Leo Famulari
2021-08-28 16:17     ` Guillaume Le Vaillant
2021-08-30 19:56       ` Leo Famulari

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).