pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

calibre: unbreak.



Module Name:	pkgsrc-wip
Committed By:	Olaf Seibert <rhialto%falu.nl@localhost>
Pushed By:	rhialto
Date:		Fri Jan 7 23:01:27 2022 +0100
Changeset:	f335d8fe8699e46ca567192d10777961efed2f99

Modified Files:
	Makefile
	calibre/Makefile
	calibre/PLIST
	calibre/TODO
	calibre/distinfo
Added Files:
	calibre/patches/patch-src_calibre_ebooks_BeautifulSoup.py
	calibre/patches/patch-src_calibre_headless_fontconfig__database.cpp
	calibre/patches/patch-src_calibre_utils_icu.c
	calibre/patches/patch-src_calibre_utils_matcher.c
	py-qt5-webengine/DESCR
	py-qt5-webengine/Makefile
	py-qt5-webengine/PLIST
	py-qt5-webengine/distinfo

Log Message:
calibre: unbreak.

Needs a bit more work but the database and ebook viewers seem to work
with a quick test.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=f335d8fe8699e46ca567192d10777961efed2f99

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 Makefile                                           |  1 +
 calibre/Makefile                                   |  7 ++-
 calibre/PLIST                                      | 13 +++++
 calibre/TODO                                       | 21 +++++++-
 calibre/distinfo                                   |  6 ++-
 .../patch-src_calibre_ebooks_BeautifulSoup.py      | 31 ++++++++++++
 ...h-src_calibre_headless_fontconfig__database.cpp | 37 ++++++++++++++
 calibre/patches/patch-src_calibre_utils_icu.c      | 15 ++++++
 calibre/patches/patch-src_calibre_utils_matcher.c  | 15 ++++++
 py-qt5-webengine/DESCR                             |  0
 py-qt5-webengine/Makefile                          | 56 ++++++++++++++++++++++
 py-qt5-webengine/PLIST                             | 41 ++++++++++++++++
 py-qt5-webengine/distinfo                          |  5 ++
 13 files changed, 243 insertions(+), 5 deletions(-)

diffs:
diff --git a/Makefile b/Makefile
index c97506739f..b6fae089d0 100644
--- a/Makefile
+++ b/Makefile
@@ -4447,6 +4447,7 @@ SUBDIR+=	py-qnet
 SUBDIR+=	py-qrng
 SUBDIR+=	py-qsymm
 SUBDIR+=	py-qt-thread-updater
+SUBDIR+=	py-qt5-webengine
 SUBDIR+=	py-qtpy
 SUBDIR+=	py-qtt
 SUBDIR+=	py-quandl
diff --git a/calibre/Makefile b/calibre/Makefile
index 018719ff9c..5def074bc9 100644
--- a/calibre/Makefile
+++ b/calibre/Makefile
@@ -13,9 +13,10 @@ COMMENT=	E-book library management application
 LICENSE=	gnu-gpl-v3
 
 DEPENDS+=	${PYPKGPREFIX}-apsw>=3.7.17:../../databases/py-apsw
-DEPENDS+=	${PYPKGPREFIX}-beautifulsoup4-[0-9]*:../../www/py-beautifulsoup4
+DEPENDS+=	${PYPKGPREFIX}-beautifulsoup-[0-9]*:../../www/py-beautifulsoup
 DEPENDS+=	${PYPKGPREFIX}-chardet-[0-9]*:../../converters/py-chardet
-DEPENDS+=	${PYPKGPREFIX}-crypto-[0-9]*:../../security/py-crypto
+#DEPENDS+=	${PYPKGPREFIX}-crypto-[0-9]*:../../security/py-crypto
+DEPENDS+=	${PYPKGPREFIX}-cryptodome-[0-9]*:../../security/py-cryptodome
 DEPENDS+=	${PYPKGPREFIX}-css-parser-[0-9]*:../../textproc/py-css-parser
 DEPENDS+=	${PYPKGPREFIX}-dateutil>=1.4.1:../../time/py-dateutil
 DEPENDS+=	${PYPKGPREFIX}-dns>=1.6.0:../../net/py-dns
@@ -33,6 +34,7 @@ DEPENDS+=	${PYPKGPREFIX}-regex-[0-9]*:../../textproc/py-regex
 DEPENDS+=	${PYPKGPREFIX}-six-[0-9]*:../../lang/py-six
 DEPENDS+=	${PYPKGPREFIX}-soupsieve-[0-9]*:../../www/py-soupsieve
 DEPENDS+=	${PYPKGPREFIX}-sqlite3-[0-9]*:../../databases/py-sqlite3
+DEPENDS+=	${PYPKGPREFIX}-qt5-webengine-[0-9]*:../../wip/py-qt5-webengine
 # for installation
 BUILD_DEPENDS+=	xdg-utils>=1.0.2:../../misc/xdg-utils
 
@@ -143,6 +145,7 @@ BUILDLINK_API_DEPENDS.py-dbus+=	${PYPKGPREFIX}-dbus>=0.82.2
 .include "../../databases/shared-mime-info/mimedb.mk"
 .include "../../x11/py-sip/buildlink3.mk"
 .include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../x11/qt5-qtwebengine/buildlink3.mk"
 .include "../../x11/py-qt5/buildlink3.mk"
 .include "../../lang/python/versioned_dependencies.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/calibre/PLIST b/calibre/PLIST
index 0315a5227a..7ca077c581 100644
--- a/calibre/PLIST
+++ b/calibre/PLIST
@@ -1439,6 +1439,19 @@ lib/calibre/tinycss/token_data.py
 lib/calibre/tinycss/tokenizer.py
 lib/calibre/tinycss/version.py
 ${PYSITELIB}/init_calibre.py
+share/bash-completion/completions/calibre
+share/bash-completion/completions/calibre-debug
+share/bash-completion/completions/calibre-server
+share/bash-completion/completions/calibre-smtp
+share/bash-completion/completions/ebook-convert
+share/bash-completion/completions/ebook-device
+share/bash-completion/completions/ebook-edit
+share/bash-completion/completions/ebook-meta
+share/bash-completion/completions/ebook-polish
+share/bash-completion/completions/ebook-viewer
+share/bash-completion/completions/fetch-ebook-metadata
+share/bash-completion/completions/lrf2lrs
+share/bash-completion/completions/lrfviewer
 share/calibre/builtin_recipes.xml
 share/calibre/builtin_recipes.zip
 share/calibre/calibre-ebook-root-CA.crt
diff --git a/calibre/TODO b/calibre/TODO
index 878c586b63..57de0e3caa 100644
--- a/calibre/TODO
+++ b/calibre/TODO
@@ -1,3 +1,20 @@
-Does not start:
+Clean up a bit.
+Go on with Calibre 5.x.
 
-ImportError: No module named QtWebEngineCore
+>> Startup method for device MTP_DEVICE threw exception
+>> KeyError: u"No plugin named u'libmtp'"
+>> KeyError: u"No plugin named u'libusb'"
+
+this probably "just" means you can't connect to the actual reader device;
+but libmtp and libusb are included in the dependencies, so probably this
+could be improved.
+
+>> Failed to create system tray icon, your desktop environment probably does
+>> not support the StatusNotifier spec
+>> https://www.freedesktop.org/wiki/Specifications/StatusNotifierItem/
+
+I don't really care.
+
+>> qt.xkb.compose: failed to create compose table
+
+This is unclear.
diff --git a/calibre/distinfo b/calibre/distinfo
index 8f126b16b4..c514aeb182 100644
--- a/calibre/distinfo
+++ b/calibre/distinfo
@@ -1,8 +1,12 @@
 $NetBSD: distinfo,v 1.104 2019/09/24 16:39:50 kamil Exp $
 
-RMD160 (calibre-4.11.0.tar.xz) = 507563187bc786464615ff08a966bcd5114d894c
+BLAKE2s (calibre-4.11.0.tar.xz) = 5fdcbbb4e9bb5c9a9f8f8f44433c6dec79b4be9e4ec7633b6059815bbe02ca81
 SHA512 (calibre-4.11.0.tar.xz) = 866e86c926ec6508573c5ad9f382fbc8815103d7248c93ce24a87795b2fb144523cb237bb75dffe024a075e2d4f1bbd7f608ca624d66c898f6840a4b4f3081e3
 Size (calibre-4.11.0.tar.xz) = 37038104 bytes
 SHA1 (patch-setup_build.py) = b5f4b651721c8db7df97a59c166800865835efbd
 SHA1 (patch-setup_install.py) = 758dc31959a6a850602abfcd5d58b19f6b9c6939
+SHA1 (patch-src_calibre_ebooks_BeautifulSoup.py) = b0775f55806a67322eaaae340c6f80ed87aa2332
+SHA1 (patch-src_calibre_headless_fontconfig__database.cpp) = 55e7bd7b779ec2ff4a28fdd3ca9d9c10811b6bb1
 SHA1 (patch-src_calibre_linux.py) = 382191b8c8c6c893c4f2385613c599fcfc3bff09
+SHA1 (patch-src_calibre_utils_icu.c) = a9b90dbe7e7e39d2cf971132a9c45c3d8e31a6fb
+SHA1 (patch-src_calibre_utils_matcher.c) = 4f5969ba3ce1fe96e99c17fe46c992d9adf03b99
diff --git a/calibre/patches/patch-src_calibre_ebooks_BeautifulSoup.py b/calibre/patches/patch-src_calibre_ebooks_BeautifulSoup.py
new file mode 100644
index 0000000000..ecd11e942e
--- /dev/null
+++ b/calibre/patches/patch-src_calibre_ebooks_BeautifulSoup.py
@@ -0,0 +1,31 @@
+$NetBSD$
+
+/usr/pkg/lib/calibre/calibre/ebooks/BeautifulSoup.py imports bs4,
+which imports this:
+
+  File "/usr/pkg/lib/python2.7/site-packages/bs4/dammit.py", line 13, in <module>
+    from html.entities import codepoint2name
+ImportError: No module named html.entities
+
+According to https://stackoverflow.com/questions/27372347/beautifulsoup-importerror-no-module-named-html-entities this module only exists for Python 3.
+There is the package /www/py-beautifulsoup, py27-beautifulsoup-3.2.2 for Python2, 
+
+But:
+calibre requires python >= 2.7.9 and < 3. Current python version: 3.9.9
+*** Error code 1
+
+Why would calibre import a Py3-specific version of BeautifulSoup???
+
+--- src/calibre/ebooks/BeautifulSoup.py.orig	2020-02-21 03:27:12.000000000 +0000
++++ src/calibre/ebooks/BeautifulSoup.py
+@@ -4,8 +4,8 @@
+ 
+ from __future__ import absolute_import, division, print_function, unicode_literals
+ 
+-import bs4
+-from bs4 import (  # noqa
++import BeautifulSoup
++from BeautifulSoup import (  # noqa
+     CData, Comment, Declaration, NavigableString, ProcessingInstruction,
+     SoupStrainer, Tag, __version__
+ )
diff --git a/calibre/patches/patch-src_calibre_headless_fontconfig__database.cpp b/calibre/patches/patch-src_calibre_headless_fontconfig__database.cpp
new file mode 100644
index 0000000000..ee3dd1c425
--- /dev/null
+++ b/calibre/patches/patch-src_calibre_headless_fontconfig__database.cpp
@@ -0,0 +1,37 @@
+$NetBSD$
+
+Qt 5.15.0 has more languages in an array that Calibre tries to match,
+and it checks with a STATIC_ASSERT.
+
+--- src/calibre/headless/fontconfig_database.cpp.orig	2020-02-21 03:27:12.000000000 +0000
++++ src/calibre/headless/fontconfig_database.cpp
+@@ -295,7 +295,28 @@ static const char specialLanguages[][6] 
+     "", // MasaramGondi
+     "", // Nushu
+     "", // Soyombo
+-    "" // ZanabazarSquare
++    "", // ZanabazarSquare
++#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
++        // Unicode 12.1 additions
++    "", //    Script_Dogra,
++    "", //    Script_GunjalaGondi,
++    "", //    Script_HanifiRohingya,
++    "", //    Script_Makasar,
++    "", //    Script_Medefaidrin,
++    "", //    Script_OldSogdian,
++    "", //    Script_Sogdian,
++    "", //    Script_Elymaic,
++    "", //    Script_Nandinagari,
++    "", //    Script_NyiakengPuachueHmong,
++    "", //    Script_Wancho,
++
++        // Unicode 13.0 additions
++    "", //    Script_Chorasmian,
++    "", //    Script_DivesAkuru,
++    "", //    Script_KhitanSmallScript,
++    "", //    Script_Yezidi,
++#endif // Qt >= 5.15
++
+ #else
+     ""  // SignWriting
+ #endif // Qt >= 5.11
diff --git a/calibre/patches/patch-src_calibre_utils_icu.c b/calibre/patches/patch-src_calibre_utils_icu.c
new file mode 100644
index 0000000000..5db000690f
--- /dev/null
+++ b/calibre/patches/patch-src_calibre_utils_icu.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+I compiled with gcc8.
+
+--- src/calibre/utils/icu.c.orig	2020-02-21 03:27:12.000000000 +0000
++++ src/calibre/utils/icu.c
+@@ -4,6 +4,8 @@
+ #define LOWER_CASE 1
+ #define TITLE_CASE 2
+ 
++#define TRUE 1
++
+ static PyObject* uchar_to_unicode(const UChar *src, int32_t len) {
+     wchar_t *buf = NULL;
+     PyObject *ans = NULL;
diff --git a/calibre/patches/patch-src_calibre_utils_matcher.c b/calibre/patches/patch-src_calibre_utils_matcher.c
new file mode 100644
index 0000000000..28826aae2d
--- /dev/null
+++ b/calibre/patches/patch-src_calibre_utils_matcher.c
@@ -0,0 +1,15 @@
+$NetBSD$
+
+I compiled with gcc8.
+
+--- src/calibre/utils/matcher.c.orig	2020-02-21 03:27:12.000000000 +0000
++++ src/calibre/utils/matcher.c
+@@ -15,7 +15,7 @@
+ #define inline
+ #endif
+ 
+-typedef unsigned char bool;
++//typedef unsigned char bool;
+ #define TRUE 1
+ #define FALSE 0
+ #define MAX(x, y) ((x > y) ? x : y)
diff --git a/py-qt5-webengine/DESCR b/py-qt5-webengine/DESCR
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/py-qt5-webengine/Makefile b/py-qt5-webengine/Makefile
new file mode 100644
index 0000000000..0d13159611
--- /dev/null
+++ b/py-qt5-webengine/Makefile
@@ -0,0 +1,56 @@
+# $NetBSD$
+
+DISTNAME=	PyQtWebEngine-${PKGVERSION_NOREV}
+PKGNAME=	${PYPKGPREFIX}-qt5-webengine-5.15.5
+CATEGORIES=	x11 python
+# MASTER_SITES=	${MASTER_SITE_PYPI:=p/PyQtWebEngine/}
+MASTER_SITES=	https://files.pythonhosted.org/packages/60/66/56e118abb4cddd8e4bea6f89bdec834069b52479fb991748f1b21950811e/
+# https://files.pythonhosted.org/packages/60/66/56e118abb4cddd8e4bea6f89bdec834069b52479fb991748f1b21950811e/PyQtWebEngine-5.15.5.tar.gz
+
+MAINTAINER=	pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE=	https://pypi.org/project/PyQtWebEngine
+HOMEPAGE=	https://www.riverbankcomputing.com/software/pyqtwebengine/
+COMMENT=	Python module for QtWebEngine (Chromium-based)
+LICENSE=	gnu-gpl-v3
+
+.include "../../lang/python/pyversion.mk"
+
+USE_LANGUAGES=	c c++
+USE_LIBTOOL=            yes
+USE_TOOLS+=             gmake pkg-config
+
+CONFIGURE_ARGS+=        -d ${PREFIX}/${PYSITELIB}/PyQt5
+CONFIGURE_ARGS+=        --pyqt-sipdir ${PREFIX}/share/sip${PYVERSSUFFIX}/PyQt5
+CONFIGURE_ARGS+=        -q ${QTDIR}/bin/qmake
+CONFIGURE_ARGS+=        --sip ${BUILDLINK_PREFIX.py-sip}/bin/sip${PYVERSSUFFIX}
+CONFIGURE_ARGS+=	--apidir ${PREFIX}/qt5/qsci${PYVERSSUFFIX}
+CONFIGURE_ARGS+=        --verbose
+
+PY_PATCHPLIST=		yes
+
+INSTALL_ENV+=           INSTALL_ROOT=${DESTDIR}
+
+.if ${_PYTHON_VERSION} == 27
+#DEPENDS+=	${PYPKGPREFIX}-enum34-[0-9]*:../../devel/py-enum34
+.endif
+DEPENDS+=       ${PYPKGPREFIX}-sip-qt5>=4.19.23:../../x11/py-sip-qt5
+
+do-configure:
+	cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} \
+                ${PYTHONBIN} configure.py ${CONFIGURE_ARGS}
+
+#TODO hopefully there is a configure parameter for this?
+#post-install:
+#	cd ${PREFIX}${DESTDIR}/${PYSITELIB} && mv QtWebEngine*so PyQt5/
+
+.include "../../mk/bsd.prefs.mk"
+
+.include "../../lang/python/extension.mk"
+.include "../../x11/py-sip/buildlink3.mk"
+.include "../../x11/qt5-qtbase/buildlink3.mk"
+.include "../../x11/qt5-qtdeclarative/buildlink3.mk"
+.include "../../x11/qt5-qtlocation/buildlink3.mk"
+.include "../../x11/qt5-qtwebchannel/buildlink3.mk"
+.include "../../x11/qt5-qtwebengine/buildlink3.mk"
+
+.include "../../mk/bsd.pkg.mk"
diff --git a/py-qt5-webengine/PLIST b/py-qt5-webengine/PLIST
new file mode 100644
index 0000000000..2c34556c41
--- /dev/null
+++ b/py-qt5-webengine/PLIST
@@ -0,0 +1,41 @@
+@comment $NetBSD$
+${PYSITELIB}/PyQt5/QtWebEngine.pyi
+${PYSITELIB}/PyQt5/QtWebEngine.so
+${PYSITELIB}/PyQt5/QtWebEngineCore.pyi
+${PYSITELIB}/PyQt5/QtWebEngineCore.so
+${PYSITELIB}/PyQt5/QtWebEngineWidgets.pyi
+${PYSITELIB}/PyQt5/QtWebEngineWidgets.so
+${PYSITELIB}/PyQtWebEngine-${PKGVERSION}.dist-info/INSTALLER
+${PYSITELIB}/PyQtWebEngine-${PKGVERSION}.dist-info/METADATA
+${PYSITELIB}/PyQtWebEngine-${PKGVERSION}.dist-info/RECORD
+qt5/qsci${PYVERSSUFFIX}/api/python/PyQtWebEngine.api
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngine/QtWebEnginemod.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngine/qquickwebengineprofile.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngine/qquickwebenginescript.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngine/qtwebengineglobal.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/QtWebEngineCoremod.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineclientcertificatestore.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebenginecookiestore.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebenginefindtextresult.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebenginehttprequest.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebenginenotification.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebenginequotarequest.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineregisterprotocolhandlerrequest.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineurlrequestinfo.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineurlrequestinterceptor.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineurlrequestjob.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineurlscheme.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineCore/qwebengineurlschemehandler.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/QtWebEngineWidgetsmod.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginecertificateerror.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebengineclientcertificateselection.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginecontextmenudata.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginedownloaditem.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginefullscreenrequest.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginehistory.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginepage.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebengineprofile.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginescript.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginescriptcollection.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebenginesettings.sip
+share/sip${PYVERSSUFFIX}/PyQt5/QtWebEngineWidgets/qwebengineview.sip
diff --git a/py-qt5-webengine/distinfo b/py-qt5-webengine/distinfo
new file mode 100644
index 0000000000..34f2dd59eb
--- /dev/null
+++ b/py-qt5-webengine/distinfo
@@ -0,0 +1,5 @@
+$NetBSD$
+
+BLAKE2s (PyQtWebEngine-5.15.5.tar.gz) = 7237bec2fedfa5e120c58982e21c13c273986ded59af24fba9741004e67b655b
+SHA512 (PyQtWebEngine-5.15.5.tar.gz) = 20eecd479ea757e3bf9855c7dafe0bbbc0cbc61be26509605a5c9a8026e54bb6e362069ecf4be74733dcf6eec154f6ed13933e334e4455b080e687abfd2659fa
+Size (PyQtWebEngine-5.15.5.tar.gz) = 48610 bytes


Home | Main Index | Thread Index | Old Index