Date: Sunday, September 9, 2018 @ 02:11:01 Author: eschwartz Revision: 378843
archrelease: copy trunk to community-staging-x86_64 Added: calibre/repos/community-staging-x86_64/PKGBUILD (from rev 378842, calibre/trunk/PKGBUILD) calibre/repos/community-staging-x86_64/podofo_0.9.6.patch (from rev 378842, calibre/trunk/podofo_0.9.6.patch) Deleted: calibre/repos/community-staging-x86_64/PKGBUILD calibre/repos/community-staging-x86_64/podofo_0.9.6.patch --------------------+ PKGBUILD | 185 ++++++++++++++++++++--------------------- podofo_0.9.6.patch | 228 ++++++++++++++++++++++++++++++++++++++++++++++----- 2 files changed, 298 insertions(+), 115 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2018-09-09 02:10:43 UTC (rev 378842) +++ PKGBUILD 2018-09-09 02:11:01 UTC (rev 378843) @@ -1,93 +0,0 @@ -# Maintainer: Jelle van der Waa <je...@vdwaa.nl> -# Maintainer: Eli Schwartz <eschwa...@archlinux.org> -# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com> -# Contributor: Giovanni Scafora <giova...@archlinux.org> -# Contributor: Petrov Roman <nwhis...@gmail.com> -# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com> -# Contributor: Larry Hajali <larryh...@gmail.com> - -pkgname=calibre -pkgver=3.31.0 -pkgrel=2 -pkgdesc="Ebook management application" -arch=('x86_64') -url="https://calibre-ebook.com/" -license=('GPL3') -depends=('python2-six' 'python2-dateutil' 'python2-cssutils' 'python2-dukpy' - 'python2-mechanize' 'podofo' 'libwmf' 'jxrlib' - 'chmlib' 'python2-lxml' 'libusbx' 'python2-html5-parser' - 'python2-pillow' 'shared-mime-info' 'python2-dnspython' 'python2-msgpack' - 'python2-pyqt5' 'python2-psutil' 'icu' 'libmtp' 'python2-dbus' - 'python2-netifaces' 'python2-cssselect' 'python2-apsw' 'qt5-webkit' - 'qt5-svg' 'python2-regex' 'python2-pygments' 'mtdev' 'python2-unrardll' - 'desktop-file-utils' 'gtk-update-icon-cache' 'optipng' 'udisks2') -makedepends=('qt5-x11extras' '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" - podofo_0.9.6.patch) -sha256sums=('3c2713a89a186e20d45ea42f2ed6be509fecce880ce6e233e63e6f3a415fe1f5' - 'SKIP' - '6e5c856b164724ed54bf84b1e592a6aea52d0472874be706fd8b61e88ad73151') -validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <ko...@kovidgoyal.net> - -prepare(){ - cd "${pkgname}-${pkgver}" - - patch -Np1 -i ${srcdir}/podofo_0.9.6.patch - - # Remove unneeded files - rm -rf resources/${pkgname}-portable.* - - # Desktop integration (e.g. enforce arch defaults) - sed -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \ - -e "/cc(\['xdg-desktop-menu', 'forceupdate'\])/d" \ - -e "/cc(\['xdg-mime', 'install', MIME\])/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 -} - -build() { - cd "${pkgname}-${pkgver}" - - LANG='en_US.UTF-8' python2 setup.py build - LANG='en_US.UTF-8' python2 setup.py gui -} - -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) - - # websocket test fails currently. - rm src/calibre/srv/tests/web_sockets.py - LANG='en_US.UTF-8' xvfb-run python2 setup.py test -} - -package() { - cd "${pkgname}-${pkgver}" - - install -d "${pkgdir}/usr/share/zsh/site-functions" \ - "${pkgdir}"/usr/share/{applications,desktop-directories,icons/hicolor} - - install -Dm644 resources/calibre-mimetypes.xml \ - "${pkgdir}/usr/share/mime/packages/calibre-mimetypes.xml" - - XDG_DATA_DIRS="${pkgdir}/usr/share" LANG='en_US.UTF-8' \ - python2 setup.py install --staging-root="${pkgdir}/usr" --prefix=/usr - - cp -a man-pages/ "${pkgdir}/usr/share/man" - - # 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-staging-x86_64/PKGBUILD (from rev 378842, calibre/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2018-09-09 02:11:01 UTC (rev 378843) @@ -0,0 +1,92 @@ +# Maintainer: Jelle van der Waa <je...@vdwaa.nl> +# Maintainer: Eli Schwartz <eschwa...@archlinux.org> +# Contributor: Daniel Wallace <danielwallace at gtmanfred dot com> +# Contributor: Giovanni Scafora <giova...@archlinux.org> +# Contributor: Petrov Roman <nwhis...@gmail.com> +# Contributor: Andrea Fagiani <andfagiani _at_ gmail dot com> +# Contributor: Larry Hajali <larryh...@gmail.com> + +pkgname=calibre +pkgver=3.31.0 +pkgrel=3 +pkgdesc="Ebook management application" +arch=('x86_64') +url="https://calibre-ebook.com/" +license=('GPL3') +depends=('python2-six' 'python2-dateutil' 'python2-cssutils' 'python2-dukpy' + 'python2-mechanize' 'podofo' 'libwmf' 'jxrlib' + 'chmlib' 'python2-lxml' 'libusbx' 'python2-html5-parser' + 'python2-pillow' 'shared-mime-info' 'python2-dnspython' 'python2-msgpack' + 'python2-pyqt5' 'python2-psutil' 'icu' 'libmtp' 'python2-dbus' + 'python2-netifaces' 'python2-cssselect' 'python2-apsw' 'qt5-webkit' + 'qt5-svg' 'python2-regex' 'python2-pygments' 'mtdev' 'python2-unrardll' + 'desktop-file-utils' 'gtk-update-icon-cache' 'optipng' 'udisks2') +makedepends=('qt5-x11extras' '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" + podofo_0.9.6.patch) +sha256sums=('3c2713a89a186e20d45ea42f2ed6be509fecce880ce6e233e63e6f3a415fe1f5' + 'SKIP' + '4243e18653348aed438e28af7268c40ea6047e4b1d2b091faeaa1351572f7873') +validpgpkeys=('3CE1780F78DD88DF45194FD706BC317B515ACE7C') # Kovid Goyal (New longer key) <ko...@kovidgoyal.net> + +prepare(){ + cd "${pkgname}-${pkgver}" + + # https://bugs.launchpad.net/bugs/1791430 + patch -Np1 -i ${srcdir}/podofo_0.9.6.patch + + # Remove unneeded files + rm -rf resources/${pkgname}-portable.* + + # Desktop integration (e.g. enforce arch defaults) + sed -e "/self.create_uninstaller()/,/os.rmdir(config_dir)/d" \ + -e "/cc(\['xdg-desktop-menu', 'forceupdate'\])/d" \ + -e "/cc(\['xdg-mime', 'install', MIME\])/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 +} + +build() { + cd "${pkgname}-${pkgver}" + + LANG='en_US.UTF-8' python2 setup.py build + LANG='en_US.UTF-8' python2 setup.py gui +} + +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}" + + install -d "${pkgdir}/usr/share/zsh/site-functions" \ + "${pkgdir}"/usr/share/{applications,desktop-directories,icons/hicolor} + + install -Dm644 resources/calibre-mimetypes.xml \ + "${pkgdir}/usr/share/mime/packages/calibre-mimetypes.xml" + + XDG_DATA_DIRS="${pkgdir}/usr/share" LANG='en_US.UTF-8' \ + python2 setup.py install --staging-root="${pkgdir}/usr" --prefix=/usr + + cp -a man-pages/ "${pkgdir}/usr/share/man" + + # 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: podofo_0.9.6.patch =================================================================== --- podofo_0.9.6.patch 2018-09-09 02:10:43 UTC (rev 378842) +++ podofo_0.9.6.patch 2018-09-09 02:11:01 UTC (rev 378843) @@ -1,22 +0,0 @@ -diff --git a/src/calibre/utils/podofo/doc.cpp b/src/calibre/utils/podofo/doc.cpp -index b33647336c..3d25ac993f 100644 ---- a/src/calibre/utils/podofo/doc.cpp -+++ b/src/calibre/utils/podofo/doc.cpp -@@ -39,7 +39,7 @@ PDFDoc_load(PDFDoc *self, PyObject *args) { - - if (PyArg_ParseTuple(args, "s#", &buffer, &size)) { - try { -- self->doc->Load(buffer, (long)size); -+ self->doc->LoadFromBuffer(buffer, (long)size); - } catch(const PdfError & err) { - podofo_set_exception(err); - return NULL; -@@ -56,7 +56,7 @@ PDFDoc_open(PDFDoc *self, PyObject *args) { - - if (PyArg_ParseTuple(args, "s", &fname)) { - try { -- self->doc->Load(fname); -+ self->doc->LoadFromBuffer(fname, (long)strlen(fname)); - } catch(const PdfError & err) { - podofo_set_exception(err); - return NULL; Copied: calibre/repos/community-staging-x86_64/podofo_0.9.6.patch (from rev 378842, calibre/trunk/podofo_0.9.6.patch) =================================================================== --- podofo_0.9.6.patch (rev 0) +++ podofo_0.9.6.patch 2018-09-09 02:11:01 UTC (rev 378843) @@ -0,0 +1,206 @@ +From dc130d90cdd257f37037a4699b8be1550efc2b6b Mon Sep 17 00:00:00 2001 +From: Kovid Goyal <ko...@kovidgoyal.net> +Date: Sat, 8 Sep 2018 20:51:58 +0530 +Subject: [PATCH 1/3] Fix #1791430 [Podofo ABI breakage in + 0.9.6](https://bugs.launchpad.net/calibre/+bug/1791430) + +--- + src/calibre/utils/podofo/doc.cpp | 31 +++++++++++++++++++------------ + 1 file changed, 19 insertions(+), 12 deletions(-) + +diff --git a/src/calibre/utils/podofo/doc.cpp b/src/calibre/utils/podofo/doc.cpp +index b33647336c..58572a688e 100644 +--- a/src/calibre/utils/podofo/doc.cpp ++++ b/src/calibre/utils/podofo/doc.cpp +@@ -39,7 +39,11 @@ PDFDoc_load(PDFDoc *self, PyObject *args) { + + if (PyArg_ParseTuple(args, "s#", &buffer, &size)) { + try { ++#if PODOFO_VERSION <= 0x000905 + self->doc->Load(buffer, (long)size); ++#else ++ self->doc->LoadBuffer(buffer, (long)size); ++#endif + } catch(const PdfError & err) { + podofo_set_exception(err); + return NULL; +@@ -56,7 +60,11 @@ PDFDoc_open(PDFDoc *self, PyObject *args) { + + if (PyArg_ParseTuple(args, "s", &fname)) { + try { ++#if PODOFO_VERSION <= 0x000905 + self->doc->Load(fname); ++#else ++ self->doc->LoadFromFile(fname); ++#endif + } catch(const PdfError & err) { + podofo_set_exception(err); + return NULL; +@@ -88,7 +96,7 @@ PDFDoc_save(PDFDoc *self, PyObject *args) { + static PyObject * + PDFDoc_write(PDFDoc *self, PyObject *args) { + PyObject *ans; +- ++ + try { + PdfRefCountedBuffer buffer(1*1024*1024); + PdfOutputDevice out(&buffer); +@@ -305,7 +313,7 @@ PDFDoc_set_xmp_metadata(PDFDoc *self, PyObject *args) { + long len = 0; + PoDoFo::PdfObject *metadata = NULL, *catalog = NULL; + PoDoFo::PdfStream *str = NULL; +- TVecFilters compressed(1); ++ TVecFilters compressed(1); + compressed[0] = ePdfFilter_FlateDecode; + + if (!PyArg_ParseTuple(args, "s#", &raw, &len)) return NULL; +@@ -428,7 +436,7 @@ PDFDoc_setter(PDFDoc *self, PyObject *val, int field) { + PdfString *s = NULL; + + if (self->doc->GetEncrypted()) s = podofo_convert_pystring_single_byte(val); +- else s = podofo_convert_pystring(val); ++ else s = podofo_convert_pystring(val); + if (s == NULL) return -1; + + +@@ -503,35 +511,35 @@ PDFDoc_producer_setter(PDFDoc *self, PyObject *val, void *closure) { + } + + static PyGetSetDef PDFDoc_getsetters[] = { +- {(char *)"title", ++ {(char *)"title", + (getter)PDFDoc_title_getter, (setter)PDFDoc_title_setter, + (char *)"Document title", + NULL}, +- {(char *)"author", ++ {(char *)"author", + (getter)PDFDoc_author_getter, (setter)PDFDoc_author_setter, + (char *)"Document author", + NULL}, +- {(char *)"subject", ++ {(char *)"subject", + (getter)PDFDoc_subject_getter, (setter)PDFDoc_subject_setter, + (char *)"Document subject", + NULL}, +- {(char *)"keywords", ++ {(char *)"keywords", + (getter)PDFDoc_keywords_getter, (setter)PDFDoc_keywords_setter, + (char *)"Document keywords", + NULL}, +- {(char *)"creator", ++ {(char *)"creator", + (getter)PDFDoc_creator_getter, (setter)PDFDoc_creator_setter, + (char *)"Document creator", + NULL}, +- {(char *)"producer", ++ {(char *)"producer", + (getter)PDFDoc_producer_getter, (setter)PDFDoc_producer_setter, + (char *)"Document producer", + NULL}, +- {(char *)"pages", ++ {(char *)"pages", + (getter)PDFDoc_pages_getter, NULL, + (char *)"Number of pages in document (read only)", + NULL}, +- {(char *)"version", ++ {(char *)"version", + (getter)PDFDoc_version_getter, NULL, + (char *)"The PDF version (read only)", + NULL}, +@@ -633,4 +641,3 @@ PyTypeObject pdf::PDFDocType = { + + }; + // }}} +- +-- +2.18.0 + + +From 8b03d1d61a76a4804ccd68a10e14d04df260b1b1 Mon Sep 17 00:00:00 2001 +From: Kovid Goyal <ko...@kovidgoyal.net> +Date: Sat, 8 Sep 2018 21:32:25 +0530 +Subject: [PATCH 2/3] Proper fix for podofo 0.9.6 + +--- + src/calibre/utils/podofo/doc.cpp | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/calibre/utils/podofo/doc.cpp b/src/calibre/utils/podofo/doc.cpp +index 58572a688e..4a7a615bb2 100644 +--- a/src/calibre/utils/podofo/doc.cpp ++++ b/src/calibre/utils/podofo/doc.cpp +@@ -42,7 +42,7 @@ PDFDoc_load(PDFDoc *self, PyObject *args) { + #if PODOFO_VERSION <= 0x000905 + self->doc->Load(buffer, (long)size); + #else +- self->doc->LoadBuffer(buffer, (long)size); ++ self->doc->LoadFromBuffer(buffer, (long)size); + #endif + } catch(const PdfError & err) { + podofo_set_exception(err); +@@ -60,11 +60,7 @@ PDFDoc_open(PDFDoc *self, PyObject *args) { + + if (PyArg_ParseTuple(args, "s", &fname)) { + try { +-#if PODOFO_VERSION <= 0x000905 + self->doc->Load(fname); +-#else +- self->doc->LoadFromFile(fname); +-#endif + } catch(const PdfError & err) { + podofo_set_exception(err); + return NULL; +-- +2.18.0 + + +From 6b14a1204abd8e491184ac7c84a86160136b90c7 Mon Sep 17 00:00:00 2001 +From: Kovid Goyal <ko...@kovidgoyal.net> +Date: Sat, 8 Sep 2018 22:05:20 +0530 +Subject: [PATCH 3/3] Test podofo read from file + +--- + src/calibre/utils/podofo/__init__.py | 20 ++++++++++++++------ + 1 file changed, 14 insertions(+), 6 deletions(-) + +diff --git a/src/calibre/utils/podofo/__init__.py b/src/calibre/utils/podofo/__init__.py +index a617c02964..b30d5079d1 100644 +--- a/src/calibre/utils/podofo/__init__.py ++++ b/src/calibre/utils/podofo/__init__.py +@@ -164,6 +164,7 @@ def test_save_to(src, dest): + + + def test_podofo(): ++ import tempfile + from io import BytesIO + from calibre.ebooks.metadata.book.base import Metadata + from calibre.ebooks.metadata.xmp import metadata_to_xmp_packet +@@ -179,12 +180,19 @@ def test_podofo(): + buf = BytesIO() + p.save_to_fileobj(buf) + raw = buf.getvalue() +- p = podofo.PDFDoc() +- p.load(raw) +- if (p.title, p.author) != (mi.title, mi.authors[0]): +- raise ValueError('podofo failed to set title and author in Info dict') +- if not p.get_xmp_metadata(): +- raise ValueError('podofo failed to write XMP packet') ++ with tempfile.NamedTemporaryFile(delete=False) as f: ++ f.write(raw) ++ try: ++ p = podofo.PDFDoc() ++ p.open(f.name) ++ if (p.title, p.author) != (mi.title, mi.authors[0]): ++ raise ValueError('podofo failed to set title and author in Info dict') ++ if not p.get_xmp_metadata(): ++ raise ValueError('podofo failed to write XMP packet') ++ del p ++ finally: ++ os.remove(f.name) ++ + + if __name__ == '__main__': + import sys +-- +2.18.0 +