Dominique Leuenberger 2022-03-17 16:01:35 +00:00 committed by Git OBS Bridge
commit d1688daf89
10 changed files with 212 additions and 22 deletions

View File

@ -0,0 +1,54 @@
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

@ -0,0 +1,36 @@
(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

@ -0,0 +1,31 @@
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

@ -0,0 +1,49 @@
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:ab45d7c70ba837f01e6b5b5c18acf8af6200dad4bae8e47e4c2ca01fbf2fa930
size 304492

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEzbWhJDrNtjAJrQchLU6zpgFUdfUFAmFm2UkACgkQLU6zpgFU
dfV//A//T1d2jwVzM8wxGiw7VQf2UZVqS0RdK+dVtyNSFkXZgEeyD14f6ppKoBYP
oGbKTzVDS89o561DNAM7/7GRtxYMZdlYaqkXZxnO9u+SN1F91ieZRAzhSF0L/QuA
JSDM5laxptAHAhLOuqSUKtVsXT/QNYKsBJqydbHJ3DS4fscbUEO9X7uAIYTcfPBY
wPvb6zoboFZgc/076HP6msNYKepGv5FX53PQnOjBa7FAxeD/++yVLsROe8hlYQeA
lLt9xWufuyAvcDy+xu/OGrUDLN0hB0CUR0Waopiqou5tyBllH9KuaQThghlyCKsU
SFP/8JnY4BjEZ0URM6ZSVLE6QdN5RzCrJoeKlADZwIDbnMPJ0RlAWDI/Q756GpHf
dntrRgbSlAVIHZ0uUw9u1wsj1e75HL/BxOleluZnKlIQDmr1HIxD4GH63JB6dUZ0
Uc6rUfKv9aT3T+u8woeKD0OrAgk1bL8Gr65zdfeQOwmSzGeMZzPGb+LlJMHVUNiS
3cj30jz7c9rf18kdUofa5Onnki/C8eTTdbAZxXOfvaiVymssp9cR6Y13LJlAiXYG
jEpHZcgNeJZVwk1QoeW3yDdnCQUgbH5AJakpnSEpYf4jtAORkxTQf1xqKjuOyB73
cJ1OBmXPTtcbfosQXW60lZKh9P/v0d9u0WVGbWtSHmywtc/Xx3s=
=ZPIM
-----END PGP SIGNATURE-----

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

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

View File

@ -0,0 +1,16 @@
-----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-----

View File

@ -1,3 +1,18 @@
-------------------------------------------------------------------
Wed Mar 16 09:30:48 UTC 2022 - Christophe Giboudeaux <christophe@krop.fr>
- Update to 0.9.18.2:
* Document minimum required Exiv2 version.
* Fix build failure with upcoming Exiv2 1.0.
* Remove spurious zero-width spaces from the Ukrainian manual
page.
* Improve the test suite
- Add upstream changes:
* 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
-------------------------------------------------------------------
Sat Oct 23 18:23:43 UTC 2021 - Christophe Giboudeaux <christophe@krop.fr>

View File

@ -1,7 +1,7 @@
#
# spec file for package pdf2djvu
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -17,7 +17,7 @@
Name: pdf2djvu
Version: 0.9.18.1
Version: 0.9.18.2
Release: 0
Summary: PDF to DjVu Converter
License: GPL-2.0-only
@ -26,6 +26,11 @@ 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
@ -44,7 +49,7 @@ metadata (including XMP metadata).
%lang_package
%prep
%autosetup
%autosetup -p1
%build
%configure