Christophe Giboudeaux 2022-09-16 09:01:52 +00:00 committed by Git OBS Bridge
parent f587794a43
commit f53f92b21d
10 changed files with 40 additions and 196 deletions

View File

@ -1,54 +0,0 @@
From 628b168f0b99d39cb20b71eb29683bcb26f85e0a Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Wed, 16 Feb 2022 09:08:11 +0000
Subject: [PATCH 1/3] pdf-backend: fix compat with Poppler > 22.02.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
pdf-backend.cc: In constructor pdf::Document::Document(const string&):
pdf-backend.cc:133:64: error: no matching function for call to PDFDoc::PDFDoc(pdf::String*, std::nullptr_t, std::nullptr_t)
https://cgit.freedesktop.org/poppler/poppler/commit/?id=07889cdfd8a261dc
---
pdf-backend.cc | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/pdf-backend.cc b/pdf-backend.cc
index 3c871b1..c74053d 100644
--- a/pdf-backend.cc
+++ b/pdf-backend.cc
@@ -129,8 +129,27 @@ void pdf::Environment::set_antialias(bool value)
* ===================
*/
+template <typename T>
+class unique_ptr_adapter
+{
+protected:
+ std::unique_ptr<T> uptr;
+public:
+ unique_ptr_adapter(T *ptr)
+ : uptr(ptr)
+ { }
+ operator std::unique_ptr<T> ()
+ {
+ return std::move(this->uptr);
+ }
+ operator T* ()
+ {
+ return this->uptr.release();
+ }
+};
+
pdf::Document::Document(const std::string &file_name)
-: ::PDFDoc(new pdf::String(file_name.c_str()), nullptr, nullptr)
+: ::PDFDoc(unique_ptr_adapter<pdf::String>(new pdf::String(file_name.c_str())), nullptr, nullptr)
{
if (!this->isOk())
throw LoadError();
--
2.35.1

View File

@ -1,36 +0,0 @@
(Patch modified to apply to pdf2djvu 0.9.18.2)
From ec2409d779ac332e29e385f069e1db94ee055e0d Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Wed, 16 Feb 2022 09:10:28 +0000
Subject: [PATCH] main: use pdf::link::Destination copy constructor.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Fixes:
main.cc: In function int get_page_for_goto_link(pdf::link::GoTo*, pdf::Catalog*):
main.cc:92:27: error: const Destination {aka const class LinkDest} has no member named copy
https://cgit.freedesktop.org/poppler/poppler/commit/?id=7a429c3cf9fba67e
---
pdf2djvu.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pdf2djvu.cc b/pdf2djvu.cc
index 2b42d16..bb5fd57 100644
--- a/pdf2djvu.cc
+++ b/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;
--
2.35.1

View File

@ -1,31 +0,0 @@
From 9e51203dd9db9a8c1332fc8a9a1d49334dcd80a6 Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Thu, 17 Feb 2022 00:26:41 +0100
Subject: [PATCH 2/3] pdf-backend: fix compat with Poppler > 22.02.
Fixes:
pdf-backend.cc:152:3: error: no matching constructor for initialization of '::PDFDoc'
/usr/include/poppler/PDFDoc.h:132:14: note: candidate constructor not viable: no known conversion from 'nullptr_t' to 'const std::optional<GooString>' for 2nd argument
https://cgit.freedesktop.org/poppler/poppler/commit/?id=4f2abd3efa1ee013
---
pdf-backend.cc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/pdf-backend.cc b/pdf-backend.cc
index c74053d..ba85da2 100644
--- a/pdf-backend.cc
+++ b/pdf-backend.cc
@@ -149,7 +149,7 @@ public:
};
pdf::Document::Document(const std::string &file_name)
-: ::PDFDoc(unique_ptr_adapter<pdf::String>(new pdf::String(file_name.c_str())), nullptr, nullptr)
+: ::PDFDoc(unique_ptr_adapter<pdf::String>(new pdf::String(file_name.c_str())))
{
if (!this->isOk())
throw LoadError();
--
2.35.1

View File

@ -1,49 +0,0 @@
From 0b9bb9a67211c7b23d2323ce4585f8a3dafd73d8 Mon Sep 17 00:00:00 2001
From: Jakub Wilk <jwilk@jwilk.net>
Date: Wed, 2 Mar 2022 10:40:37 +0000
Subject: [PATCH 3/3] pdf-backend: simplify Poppler 22.03 compat code.
---
pdf-backend.cc | 25 +++++--------------------
1 file changed, 5 insertions(+), 20 deletions(-)
diff --git a/pdf-backend.cc b/pdf-backend.cc
index ba85da2..8fab764 100644
--- a/pdf-backend.cc
+++ b/pdf-backend.cc
@@ -129,27 +129,12 @@ void pdf::Environment::set_antialias(bool value)
* ===================
*/
-template <typename T>
-class unique_ptr_adapter
-{
-protected:
- std::unique_ptr<T> uptr;
-public:
- unique_ptr_adapter(T *ptr)
- : uptr(ptr)
- { }
- operator std::unique_ptr<T> ()
- {
- return std::move(this->uptr);
- }
- operator T* ()
- {
- return this->uptr.release();
- }
-};
-
pdf::Document::Document(const std::string &file_name)
-: ::PDFDoc(unique_ptr_adapter<pdf::String>(new pdf::String(file_name.c_str())))
+#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();
--
2.35.1

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9ea03f21d841a336808d89d65015713c0785e7295a6559d77771dc795333a9fa
size 305912

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEzbWhJDrNtjAJrQchLU6zpgFUdfUFAmGb12cACgkQLU6zpgFU
dfXBbw//bF34jO7yu74pcQtr/jQpJmaYS67oxk/hVUTbhptCTq4FwajPYD4FdMUb
ggPPDaGoYizU7nQp29EsqP5kWBVGlEP5zpRUdDZn8Vx4xdkweIgOtnoNinRbZsqL
iGZ4POi8lHz0BSsFCOVUVLtt5Y6xTN7Foykg+0gUbYBj4faCKtfBu2UTqwR0mjON
PcgqYloDUfIXJ9mcDtt/+XoFcUrelbawIOko5UbjgCGFHEVBnyeZERH2i6LHwT/E
SQYUAU10eC9Dq9AZimSo0MrkTbJKPFZnEdA/t42zb1y7wwYjbh2QI0+lGOVSjgkt
8okTkXIDfxK+mxrX3zlpHSv9+KHArsj4jjh0aAjHAD5x4Wy+SKgZXtFwy87wEaIh
DUp0Q8ixKAbkqIVvwDd1pxh81aDHvmL/au2tPEpF/KnG3VLFrwY/UJHNv1fbUyru
Vb6nGA2uKQCwikNTw1pE77qQYqNR5HWQjT2FCIxdm6GHDZOoDcxTZgFnYQHdoyxZ
goAgk4irURnVPzMl8Siu3Pw8mqzkhL7eBpPxb/4wD+V1po5rAoAumXtDVrOomCyC
tEsQY9K9l4gW1Poncspi0I6KMZ/VP9/2Ij9j63AE8IlBJZ3irGuV+0riBVDmqtv2
FOcc5Lmi7SIbrzdSEYaZxJURfAnf72CwlzIShlaIkuTC4aK2sDs=
=JuUe
-----END PGP SIGNATURE-----

3
pdf2djvu-0.9.19.tar.xz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eb45a480131594079f7fe84df30e4a5d0686f7a8049dc7084eebe22acc37aa9a
size 309952

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEzbWhJDrNtjAJrQchLU6zpgFUdfUFAmLyxwgACgkQLU6zpgFU
dfV4ZRAAmDDe5edkTRSvaJbJaKO8iMjBiGn7yRbO5WKZ1jIOphljygybf9W5Eqfb
WHV5ADxiLgEjtCOvTkpnQ146AQUjvUAP21rpI9OwUp3MbOaxPqF3T6NJMfWgUrN/
3EiQWxvuiud+FvIZS3O3aVBdkFeHCJ5iMWd8BV5Jx03rH3JV+gNp1PNbAGw/mUvO
xuPZtbu2rypQ+Rs686poxUmWMd6HODx7c3nU/KAKzVI+/Fgel4+0G0VHJMs9ye1A
Ptm3gvXb1LUBaVtyMhO5V9zC0qclUPp2dnM++DdNLhPln8u5a7j6CD8wnLr7lOAj
YdZntZ/F6dAPSDpbH+vLHtQZfi+yPnRz6D4Gr9U7hGDF3sL/0oHTqulRNBpQwEtp
lvB4Z0BxFQVz7qCGzGnnNZAJw+IRq2Gxqm+Hp9xY8fe0e7x7eYkUFMe4VlNbmH35
Z5DFpafXdo5MHqHXEQE972g62MuuGWa+TSYtYOZhTFRGLynp417jgiCFSVAMU6dt
m3GqDER3IMRvA6cISSL6AjmQ//mKb/Sjytqj/k7M6B65tjZl4xJT7lAi5OmdFSOq
wehVr3Xa2Q9H4DAlBN3+bOTpC1TclR0niCOvaTAUXdEmwfO602x+YDg6oPzrX78A
rmxSX4EUc/o6jGbDFDsCXTJbp5V8Jw8IYgUiL5FkBOsNlHB2kW8=
=oFH5
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,22 @@
-------------------------------------------------------------------
Fri Sep 16 08:53:25 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 0.9.19
* Fix build failure with Poppler ≥ 22.03.
* When converting PDF strings to UTF-8, keep non-characters
intact.
* Improve warning message for (unhandled) reset-form actions.
* Improve handling of Poppler memory allocation failures.
* Update the Polish translation.
* Drop support for Poppler < 0.62.
* Improve the configure script
* Improve the test suite
- Drop patches, no longer needed:
* 0001-pdf-backend-fix-compat-with-Poppler-22.02.patch
* 0002-main-use-pdf-link-Destination-copy-constructor.patch
* 0003-pdf-backend-fix-compat-with-Poppler-22.02.patch
* 0004-pdf-backend-simplify-Poppler-22.03-compat-code.patch
-------------------------------------------------------------------
Thu Apr 14 08:24:32 UTC 2022 - Max Lin <mlin@suse.com>

View File

@ -17,7 +17,7 @@
Name: pdf2djvu
Version: 0.9.18.2
Version: 0.9.19
Release: 0
Summary: PDF to DjVu Converter
License: GPL-2.0-only
@ -26,18 +26,13 @@ URL: https://jwilk.net/software/pdf2djvu
Source0: https://github.com/jwilk/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz
Source1: https://github.com/jwilk/%{name}/releases/download/%{version}/%{name}-%{version}.tar.xz.asc
Source2: %{name}.keyring
# PATCH-FIX-UPSTREAM poppler...
Patch0: 0001-pdf-backend-fix-compat-with-Poppler-22.02.patch
Patch1: 0002-main-use-pdf-link-Destination-copy-constructor.patch
Patch2: 0003-pdf-backend-fix-compat-with-Poppler-22.02.patch
Patch3: 0004-pdf-backend-simplify-Poppler-22.03-compat-code.patch
BuildRequires: djvulibre
BuildRequires: gcc-c++
BuildRequires: pkgconfig
BuildRequires: pkgconfig(GraphicsMagick++)
BuildRequires: pkgconfig(ddjvuapi) >= 3.5.25
BuildRequires: pkgconfig(exiv2)
BuildRequires: pkgconfig(poppler) >= 0.35
BuildRequires: pkgconfig(poppler) >= 0.62
BuildRequires: pkgconfig(uuid)
Requires: djvulibre