[arch-commits] Commit in calibre/repos/community-x86_64 (3 files)
Eli Schwartz
eschwartz at archlinux.org
Fri Nov 8 02:32:59 UTC 2019
Date: Friday, November 8, 2019 @ 02:32:59
Author: eschwartz
Revision: 524586
archrelease: copy trunk to community-x86_64
Added:
calibre/repos/community-x86_64/PKGBUILD
(from rev 524585, calibre/trunk/PKGBUILD)
Deleted:
calibre/repos/community-x86_64/PKGBUILD
calibre/repos/community-x86_64/calibre-qt-5.13.2.patch
-------------------------+
PKGBUILD | 198 ++++++++++++++++++++++------------------------
calibre-qt-5.13.2.patch | 166 --------------------------------------
2 files changed, 96 insertions(+), 268 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2019-11-08 02:32:32 UTC (rev 524585)
+++ PKGBUILD 2019-11-08 02:32:59 UTC (rev 524586)
@@ -1,102 +0,0 @@
-# Maintainer: Jelle van der Waa <jelle at vdwaa.nl>
-# Maintainer: Eli Schwartz <eschwartz at archlinux.org>
-# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
-# Contributor: Giovanni Scafora <giovanni at archlinux.org>
-# Contributor: Petrov Roman <nwhisper at gmail.com>
-# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
-# Contributor: Larry Hajali <larryhaja at gmail.com>
-
-pkgname=calibre
-pkgver=4.2.0
-pkgrel=5
-pkgdesc="Ebook management application"
-arch=('x86_64')
-url="https://calibre-ebook.com/"
-license=('GPL3')
-_py_deps=('apsw' 'beautifulsoup4' 'cssselect' 'css-parser' 'dateutil' 'dbus' 'dnspython'
- 'feedparser' 'html2text' 'html5-parser' 'lxml' 'markdown' 'mechanize' 'msgpack'
- 'netifaces' 'unrardll' 'pillow' 'psutil' 'pygments' 'pyqt5' 'pyqtwebengine' 'regex')
-depends=('chmlib' 'hunspell' 'icu' 'jxrlib' 'libmtp' 'libusbx' 'libwmf' 'mathjax2' 'mtdev' 'optipng'
- 'podofo' "${_py_deps[@]/#/python2-}" 'qt5-svg' 'udisks2')
-makedepends=('qt5-x11extras' 'rapydscript-ng' 'sip' 'xdg-utils')
-checkdepends=('xorg-server-xvfb')
-optdepends=('ipython2: to use calibre-debug'
- 'poppler: required for converting pdf to html')
-source=("https://download.calibre-ebook.com/${pkgver}/calibre-${pkgver}.tar.xz"
- "https://calibre-ebook.com/signatures/${pkgname}-${pkgver}.tar.xz.sig"
- "calibre-qt-5.13.2.patch")
-sha256sums=('b1b626acdcc3b29ae96489e7424389161bd6529545f47c0d2b063b99131286d8'
- 'SKIP'
- 'c4e952ad1bb15cb0c8c36e34b6f056d4263b74f9322ab611de5a73dd0004f2be')
-b2sums=('a37baae9c77ae2535782c5ee2095a33874c394b7f6415f4aac2752330c6cac3972723e75b90d38955a67a5df90de4318b740ca357b7149f610245f1895482437'
- 'SKIP'
- '1778ba195a5088aa65d74ad22e255200f4d7304ee543077e15b08793cb6877c1e7bf45b9b63fb3beba9d6ad667c1d1ddb3218f9d539e252162fe9f33a5c17616')
-validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid at kovidgoyal.net>
-
-prepare(){
- cd "${pkgname}-${pkgver}"
-
- # fix ebook-viewer with Qt 5.13.2
- patch -p1 -i ../calibre-qt-5.13.2.patch
-
- # Desktop integration (e.g. enforce arch defaults)
- # Use uppercase naming scheme, don't delete config files under fakeroot.
- sed -e "/import config_dir/,/os.rmdir(config_dir)/d" \
- -e "s/'ctc-posml'/'text' not in mt and 'pdf' not in mt and 'xhtml'/" \
- -e "s/^Name=calibre/Name=Calibre/g" \
- -i src/calibre/linux.py
-
- # cherry-picked bits of python2-backports.functools_lru_cache
- # needed for frozen builds + beautifulsoup4
- # see https://github.com/kovidgoyal/calibre/commit/b177f0a1096b4fdabd8772dd9edc66662a69e683#commitcomment-33169700
- rm -r src/backports
-
- cd resources
-
- # Remove unneeded files
- rm ${pkgname}-portable.* mozilla-ca-certs.pem
-
- # use system mathjax
- rm -r mathjax
-}
-
-build() {
- cd "${pkgname}-${pkgver}"
-
- LANG='en_US.UTF-8' python2 setup.py build
- LANG='en_US.UTF-8' python2 setup.py gui
- LANG='en_US.UTF-8' python2 setup.py mathjax --path-to-mathjax /usr/share/mathjax2 --system-mathjax
- LANG='en_US.UTF-8' python2 setup.py rapydscript
-}
-
-check() {
- cd "${pkgname}-${pkgver}"
-
- # without xvfb-run this fails with much "Control socket failed to recv(), resetting"
- # ERROR: test_websocket_perf (calibre.srv.tests.web_sockets.WebSocketTest)
- LANG='en_US.UTF-8' xvfb-run python2 setup.py test
-}
-
-package() {
- cd "${pkgname}-${pkgver}"
-
- # If this directory doesn't exist, zsh completion won't install.
- install -d "${pkgdir}/usr/share/zsh/site-functions"
-
- LANG='en_US.UTF-8' python2 setup.py install \
- --staging-root="${pkgdir}/usr" \
- --prefix=/usr
-
- cp -a man-pages/ "${pkgdir}/usr/share/man"
-
- # not needed at runtime
- rm -r "${pkgdir}"/usr/share/calibre/rapydscript/
-
- # Compiling bytecode FS#33392
- # This is kind of ugly but removes traces of the build root.
- while read -rd '' _file; do
- _destdir="$(dirname "${_file#${pkgdir}}")"
- python2 -m compileall -d "${_destdir}" "${_file}"
- python2 -O -m compileall -d "${_destdir}" "${_file}"
- done < <(find "${pkgdir}"/usr/lib/ -name '*.py' -print0)
-}
Copied: calibre/repos/community-x86_64/PKGBUILD (from rev 524585, calibre/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2019-11-08 02:32:59 UTC (rev 524586)
@@ -0,0 +1,96 @@
+# Maintainer: Jelle van der Waa <jelle at vdwaa.nl>
+# Maintainer: Eli Schwartz <eschwartz at archlinux.org>
+# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com>
+# Contributor: Giovanni Scafora <giovanni at archlinux.org>
+# Contributor: Petrov Roman <nwhisper at gmail.com>
+# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com>
+# Contributor: Larry Hajali <larryhaja at gmail.com>
+
+pkgname=calibre
+pkgver=4.3.0
+pkgrel=1
+pkgdesc="Ebook management application"
+arch=('x86_64')
+url="https://calibre-ebook.com/"
+license=('GPL3')
+_py_deps=('apsw' 'beautifulsoup4' 'cssselect' 'css-parser' 'dateutil' 'dbus' 'dnspython'
+ 'feedparser' 'html2text' 'html5-parser' 'lxml' 'markdown' 'mechanize' 'msgpack'
+ 'netifaces' 'unrardll' 'pillow' 'psutil' 'pygments' 'pyqt5' 'pyqtwebengine' 'regex')
+depends=('chmlib' 'hunspell' 'icu' 'jxrlib' 'libmtp' 'libusbx' 'libwmf' 'mathjax2' 'mtdev' 'optipng'
+ 'podofo' "${_py_deps[@]/#/python2-}" 'qt5-svg' 'udisks2')
+makedepends=('qt5-x11extras' 'rapydscript-ng' 'sip' 'xdg-utils')
+checkdepends=('xorg-server-xvfb')
+optdepends=('ipython2: to use calibre-debug'
+ 'poppler: required for converting pdf to html')
+source=("https://download.calibre-ebook.com/${pkgver}/calibre-${pkgver}.tar.xz"
+ "https://calibre-ebook.com/signatures/${pkgname}-${pkgver}.tar.xz.sig")
+sha256sums=('cf19f19da993c496a045c49d89f9232dd5ab23034acad2d14cba0bfab8178420'
+ 'SKIP')
+b2sums=('fd187d1b68ac60c26c11094b0d19123f24ac93cde1e9939b71ecd4756c7a40ab55e4e36128763ed7f312df18a5152da418828ce84f4514a8747df8ccc3de2365'
+ 'SKIP')
+validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <kovid at kovidgoyal.net>
+
+prepare(){
+ cd "${pkgname}-${pkgver}"
+
+ # Desktop integration (e.g. enforce arch defaults)
+ # Use uppercase naming scheme, don't delete config files under fakeroot.
+ sed -e "/import config_dir/,/os.rmdir(config_dir)/d" \
+ -e "s/'ctc-posml'/'text' not in mt and 'pdf' not in mt and 'xhtml'/" \
+ -e "s/^Name=calibre/Name=Calibre/g" \
+ -i src/calibre/linux.py
+
+ # cherry-picked bits of python2-backports.functools_lru_cache
+ # needed for frozen builds + beautifulsoup4
+ # see https://github.com/kovidgoyal/calibre/commit/b177f0a1096b4fdabd8772dd9edc66662a69e683#commitcomment-33169700
+ rm -r src/backports
+
+ cd resources
+
+ # Remove unneeded files
+ rm ${pkgname}-portable.* mozilla-ca-certs.pem
+
+ # use system mathjax
+ rm -r mathjax
+}
+
+build() {
+ cd "${pkgname}-${pkgver}"
+
+ LANG='en_US.UTF-8' python2 setup.py build
+ LANG='en_US.UTF-8' python2 setup.py gui
+ LANG='en_US.UTF-8' python2 setup.py mathjax --path-to-mathjax /usr/share/mathjax2 --system-mathjax
+ LANG='en_US.UTF-8' python2 setup.py rapydscript
+}
+
+check() {
+ cd "${pkgname}-${pkgver}"
+
+ # without xvfb-run this fails with much "Control socket failed to recv(), resetting"
+ # ERROR: test_websocket_perf (calibre.srv.tests.web_sockets.WebSocketTest)
+ LANG='en_US.UTF-8' xvfb-run python2 setup.py test
+}
+
+package() {
+ cd "${pkgname}-${pkgver}"
+
+ # If this directory doesn't exist, zsh completion won't install.
+ install -d "${pkgdir}/usr/share/zsh/site-functions"
+
+ LANG='en_US.UTF-8' python2 setup.py install \
+ --staging-root="${pkgdir}/usr" \
+ --prefix=/usr
+
+ cp -a man-pages/ "${pkgdir}/usr/share/man"
+
+ # not needed at runtime
+ rm -r "${pkgdir}"/usr/share/calibre/rapydscript/
+
+ # Compiling bytecode FS#33392
+ # This is kind of ugly but removes traces of the build root.
+ while read -rd '' _file; do
+ _destdir="$(dirname "${_file#${pkgdir}}")"
+ python2 -m compileall -d "${_destdir}" "${_file}"
+ python2 -O -m compileall -d "${_destdir}" "${_file}"
+ done < <(find "${pkgdir}"/usr/lib/ -name '*.py' -print0)
+}
Deleted: calibre-qt-5.13.2.patch
===================================================================
--- calibre-qt-5.13.2.patch 2019-11-08 02:32:32 UTC (rev 524585)
+++ calibre-qt-5.13.2.patch 2019-11-08 02:32:59 UTC (rev 524586)
@@ -1,166 +0,0 @@
-From 2da7dd741fcebd3af89f77bc3fc4f52fe90940de Mon Sep 17 00:00:00 2001
-From: Kovid Goyal <kovid at kovidgoyal.net>
-Date: Sat, 2 Nov 2019 07:18:35 +0530
-Subject: [PATCH 1/4] Better error message on AJAX call failure
-
-(cherry picked from commit 8b7b9427bd71f48acf9dc766c976bb3f5ce5e357)
----
- src/pyj/ajax.pyj | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj
-index 7a8c453e5e..3a43984903 100644
---- a/src/pyj/ajax.pyj
-+++ b/src/pyj/ajax.pyj
-@@ -81,7 +81,7 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', q
- rtext = xhr.responseText or ''
- except:
- rtext = ''
-- xhr.error_html = str.format(_('Failed to communicate with "{}", with status: [{}] {}<br><br>{}'), xhr.request_path, xhr.status, xhr.statusText, rtext[:200])
-+ xhr.error_html = str.format(_('Failed to communicate with "{}", with status: [{} ({})] {}<br><br>{}'), xhr.request_path, xhr.status, event, xhr.statusText, rtext[:200])
-
- def progress_callback(ev):
- if ev.lengthComputable:
---
-2.23.0
-
-
-From fc63678168b5bbb8c48f1930535e1d2bfb90c13f Mon Sep 17 00:00:00 2001
-From: Kovid Goyal <kovid at kovidgoyal.net>
-Date: Sat, 2 Nov 2019 07:24:10 +0530
-Subject: [PATCH 2/4] Workaround for AJAX breakage on Qt 5.13.2
-
-Fixes #1850975 [qt5-webengine 5.13.2 breaks ebook-viewer](https://bugs.launchpad.net/calibre/+bug/1850975)
-
-(cherry picked from commit 6cccd18be81133ce57c885ecad9e012a16a3fe8b)
----
- src/pyj/ajax.pyj | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj
-index 3a43984903..5a038eaed5 100644
---- a/src/pyj/ajax.pyj
-+++ b/src/pyj/ajax.pyj
-@@ -102,6 +102,9 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', q
- is_network_error = ev if end_type is 'error' else False
- if xhr.status is not ok_code and end_type is 'load':
- end_type = 'error'
-+ if xhr.status is ok_code and end_type is 'error':
-+ # this apparently happens on Qt 5.13.2
-+ end_type = 'load'
- if end_type is not 'load':
- set_error(end_type, is_network_error)
- on_complete(end_type, xhr, ev)
---
-2.23.0
-
-
-From 71223eb8a2ace02473ada1568f123d2bd5af3891 Mon Sep 17 00:00:00 2001
-From: Kovid Goyal <kovid at kovidgoyal.net>
-Date: Sun, 3 Nov 2019 07:12:25 +0530
-Subject: [PATCH 3/4] Also reset headers/footers when resetting interface
-
-And work Qt 5.13.2 bug in more places
-
-(cherry picked from commit a179632356579a954eccf2d23112f061e8187a68)
-[Eli: disentangled from unrelated changes relying on commit 4e98478013c7e23a6333cb27cc09976667c77d1f]
----
- src/pyj/ajax.pyj | 10 +++++++---
- src/pyj/viewer-main.pyj | 5 ++++-
- 2 files changed, 11 insertions(+), 4 deletions(-)
-
-diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj
-index 5a038eaed5..9337c6ad62 100644
---- a/src/pyj/ajax.pyj
-+++ b/src/pyj/ajax.pyj
-@@ -47,6 +47,12 @@ def absolute_path(path):
- return path
-
-
-+def workaround_qt_bug(xhr, end_type, ok_code=200):
-+ if end_type is 'error' and xhr.status is ok_code:
-+ end_type = 'load'
-+ return end_type
-+
-+
- def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', query=None, timeout=None, ok_code=200, progress_totals_needed=True):
- # Run an AJAX request. on_complete must be a function that accepts three
- # arguments: end_type, xhr, ev where end_type is one of 'abort', 'error',
-@@ -102,9 +108,7 @@ def ajax(path, on_complete, on_progress=None, bypass_cache=True, method='GET', q
- is_network_error = ev if end_type is 'error' else False
- if xhr.status is not ok_code and end_type is 'load':
- end_type = 'error'
-- if xhr.status is ok_code and end_type is 'error':
-- # this apparently happens on Qt 5.13.2
-- end_type = 'load'
-+ end_type = workaround_qt_bug(xhr, end_type, ok_code)
- if end_type is not 'load':
- set_error(end_type, is_network_error)
- on_complete(end_type, xhr, ev)
-diff --git a/src/pyj/viewer-main.pyj b/src/pyj/viewer-main.pyj
-index 87c9d3e9a5..d7047386d9 100644
---- a/src/pyj/viewer-main.pyj
-+++ b/src/pyj/viewer-main.pyj
-@@ -7,7 +7,7 @@ from elementmaker import E
- from gettext import gettext as _, install
-
- import initialize # noqa: unused-import
--from ajax import ajax
-+from ajax import ajax, workaround_qt_bug
- from book_list.globals import set_session_data
- from book_list.library_data import library_data
- from book_list.theme import get_color
-@@ -34,6 +34,7 @@ view = None
-
-
- def file_received(name, file_data, proceed, end_type, xhr, ev):
-+ end_type = workaround_qt_bug(xhr, end_type)
- if end_type is 'abort':
- return
- if end_type is not 'load':
-@@ -62,6 +63,7 @@ def get_file(book, name, proceed):
- xhr.send()
-
- def mathjax_file_received(name, proceed, end_type, xhr, ev):
-+ end_type = workaround_qt_bug(xhr, end_type)
- if end_type is 'abort':
- return
- if end_type is not 'load':
-@@ -139,6 +141,7 @@ def show_error(title, msg, details):
-
- def manifest_received(key, initial_cfi, initial_toc_node, pathtoebook, end_type, xhr, ev):
- nonlocal book
-+ end_type = workaround_qt_bug(xhr, end_type)
- if end_type is 'load':
- book = new_book(key, {})
- data = xhr.response
---
-2.23.0
-
-
-From 461f2095d3a91cd1e81e3a853b3fc985c7ecbcd6 Mon Sep 17 00:00:00 2001
-From: Kovid Goyal <kovid at kovidgoyal.net>
-Date: Sun, 3 Nov 2019 07:16:17 +0530
-Subject: [PATCH 4/4] Only use Qt bug workaround in the viewer
-
-(cherry picked from commit c17411a39f9db0fe15455f6a0dd959ffe70087e5)
----
- src/pyj/ajax.pyj | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/src/pyj/ajax.pyj b/src/pyj/ajax.pyj
-index 9337c6ad62..ec5c78cd1c 100644
---- a/src/pyj/ajax.pyj
-+++ b/src/pyj/ajax.pyj
-@@ -48,7 +48,7 @@ def absolute_path(path):
-
-
- def workaround_qt_bug(xhr, end_type, ok_code=200):
-- if end_type is 'error' and xhr.status is ok_code:
-+ if end_type is 'error' and xhr.status is ok_code and window.navigator.userAgent.indexOf('calibre-viewer') is 0:
- end_type = 'load'
- return end_type
-
---
-2.23.0
-
More information about the arch-commits
mailing list