build: patch around qt duplicate symbol issue

This is currently causing the same failure in two different PRs:
```bash
duplicate symbol 'lcQpaFonts()' in:
    /tmp/cirrus-ci-build/depends/x86_64-apple-darwin/lib/libQt5ThemeSupport.a(qgenericunixthemes.o)
    /tmp/cirrus-ci-build/depends/x86_64-apple-darwin/lib/libQt5FontDatabaseSupport.a(qfontengine_coretext.o)
ld: 1 duplicate symbol for architecture x86_64
```

```bash
x86_64-apple-darwin-ld: error: duplicate symbol: __Z10lcQpaFontsv
>>> defined in /tmp/cirrus-ci-build/depends/x86_64-apple-darwin/lib/libQt5ThemeSupport.a(qgenericunixthemes.o)
>>> defined in /tmp/cirrus-ci-build/depends/x86_64-apple-darwin/lib/libQt5FontDatabaseSupport.a(qfontengine_coretext.o)
```

Co-authored-by: Hennadii Stepanov <32963518+hebasto@users.noreply.github.com>
pull/24722/head
fanquake 3 years ago
parent 1021e4cc68
commit a24ef27cfe
No known key found for this signature in database
GPG Key ID: 2EEB9F5CC09526C1

@ -13,7 +13,7 @@ $(package)_patches += dont_use_avx_android_x86_64.patch dont_hardcode_x86_64.pat
$(package)_patches += fix_android_jni_static.patch dont_hardcode_pwd.patch
$(package)_patches += qtbase-moc-ignore-gcc-macro.patch fix_limits_header.patch
$(package)_patches += fix_bigsur_style.patch use_android_ndk23.patch
$(package)_patches += rcc_hardcode_timestamp.patch
$(package)_patches += rcc_hardcode_timestamp.patch duplicate_lcqpafonts.patch
$(package)_qttranslations_file_name=qttranslations-$($(package)_suffix)
$(package)_qttranslations_sha256_hash=d5788e86257b21d5323f1efd94376a213e091d1e5e03b45a95dd052b5f570db8
@ -243,6 +243,7 @@ define $(package)_preprocess_cmds
patch -p1 -i $($(package)_patch_dir)/fix_bigsur_style.patch && \
patch -p1 -i $($(package)_patch_dir)/use_android_ndk23.patch && \
patch -p1 -i $($(package)_patch_dir)/rcc_hardcode_timestamp.patch && \
patch -p1 -i $($(package)_patch_dir)/duplicate_lcqpafonts.patch && \
mkdir -p qtbase/mkspecs/macx-clang-linux &&\
cp -f qtbase/mkspecs/macx-clang/qplatformdefs.h qtbase/mkspecs/macx-clang-linux/ &&\
cp -f $($(package)_patch_dir)/mac-qmake.conf qtbase/mkspecs/macx-clang-linux/qmake.conf && \

@ -0,0 +1,104 @@
QtGui: Fix duplication of logging category lcQpaFonts
Move it to qplatformfontdatabase.h.
Upstream commit:
- Qt 6.0: ab01885e48873fb2ad71841a3f1627fe4d9cd835
--- a/qtbase/src/gui/text/qplatformfontdatabase.cpp
+++ b/qtbase/src/gui/text/qplatformfontdatabase.cpp
@@ -52,6 +52,8 @@
QT_BEGIN_NAMESPACE
+Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
+
void qt_registerFont(const QString &familyname, const QString &stylename,
const QString &foundryname, int weight,
QFont::Style style, int stretch, bool antialiased,
--- a/qtbase/src/gui/text/qplatformfontdatabase.h
+++ b/qtbase/src/gui/text/qplatformfontdatabase.h
@@ -50,6 +50,7 @@
//
#include <QtGui/qtguiglobal.h>
+#include <QtCore/qloggingcategory.h>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QList>
@@ -62,6 +63,7 @@
QT_BEGIN_NAMESPACE
+Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
class QWritingSystemsPrivate;
--- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext.mm
@@ -86,8 +86,6 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
-
static float SYNTHETIC_ITALIC_SKEW = std::tan(14.f * std::acos(0.f) / 90.f);
bool QCoreTextFontEngine::ct_getSfntTable(void *user_data, uint tag, uchar *buffer, uint *length)
--- a/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
+++ b/qtbase/src/platformsupport/fontdatabases/mac/qfontengine_coretext_p.h
@@ -64,8 +64,6 @@
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
-
class QCoreTextFontEngine : public QFontEngine
{
Q_GADGET
--- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase.cpp
@@ -68,8 +68,6 @@
QT_BEGIN_NAMESPACE
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
-
#ifndef QT_NO_DIRECTWRITE
// ### fixme: Consider direct linking of dwrite.dll once Windows Vista pre SP2 is dropped (QTBUG-49711)
--- a/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
+++ b/qtbase/src/platformsupport/fontdatabases/windows/qwindowsfontdatabase_p.h
@@ -63,8 +63,6 @@
QT_BEGIN_NAMESPACE
-Q_DECLARE_LOGGING_CATEGORY(lcQpaFonts)
-
class QWindowsFontEngineData
{
Q_DISABLE_COPY_MOVE(QWindowsFontEngineData)
--- a/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
+++ b/qtbase/src/platformsupport/themes/genericunix/qgenericunixthemes.cpp
@@ -40,6 +40,7 @@
#include "qgenericunixthemes_p.h"
#include "qpa/qplatformtheme_p.h"
+#include "qpa/qplatformfontdatabase.h"
#include <QtGui/QPalette>
#include <QtGui/QFont>
@@ -76,7 +77,6 @@
QT_BEGIN_NAMESPACE
Q_DECLARE_LOGGING_CATEGORY(qLcTray)
-Q_LOGGING_CATEGORY(lcQpaFonts, "qt.qpa.fonts")
ResourceHelper::ResourceHelper()
{
Loading…
Cancel
Save