Date: Friday, September 28, 2018 @ 05:03:22 Author: eschwartz Revision: 386776
upgpkg: calibre 3.32.0-1 upstream release Modified: calibre/trunk/PKGBUILD Deleted: calibre/trunk/podofo_0.9.6.patch --------------------+ PKGBUILD | 17 +--- podofo_0.9.6.patch | 206 --------------------------------------------------- 2 files changed, 8 insertions(+), 215 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2018-09-28 04:26:57 UTC (rev 386775) +++ PKGBUILD 2018-09-28 05:03:22 UTC (rev 386776) @@ -7,8 +7,8 @@ # Contributor: Larry Hajali <larryh...@gmail.com> pkgname=calibre -pkgver=3.31.0 -pkgrel=3 +pkgver=3.32.0 +pkgrel=1 pkgdesc="Ebook management application" arch=('x86_64') url="https://calibre-ebook.com/" @@ -24,21 +24,20 @@ makedepends=('qt5-x11extras' 'sip' 'xdg-utils') checkdepends=('xorg-server-xvfb') optdepends=('ipython2: to use calibre-debug' - 'poppler: required for converting pdf to html' -) + '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' + "https://github.com/kovidgoyal/calibre/commit/4d4ffcff7c247072c28d20822abed12e2539cdd2.patch") +sha256sums=('57254b147d8f8caf16f774f090266e112281c19bf7bc4170e65d22ab9b58d8ac' 'SKIP' - '4243e18653348aed438e28af7268c40ea6047e4b1d2b091faeaa1351572f7873') + '60bb12d242e83ba886615472abcf91e05560f1a97a22d04c806d3acdc27fff6c') 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 + # https://bugs.launchpad.net/bugs/1794915 + patch -p1 -i ../4d4ffcff7c247072c28d20822abed12e2539cdd2.patch # Remove unneeded files rm -rf resources/${pkgname}-portable.* Deleted: podofo_0.9.6.patch =================================================================== --- podofo_0.9.6.patch 2018-09-28 04:26:57 UTC (rev 386775) +++ podofo_0.9.6.patch 2018-09-28 05:03:22 UTC (rev 386776) @@ -1,206 +0,0 @@ -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 -