[pdf2djvu] Fix building of pdf2djvu with poppler-0.20.x
mkasik
mkasik at fedoraproject.org
Mon Jul 2 13:38:02 UTC 2012
commit 51ece1b3f443fe603355e0f4229b46d714c04cb1
Author: Marek Kasik <mkasik at redhat.com>
Date: Mon Jul 2 15:37:31 2012 +0200
Fix building of pdf2djvu with poppler-0.20.x
Resolves: #822407
pdf2djvu-0.7.4-poppler-0.20.0.patch | 75 +++++++++++++++++++++++++++++++++++
pdf2djvu.spec | 8 +++-
2 files changed, 82 insertions(+), 1 deletions(-)
---
diff --git a/pdf2djvu-0.7.4-poppler-0.20.0.patch b/pdf2djvu-0.7.4-poppler-0.20.0.patch
new file mode 100644
index 0000000..87dfd83
--- /dev/null
+++ b/pdf2djvu-0.7.4-poppler-0.20.0.patch
@@ -0,0 +1,75 @@
+--- pdf2djvu-0.7.4/pdf2djvu.cc 2010-06-12 22:20:36.000000000 +0200
++++ pdf2djvu-0.7.4/pdf2djvu.cc 2012-07-02 15:22:37.000000000 +0200
+@@ -1334,15 +1334,27 @@ static int xmain(int argc, char * const
+ doc.reset(new pdf::Document(config.file_name));
+ assert(out1.get() == NULL);
+ out1.reset(new pdf::Renderer(paper_color, config.monochrome));
++#if POPPLER_VERSION < 1900
+ out1->startDoc(doc->getXRef());
++#else
++ out1->startDoc(doc.get());
++#endif
+ assert(outm.get() == NULL);
+ outm.reset(new MutedRenderer(paper_color, config.monochrome, *page_files));
++#if POPPLER_VERSION < 1900
+ outm->startDoc(doc->getXRef());
++#else
++ outm->startDoc(doc.get());
++#endif
+ assert(outs.get() == NULL);
+ if (!config.monochrome)
+ {
+ outs.reset(new MutedRenderer(paper_color, config.monochrome, *page_files));
++#if POPPLER_VERSION < 1900
+ outs->startDoc(doc->getXRef());
++#else
++ outs->startDoc(doc.get());
++#endif
+ }
+ }
+ assert(doc.get() != NULL);
+--- pdf2djvu-0.7.4/pdf-backend.cc 2010-06-12 22:20:36.000000000 +0200
++++ pdf2djvu-0.7.4/pdf-backend.cc 2012-07-02 15:24:39.000000000 +0200
+@@ -32,6 +32,7 @@
+ * ======================
+ */
+
++#if POPPLER_VERSION < 1900
+ static void poppler_error_handler(int pos, char *message, va_list args)
+ {
+ std::string format;
+@@ -49,6 +50,22 @@ static void poppler_error_handler(int po
+ }
+ error_log << std::endl;
+ }
++#else
++static void poppler_error_handler(void *data, ErrorCategory category, int pos, char *msg)
++{
++ if (pos >= 0)
++ {
++ error_log <<
++ string_printf(_("PDF error (%d): %s"), pos, msg);
++ }
++ else
++ {
++ error_log <<
++ string_printf(_("PDF error: %s"), msg);
++ }
++ error_log << std::endl;
++}
++#endif
+
+ pdf::Environment::Environment(const char *argv0)
+ {
+@@ -61,7 +78,11 @@ pdf::Environment::Environment(const char
+ Cwd cwd(argv0_dir_name);
+ #endif
+ globalParams = new GlobalParams();
++#if POPPLER_VERSION < 1900
+ setErrorFunction(poppler_error_handler);
++#else
++ setErrorCallback(poppler_error_handler, NULL);
++#endif
+ }
+
+ void pdf::Environment::set_antialias(bool value)
diff --git a/pdf2djvu.spec b/pdf2djvu.spec
index 602cbce..896bbe6 100644
--- a/pdf2djvu.spec
+++ b/pdf2djvu.spec
@@ -1,6 +1,6 @@
Name: pdf2djvu
Version: 0.7.4
-Release: 14%{?dist}
+Release: 15%{?dist}
Summary: PDF to DjVu converter
Group: Applications/Publishing
License: GPLv2+
@@ -8,6 +8,7 @@ URL: http://pdf2djvu.googlecode.com/
Source0: http://pdf2djvu.googlecode.com/files/%{name}_%{version}.tar.gz
Patch1: throw-specifier.patch
Patch2: annot-link.patch
+Patch3: pdf2djvu-0.7.4-poppler-0.20.0.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -29,6 +30,7 @@ metadata.
%patch1 -p1 -b .throw-specifier
%patch2 -p1 -b .annot-link
+%patch3 -p1 -b .poppler-0.20
%build
%configure
@@ -52,6 +54,10 @@ rm -rf $RPM_BUILD_ROOT
%changelog
+* Mon Jul 2 2012 Marek Kasik <mkasik at redhat.com> - 0.7.4-15
+- Fix building of pdf2djvu with poppler-0.20.x
+- Resolves: #822407
+
* Mon Jul 2 2012 Marek Kasik <mkasik at redhat.com> - 0.7.4-14
- Rebuild (poppler-0.20.1)
More information about the scm-commits
mailing list