Unbreak calibre with upcoming Qt 5.13 version. OK?

Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/calibre/Makefile,v
retrieving revision 1.74
diff -u -p -u -p -r1.74 Makefile
--- Makefile    12 Jul 2019 20:49:56 -0000      1.74
+++ Makefile    27 Feb 2020 05:48:13 -0000
@@ -7,7 +7,7 @@ V =                     2.85.1
 DISTNAME =             calibre-$V
 CATEGORIES =           textproc
 EXTRACT_SUFX =         .tar.xz
-REVISION =             10
+REVISION =             11
 
 HOMEPAGE =             https://calibre-ebook.com/
 
Index: patches/patch-src_calibre_headless_fontconfig_database_cpp
===================================================================
RCS file: 
/cvs/ports/textproc/calibre/patches/patch-src_calibre_headless_fontconfig_database_cpp,v
retrieving revision 1.2
diff -u -p -u -p -r1.2 patch-src_calibre_headless_fontconfig_database_cpp
--- patches/patch-src_calibre_headless_fontconfig_database_cpp  10 Aug 2017 
04:57:58 -0000      1.2
+++ patches/patch-src_calibre_headless_fontconfig_database_cpp  27 Feb 2020 
05:48:13 -0000
@@ -2,6 +2,9 @@ $OpenBSD: patch-src_calibre_headless_fon
 Subject: [PATCH] Compatibility with qt5-5.9.0
 Commit-Id: 82bd2e1a51df0650cb40894c5dc2b958f601a91d
 
+Qt 5.11 compatibility
+Commit-Id: 68bbec179abc980ebcb3f13854d2e4fd46f489
+
 Index: src/calibre/headless/fontconfig_database.cpp
 --- src/calibre/headless/fontconfig_database.cpp.orig
 +++ src/calibre/headless/fontconfig_database.cpp
@@ -28,7 +31,29 @@ Index: src/calibre/headless/fontconfig_d
  #endif
  
  #include <QtGui/qguiapplication.h>
-@@ -763,7 +767,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFo
+@@ -280,7 +284,21 @@ static const char specialLanguages[][6] = {
+     "", // Hatran
+     "", // Multani
+     "", // OldHungarian
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
++    "", // SignWriting
++    "", // Adlam
++    "", // Bhaiksuki
++    "", // Marchen
++    "", // Newa
++    "", // Osage
++    "", // Tangut
++    "", // MasaramGondi
++    "", // Nushu
++    "", // Soyombo
++    "" // ZanabazarSquare
++#else
+     ""  // SignWriting
++#endif // Qt >= 5.11
+ #else
+     "hoc"  // WarangCiti
+ #endif  // Qt >= 5.6.0
+@@ -763,7 +781,7 @@ QFontEngine *QFontconfigDatabase::fontEngine(const QFo
  
  QFontEngine *QFontconfigDatabase::fontEngine(const QByteArray &fontData, 
qreal pixelSize, QFont::HintingPreference hintingPreference)
  {
@@ -37,7 +62,7 @@ Index: src/calibre/headless/fontconfig_d
      if (engine == 0)
          return 0;
  
-@@ -915,7 +919,7 @@ QStringList QFontconfigDatabase::addApplicationFont(co
+@@ -915,7 +933,7 @@ QStringList QFontconfigDatabase::addApplicationFont(co
  
  QString QFontconfigDatabase::resolveFontFamilyAlias(const QString &family) 
const
  {
Index: patches/patch-src_calibre_headless_headless_integration_cpp
===================================================================
RCS file: patches/patch-src_calibre_headless_headless_integration_cpp
diff -N patches/patch-src_calibre_headless_headless_integration_cpp
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_calibre_headless_headless_integration_cpp 27 Feb 2020 
05:48:13 -0000
@@ -0,0 +1,22 @@
+$OpenBSD$
+
+fix qt 5.13 compatibility
+In qt/qtbase@01e1df9,
+screenAdded was deprecated, and as of qt 5.13 it is fully removed. Adapt
+to this change by using the new API in QWindowSystemInterface.
+
+Index: src/calibre/headless/headless_integration.cpp
+--- src/calibre/headless/headless_integration.cpp.orig
++++ src/calibre/headless/headless_integration.cpp
+@@ -50,7 +50,11 @@ HeadlessIntegration::HeadlessIntegration(const QString
+     mPrimaryScreen->mDepth = 32;
+     mPrimaryScreen->mFormat = QImage::Format_ARGB32_Premultiplied;
+ 
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 13, 0))
++    QWindowSystemInterface::handleScreenAdded(mPrimaryScreen);
++#else
+     screenAdded(mPrimaryScreen);
++#endif
+     m_fontDatabase.reset(new QFontconfigDatabase());
+ 
+     platform_services.reset(new GenericUnixServices());

Reply via email to