Bug#1012845: pdftoipe: Patch for compatibility with Poppler >22.03

Nathan Pratta Teodosio nathan.teodosio at canonical.com
Wed Jun 15 13:26:01 BST 2022


Package: pdftoipe
Severity: normal
Tags: patch
X-Debbugs-Cc: nathan.teodosio at canonical.com

Dear Maintainer,

Since Poppler 22.06 is made its way into experimental, Pdftoipe will need
compatibility changes to build. I got the merge request from
https://github.com/otfried/ipe-
tools/pull/48/commits/14335180432152ad094300d0afd00d8e390469b2 and adapted it
so that it doesn't break builds with previous Poppler versions.

The result is in the attached patch. With Sbuilder I made sure it builds
against both current and new Poppler.


-- System Information:
Debian Release: bookworm/sid
  APT prefers kinetic
  APT policy: (500, 'kinetic')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.15.0-33-generic (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=pt_BR.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pdftoipe depends on:
ii  libc6          2.35-0ubuntu3
ii  libgcc-s1      12.1.0-2ubuntu1
pn  libpoppler118  <none>
ii  libstdc++6     12.1.0-2ubuntu1

Versions of packages pdftoipe recommends:
pn  ipe  <none>

pdftoipe suggests no packages.

*** /home/nteodosio/canonical/debian-updates/poppler/ipetools.diff
diff -Nru ipe-tools-7.2.24.1/debian/changelog ipe-tools-7.2.24.1/debian/changelog
--- ipe-tools-7.2.24.1/debian/changelog	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/changelog	2022-06-15 09:06:32.000000000 -0300
@@ -1,3 +1,11 @@
+ipe-tools (1:7.2.24.1-2) UNRELEASED; urgency=medium
+
+  [ Nathan Pratta Teodosio ]
+  * build-with-poppler-22.03.patch: Fix build for poppler 22.03.
+  * d/control: Build depends on libpoppler-cpp-dev.
+
+ -- Nathan Pratta Teodosio <nathan.teodosio at canonical.com>  Wed, 15 Jun 2022 09:06:32 -0300
+
 ipe-tools (1:7.2.24.1-1) unstable; urgency=medium
 
   [ Steve Robbins ]
diff -Nru ipe-tools-7.2.24.1/debian/control ipe-tools-7.2.24.1/debian/control
--- ipe-tools-7.2.24.1/debian/control	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/control	2022-06-15 09:05:56.000000000 -0300
@@ -8,7 +8,8 @@
                dh-python,
                python3:any | python3-all:any | python3-dev:any | python3-all-dev:any | dh-sequence-python3,
                pkg-config,
-               libpoppler-private-dev
+               libpoppler-private-dev,
+               libpoppler-cpp-dev
 Standards-Version: 4.1.3
 Vcs-Browser: https://salsa.debian.org/science-team/ipe-tools
 Vcs-Git: https://salsa.debian.org/science-team/ipe-tools.git
diff -Nru ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch
--- ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch	1969-12-31 21:00:00.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch	2022-06-15 09:06:32.000000000 -0300
@@ -0,0 +1,42 @@
+Author: Nathan Pratta Teodosio <nathan.teodosio at canonical.com>, oreo639
+Description: Fix build for poppler >22.03
+
+--- a/pdftoipe/pdftoipe.cpp	2022-06-15 08:45:57.248773786 -0300
++++ b/pdftoipe/pdftoipe.cpp	2022-06-15 08:45:23.915883939 -0300
+@@ -7,6 +7,7 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <string.h>
++#include <poppler/cpp/poppler-version.h>
+ 
+ #include "goo/GooString.h"
+ #include "goo/gmem.h"
+@@ -84,6 +85,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
++#if POPPLER_VERSION_MAJOR > 22 || (POPPLER_VERSION_MAJOR == 22 && POPPLER_VERSION_MINOR >= 3)
++  std::optional<GooString> ownerPW, userPW;
++  if (ownerPassword[0]) {
++    ownerPW = GooString(ownerPassword);
++  } else {
++    ownerPW = std::nullopt;
++  }
++  if (userPassword[0]) {
++    userPW = GooString(userPassword);
++  } else {
++    userPW = std::nullopt;
++  }
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
++#else
+   GooString *ownerPW, *userPW;
+   if (ownerPassword[0]) {
+     ownerPW = new GooString(ownerPassword);
+@@ -100,6 +115,7 @@
+   PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+   delete userPW;
+   delete ownerPW;
++#endif
+ 
+   if (!doc->isOk())
+     return 1;
diff -Nru ipe-tools-7.2.24.1/debian/patches/series ipe-tools-7.2.24.1/debian/patches/series
--- ipe-tools-7.2.24.1/debian/patches/series	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/patches/series	2022-06-15 09:06:32.000000000 -0300
@@ -1 +1,2 @@
+build-with-poppler-22.03.patch
 cross.patch
-------------- next part --------------
diff -Nru ipe-tools-7.2.24.1/debian/changelog ipe-tools-7.2.24.1/debian/changelog
--- ipe-tools-7.2.24.1/debian/changelog	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/changelog	2022-06-15 09:06:32.000000000 -0300
@@ -1,3 +1,11 @@
+ipe-tools (1:7.2.24.1-2) UNRELEASED; urgency=medium
+
+  [ Nathan Pratta Teodosio ]
+  * build-with-poppler-22.03.patch: Fix build for poppler 22.03.
+  * d/control: Build depends on libpoppler-cpp-dev.
+
+ -- Nathan Pratta Teodosio <nathan.teodosio at canonical.com>  Wed, 15 Jun 2022 09:06:32 -0300
+
 ipe-tools (1:7.2.24.1-1) unstable; urgency=medium
 
   [ Steve Robbins ]
diff -Nru ipe-tools-7.2.24.1/debian/control ipe-tools-7.2.24.1/debian/control
--- ipe-tools-7.2.24.1/debian/control	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/control	2022-06-15 09:05:56.000000000 -0300
@@ -8,7 +8,8 @@
                dh-python,
                python3:any | python3-all:any | python3-dev:any | python3-all-dev:any | dh-sequence-python3,
                pkg-config,
-               libpoppler-private-dev
+               libpoppler-private-dev,
+               libpoppler-cpp-dev
 Standards-Version: 4.1.3
 Vcs-Browser: https://salsa.debian.org/science-team/ipe-tools
 Vcs-Git: https://salsa.debian.org/science-team/ipe-tools.git
diff -Nru ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch
--- ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch	1969-12-31 21:00:00.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/patches/build-with-poppler-22.03.patch	2022-06-15 09:06:32.000000000 -0300
@@ -0,0 +1,42 @@
+Author: Nathan Pratta Teodosio <nathan.teodosio at canonical.com>, oreo639
+Description: Fix build for poppler >22.03
+
+--- a/pdftoipe/pdftoipe.cpp	2022-06-15 08:45:57.248773786 -0300
++++ b/pdftoipe/pdftoipe.cpp	2022-06-15 08:45:23.915883939 -0300
+@@ -7,6 +7,7 @@
+ #include <stdlib.h>
+ #include <stddef.h>
+ #include <string.h>
++#include <poppler/cpp/poppler-version.h>
+ 
+ #include "goo/GooString.h"
+ #include "goo/gmem.h"
+@@ -84,6 +85,20 @@
+   if (quiet)
+     globalParams->setErrQuiet(quiet);
+ 
++#if POPPLER_VERSION_MAJOR > 22 || (POPPLER_VERSION_MAJOR == 22 && POPPLER_VERSION_MINOR >= 3)
++  std::optional<GooString> ownerPW, userPW;
++  if (ownerPassword[0]) {
++    ownerPW = GooString(ownerPassword);
++  } else {
++    ownerPW = std::nullopt;
++  }
++  if (userPassword[0]) {
++    userPW = GooString(userPassword);
++  } else {
++    userPW = std::nullopt;
++  }
++  PDFDoc *doc = new PDFDoc(std::make_unique<GooString>(fileName), ownerPW, userPW);
++#else
+   GooString *ownerPW, *userPW;
+   if (ownerPassword[0]) {
+     ownerPW = new GooString(ownerPassword);
+@@ -100,6 +115,7 @@
+   PDFDoc *doc = new PDFDoc(fileName, ownerPW, userPW);
+   delete userPW;
+   delete ownerPW;
++#endif
+ 
+   if (!doc->isOk())
+     return 1;
diff -Nru ipe-tools-7.2.24.1/debian/patches/series ipe-tools-7.2.24.1/debian/patches/series
--- ipe-tools-7.2.24.1/debian/patches/series	2022-02-19 15:56:57.000000000 -0300
+++ ipe-tools-7.2.24.1/debian/patches/series	2022-06-15 09:06:32.000000000 -0300
@@ -1 +1,2 @@
+build-with-poppler-22.03.patch
 cross.patch


More information about the debian-science-maintainers mailing list