Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pdf2djvu: apply upstream fixes for poppler 22.03.0 #14389

Merged
merged 1 commit into from Mar 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion graphics/pdf2djvu/Portfile
Expand Up @@ -4,7 +4,7 @@ PortSystem 1.0
PortGroup github 1.0

github.setup jwilk pdf2djvu 0.9.18.2
revision 1
revision 2
categories graphics textproc
platforms darwin
license GPL-2
Expand Down Expand Up @@ -35,6 +35,9 @@ depends_lib port:djvulibre \
patchfiles patch-i18n.hh.diff \
patch-sys-uuid.diff

# https://trac.macports.org/ticket/64899
patchfiles-append patch-poppler-22.03.0.diff

configure.cxxflags-append -std=c++17
compiler.cxx_standard 2017

Expand Down
33 changes: 33 additions & 0 deletions graphics/pdf2djvu/files/patch-poppler-22.03.0.diff
@@ -0,0 +1,33 @@
Upstream-Status: Backport


diff --git a/pdf2djvu.cc b/pdf2djvu.cc
index 2b42d16..bb5fd57 100644
--- pdf2djvu.cc.orig
+++ pdf2djvu.cc
@@ -89,7 +89,7 @@ static int get_page_for_goto_link(pdf::link::GoTo *goto_link, pdf::Catalog *cata
#endif
}
else
- dest.reset(orig_dest->copy());
+ dest.reset(new pdf::link::Destination(*orig_dest));
if (dest.get() != nullptr)
{
int page;
diff --git a/pdf-backend.cc b/pdf-backend.cc
index 3c871b1..8fab764 100644
--- pdf-backend.cc.orig
+++ pdf-backend.cc
@@ -130,7 +130,11 @@ void pdf::Environment::set_antialias(bool value)
*/

pdf::Document::Document(const std::string &file_name)
-: ::PDFDoc(new pdf::String(file_name.c_str()), nullptr, nullptr)
+#if POPPLER_VERSION >= 220300
+: ::PDFDoc(std::make_unique<pdf::String>(file_name.c_str()))
+#else
+: ::PDFDoc(new pdf::String(file_name.c_str()))
+#endif
{
if (!this->isOk())
throw LoadError();