diff options
author | Andreas Sturmlechner <asturm@gentoo.org> | 2019-05-02 01:03:42 +0200 |
---|---|---|
committer | Andreas Sturmlechner <asturm@gentoo.org> | 2019-05-08 18:59:34 +0200 |
commit | 0e6cc96473139bafe29e197e55996beb505dd21d (patch) | |
tree | 67e41059a06de0219fced5f48b4ed44bc2d88d0c /app-text | |
parent | app-office/scribus: Fix build against poppler-0.76 (diff) | |
download | gentoo-0e6cc96473139bafe29e197e55996beb505dd21d.tar.gz gentoo-0e6cc96473139bafe29e197e55996beb505dd21d.tar.bz2 gentoo-0e6cc96473139bafe29e197e55996beb505dd21d.zip |
app-text/pdf2djvu: Fix build against poppler-0.76
Package-Manager: Portage-2.3.66, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'app-text')
4 files changed, 146 insertions, 0 deletions
diff --git a/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-1.patch b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-1.patch new file mode 100644 index 000000000000..06341298ff68 --- /dev/null +++ b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-1.patch @@ -0,0 +1,35 @@ +From aa3fdae51c19ad2865f92882ec9007feeb7e477a Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <jwilk@jwilk.net> +Date: Mon, 1 Apr 2019 08:23:51 +0200 +Subject: [PATCH] Put Ref in pdf namespace. + +--- + pdf-backend.hh | 1 + + pdf2djvu.cc | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/pdf-backend.hh b/pdf-backend.hh +index 43899c0..d7872c3 100644 +--- a/pdf-backend.hh ++++ b/pdf-backend.hh +@@ -82,6 +82,7 @@ namespace pdf + typedef ::Catalog Catalog; + typedef ::GooString String; + typedef ::Goffset Offset; ++ typedef ::Ref Ref; + + /* type definitions — annotations + * ============================== +diff --git a/pdf2djvu.cc b/pdf2djvu.cc +index 669eba5..d9e1532 100644 +--- a/pdf2djvu.cc ++++ b/pdf2djvu.cc +@@ -86,7 +86,7 @@ static int get_page_for_goto_link(pdf::link::GoTo *goto_link, pdf::Catalog *cata + int page; + if (dest->isPageRef()) + { +- Ref pageref = dest->getPageRef(); ++ pdf::Ref pageref = dest->getPageRef(); + page = catalog->findPage(pageref.num, pageref.gen); + } + else diff --git a/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-2.patch b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-2.patch new file mode 100644 index 000000000000..356153b5cca0 --- /dev/null +++ b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-2.patch @@ -0,0 +1,69 @@ +From 8b0348b3d5f33494d7e637411633fbea511a78d7 Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <jwilk@jwilk.net> +Date: Mon, 1 Apr 2019 08:49:02 +0200 +Subject: [PATCH] Use Catalog::findPage(Ref) as alternative to + Catalog::findPage(int, int). +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes: + + pdf2djvu.cc: In function ‘int get_page_for_goto_link(pdf::link::GoTo*, pdf::Catalog*)’: + pdf2djvu.cc:90:56: error: no matching function for call to ‘Catalog::findPage(int&, int&)’ +--- + pdf-backend.cc | 15 +++++++++++++++ + pdf-backend.hh | 2 ++ + pdf2djvu.cc | 2 +- + 3 files changed, 18 insertions(+), 1 deletion(-) + +diff --git a/pdf-backend.cc b/pdf-backend.cc +index f1d7662..a1b9b63 100644 +--- a/pdf-backend.cc ++++ b/pdf-backend.cc +@@ -631,4 +631,19 @@ const char * pdf::get_c_string(const pdf::String *str) + } + #endif + ++template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(0, 0)) ++{ ++ return catalog->findPage(pgref.num, pgref.gen); ++} ++ ++template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(pgref)) ++{ ++ return catalog->findPage(pgref); ++} ++ ++int pdf::find_page(pdf::Catalog *catalog, pdf::Ref pgref) ++{ ++ return find_page_impl<pdf::Catalog>(catalog, pgref); ++} ++ + // vim:ts=2 sts=2 sw=2 et +diff --git a/pdf-backend.hh b/pdf-backend.hh +index d7872c3..d88c956 100644 +--- a/pdf-backend.hh ++++ b/pdf-backend.hh +@@ -436,6 +436,8 @@ namespace pdf + + const char * get_c_string(const pdf::String *str); + ++ int find_page(pdf::Catalog *catalog, pdf::Ref pgref); ++ + } + + #endif +diff --git a/pdf2djvu.cc b/pdf2djvu.cc +index d9e1532..21f2d50 100644 +--- a/pdf2djvu.cc ++++ b/pdf2djvu.cc +@@ -87,7 +87,7 @@ static int get_page_for_goto_link(pdf::link::GoTo *goto_link, pdf::Catalog *cata + if (dest->isPageRef()) + { + pdf::Ref pageref = dest->getPageRef(); +- page = catalog->findPage(pageref.num, pageref.gen); ++ page = pdf::find_page(catalog, pageref); + } + else + page = dest->getPageNum(); diff --git a/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-3.patch b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-3.patch new file mode 100644 index 000000000000..b3d8cfad6df2 --- /dev/null +++ b/app-text/pdf2djvu/files/pdf2djvu-0.9.12-poppler-0.76-3.patch @@ -0,0 +1,38 @@ +From 8325358a9769e8aa33693fc5ea2ac771dd82716f Mon Sep 17 00:00:00 2001 +From: Jakub Wilk <jwilk@jwilk.net> +Date: Tue, 23 Apr 2019 08:23:46 +0200 +Subject: [PATCH] pdf-backend: simplify find_page() implementation. + +--- + pdf-backend.cc | 16 +++++----------- + 1 file changed, 5 insertions(+), 11 deletions(-) + +diff --git a/pdf-backend.cc b/pdf-backend.cc +index f6f5267..a94383e 100644 +--- a/pdf-backend.cc ++++ b/pdf-backend.cc +@@ -631,19 +631,13 @@ const char * pdf::get_c_string(const pdf::String *str) + } + #endif + +-template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(0, 0)) +-{ +- return catalog->findPage(pgref.num, pgref.gen); +-} +- +-template <typename C> static auto find_page_impl(C *catalog, pdf::Ref pgref) -> decltype(catalog->findPage(pgref)) +-{ +- return catalog->findPage(pgref); +-} +- + int pdf::find_page(pdf::Catalog *catalog, pdf::Ref pgref) + { +- return find_page_impl<pdf::Catalog>(catalog, pgref); ++#if POPPLER_VERSION >= 7600 ++ return catalog->findPage(pgref); ++#else ++ return catalog->findPage(pgref.num, pgref.gen); ++#endif + } + + // vim:ts=2 sts=2 sw=2 et diff --git a/app-text/pdf2djvu/pdf2djvu-0.9.12.ebuild b/app-text/pdf2djvu/pdf2djvu-0.9.12.ebuild index 069fd000f70f..b4230530cbba 100644 --- a/app-text/pdf2djvu/pdf2djvu-0.9.12.ebuild +++ b/app-text/pdf2djvu/pdf2djvu-0.9.12.ebuild @@ -39,6 +39,10 @@ DOCS=( doc/{changelog,credits,djvudigital,README} ) +PATCHES=( + "${FILESDIR}"/${P}-poppler-0.76-{1,2}.patch +) + pkg_setup() { use test && python-any-r1_pkg_setup } |