pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/print/pdf2djvu



Module Name:    pkgsrc
Committed By:   wiz
Date:           Wed Jun 24 21:57:36 UTC 2026

Modified Files:
        pkgsrc/print/pdf2djvu: Makefile distinfo
Added Files:
        pkgsrc/print/pdf2djvu/patches: patch-pdf-backend.cc
            patch-pdf-backend.hh patch-pdf-dpi.cc patch-pdf-unicode.cc
            patch-system.hh

Log Message:
pdf2djvu: fix build with poppler 26.06.0

Bump PKGREVISION.


To generate a diff of this commit:
cvs rdiff -u -r1.136 -r1.137 pkgsrc/print/pdf2djvu/Makefile
cvs rdiff -u -r1.22 -r1.23 pkgsrc/print/pdf2djvu/distinfo
cvs rdiff -u -r0 -r1.8 pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.cc
cvs rdiff -u -r0 -r1.3 pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.hh \
    pkgsrc/print/pdf2djvu/patches/patch-pdf-dpi.cc \
    pkgsrc/print/pdf2djvu/patches/patch-pdf-unicode.cc \
    pkgsrc/print/pdf2djvu/patches/patch-system.hh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/print/pdf2djvu/Makefile
diff -u pkgsrc/print/pdf2djvu/Makefile:1.136 pkgsrc/print/pdf2djvu/Makefile:1.137
--- pkgsrc/print/pdf2djvu/Makefile:1.136        Thu May 14 16:41:57 2026
+++ pkgsrc/print/pdf2djvu/Makefile      Wed Jun 24 21:57:36 2026
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.136 2026/05/14 16:41:57 ryoon Exp $
+# $NetBSD: Makefile,v 1.137 2026/06/24 21:57:36 wiz Exp $
 
 DISTNAME=      pdf2djvu-0.9.19
-PKGREVISION=   15
+PKGREVISION=   16
 CATEGORIES=    print
 MASTER_SITES=  ${MASTER_SITE_GITHUB:=jwilk/}
 GITHUB_PROJECT=        pdf2djvu
@@ -15,16 +15,18 @@ LICENSE=    gnu-gpl-v2
 
 DEPENDS+=      djvulibre-tools-[0-9]*:../../graphics/djvulibre-tools
 
-FORCE_CXX_STD=         c++20 # For poppler-24.10.0
-
 WRKSRC=                        ${WRKDIR}/${PKGNAME_NOREV}
 GNU_CONFIGURE=         yes
 USE_PKGLOCALEDIR=      yes
-USE_LANGUAGES=         c++17
+USE_LANGUAGES=         c++
+USE_CXX_FEATURES=      c++20
+FORCE_CXX_STD=         c++20 # For poppler-24.10.0
+
 USE_TOOLS+=            pkg-config gmake intltool msgfmt xgettext
 
 CONFIGURE_ARGS+=       --localedir=${PREFIX}/${PKGLOCALEDIR}/locale
-CONFIGURE_ARGS+=       --disable-rpath
+
+CFLAGS+=               -fno-permissive
 
 .include "../../converters/libiconv/buildlink3.mk"
 .include "../../graphics/GraphicsMagick/buildlink3.mk"

Index: pkgsrc/print/pdf2djvu/distinfo
diff -u pkgsrc/print/pdf2djvu/distinfo:1.22 pkgsrc/print/pdf2djvu/distinfo:1.23
--- pkgsrc/print/pdf2djvu/distinfo:1.22 Thu Oct 24 13:37:47 2024
+++ pkgsrc/print/pdf2djvu/distinfo      Wed Jun 24 21:57:36 2026
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.22 2024/10/24 13:37:47 ryoon Exp $
+$NetBSD: distinfo,v 1.23 2026/06/24 21:57:36 wiz Exp $
 
 BLAKE2s (pdf2djvu-0.9.19.tar.xz) = 5c8d49e99261de6846e563edc367abd385be03c097a5ebe62b10f15253a06e1c
 SHA512 (pdf2djvu-0.9.19.tar.xz) = 14d6b217345da6ae8fb9f0fccfb79b86f4448d30d1de1bd2eb537c4eb129f0bdac64ed58c59119f31a837df143490be77050a4b92362a548e08bf8991a03ec41
 Size (pdf2djvu-0.9.19.tar.xz) = 309952 bytes
+SHA1 (patch-pdf-backend.cc) = f71598c13c62ba3a9af5957db062e4d2759141bc
+SHA1 (patch-pdf-backend.hh) = bf73f015f48466fac2140db98bd98237b45a1f0f
+SHA1 (patch-pdf-dpi.cc) = e9b931173c18ccff6bc59d211cc982608b8de672
+SHA1 (patch-pdf-unicode.cc) = d55de68c5155a7d33a67b1beaab2dc66c1634110
+SHA1 (patch-system.hh) = 0bcabb99025440edd56c7df435045d3f296ec6a1

Added files:

Index: pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.cc
diff -u /dev/null pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.cc:1.8
--- /dev/null   Wed Jun 24 21:57:36 2026
+++ pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.cc  Wed Jun 24 21:57:36 2026
@@ -0,0 +1,111 @@
+$NetBSD: patch-pdf-backend.cc,v 1.8 2026/06/24 21:57:36 wiz Exp $
+
+Fix build with poppler 26.06.
+From Arch.
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.01.0.patch?h=pdf2djvu
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.x.patch?h=pdf2djvu
+
+Second chunk was added locally, also needed.
+
+--- pdf-backend.cc.orig        2022-08-09 20:28:01.000000000 +0000
++++ pdf-backend.cc
+@@ -163,7 +163,7 @@ static void cmyk_to_rgb(const double cmyk[], double rg
+   pdf::gfx::RgbColor rgb_cc;
+   for (int i = 0; i < 4; i++)
+     cmyk_cc.c[i] = pdf::gfx::double_as_color_component(cmyk[i]);
+-  cmyk_space.getRGB(&cmyk_cc, &rgb_cc);
++  cmyk_space.getRGB(cmyk_cc, &rgb_cc);
+   rgb[0] = pdf::gfx::color_component_as_double(rgb_cc.r);
+   rgb[1] = pdf::gfx::color_component_as_double(rgb_cc.g);
+   rgb[2] = pdf::gfx::color_component_as_double(rgb_cc.b);
+@@ -175,13 +175,13 @@ static bool annotations_callback(pdf::ant::Annotation 
+   std::string border_color;
+   if (annotation->getType() != pdf::ant::Annotation::typeLink)
+     return true;
+-  pdf::ant::Color *color = annotation->getColor();
++  const AnnotColor* color = annotation->getColor();
+   if (color == nullptr)
+   {
+     border_colors.push_back("");
+     return true;
+   }
+-  const double *values = color->getValues();
++  const double *values = color->getValues().data();
+   switch (color->getSpace())
+   {
+   case pdf::ant::Color::colorTransparent:
+@@ -407,7 +407,11 @@ pdf::Metadata::Metadata(pdf::Document &document)
+     char tzs = 0; int tzh = 0, tzm = 0;
+     if (!pdf::dict_lookup(info_dict, field.first, &object)->isString())
+       continue;
++#if POPPLER_VERSION > 260300
++    const char *input = object.getString().c_str();
++#else
+     const char *input = pdf::get_c_string(object.getString());
++#endif
+     if (input[0] == 'D' && input[1] == ':')
+       input += 2;
+     int year = scan_date_digits(input, 4);
+@@ -470,7 +474,11 @@ pdf::Renderer::Renderer(pdf::splash::Color &paper_colo
+ bool pdf::Environment::antialias = false;
+ 
+ pdf::Renderer::Renderer(pdf::splash::Color &paper_color, bool monochrome)
++#if POPPLER_VERSION > 260100
++: pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, paper_color),
++#else
+ : pdf::splash::OutputDevice(monochrome ? splashModeMono1 : splashModeRGB8, 4, false, paper_color),
++#endif
+   catalog(NULL)
+ {
+   this->setFontAntialias(pdf::Environment::antialias);
+@@ -499,7 +507,12 @@ bool pdf::get_glyph(splash::Splash *splash, splash::Fo
+   if (font == nullptr)
+     return false;
+   splash::ClipResult clip_result;
++#if POPPLER_VERSION > 251200 && POPPLER_VERSION < 260100
++  const SplashClip* clip_ptr = const_cast<SplashClip*>(&splash->getClip());
++  if (!font->getGlyph(code, 0, 0, bitmap, static_cast<int>(x), static_cast<int>(y), clip_ptr, &clip_result))
++#else
+   if (!font->getGlyph(code, 0, 0, bitmap, static_cast<int>(x), static_cast<int>(y), splash->getClip(), &clip_result))
++#endif
+     return false;
+   return (clip_result != splashClipAllOutside);
+ }
+@@ -525,7 +538,11 @@ void pdf::Renderer::convert_path(pdf::gfx::State *stat
+     {
+       double x1, y1, x2, y2, x3, y3;
+       state->transform(subpath->getX(0), subpath->getY(0), &x1, &y1);
++#if POPPLER_VERSION > 260400
++      splash_path.moveTo(x1, y1);
++#else
+       splash_path.moveTo(static_cast<splash::Coord>(x1), static_cast<splash::Coord>(y1));
++#endif
+       int j = 1;
+       int n_points = subpath->getNumPoints();
+       while (j < n_points)
+@@ -535,17 +552,25 @@ void pdf::Renderer::convert_path(pdf::gfx::State *stat
+           state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
+           state->transform(subpath->getX(j + 1), subpath->getY(j + 1), &x2, &y2);
+           state->transform(subpath->getX(j + 2), subpath->getY(j + 2), &x3, &y3);
++#if POPPLER_VERSION > 260400
++          splash_path.curveTo(x1, y1, x2, y2, x3, y3);
++#else
+           splash_path.curveTo(
+             static_cast<splash::Coord>(x1), static_cast<splash::Coord>(y1),
+             static_cast<splash::Coord>(x2), static_cast<splash::Coord>(y2),
+             static_cast<splash::Coord>(x3), static_cast<splash::Coord>(y3)
+           );
++#endif
+           j += 3;
+         }
+         else
+         {
+           state->transform(subpath->getX(j), subpath->getY(j), &x1, &y1);
++#if POPPLER_VERSION > 260400
++          splash_path.lineTo(x1, y1);
++#else
+           splash_path.lineTo(static_cast<splash::Coord>(x1), static_cast<splash::Coord>(y1));
++#endif
+           j++;
+         }
+       }

Index: pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.hh
diff -u /dev/null pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.hh:1.3
--- /dev/null   Wed Jun 24 21:57:36 2026
+++ pkgsrc/print/pdf2djvu/patches/patch-pdf-backend.hh  Wed Jun 24 21:57:36 2026
@@ -0,0 +1,38 @@
+$NetBSD: patch-pdf-backend.hh,v 1.3 2026/06/24 21:57:36 wiz Exp $
+
+Fix build with poppler 26.06.
+From Arch.
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.01.0.patch?h=pdf2djvu
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.x.patch?h=pdf2djvu
+
+--- pdf-backend.hh.orig        2022-08-09 20:28:01.000000000 +0000
++++ pdf-backend.hh
+@@ -26,7 +26,6 @@
+ #include <utility>
+ #include <vector>
+ 
+-#include "autoconf.hh"
+ 
+ // Poppler:
+ #include <PDFDoc.h>
+@@ -49,6 +48,7 @@
+ #include <splash/SplashPath.h>
+ #include <splash/SplashTypes.h>
+ 
++#include "autoconf.hh"
+ #include "i18n.hh"
+ 
+ namespace pdf
+@@ -63,7 +63,12 @@ namespace pdf
+     typedef ::Splash Splash;
+     typedef ::SplashColor Color;
+     typedef ::SplashFont Font;
++#include <poppler-config.h>
++#if POPPLER_VERSION >= 260500
++    typedef double Coord;
++#else
+     typedef ::SplashCoord Coord;
++#endif
+     typedef ::SplashPath Path;
+     typedef ::SplashGlyphBitmap GlyphBitmap;
+     typedef ::SplashBitmap Bitmap;
Index: pkgsrc/print/pdf2djvu/patches/patch-pdf-dpi.cc
diff -u /dev/null pkgsrc/print/pdf2djvu/patches/patch-pdf-dpi.cc:1.3
--- /dev/null   Wed Jun 24 21:57:36 2026
+++ pkgsrc/print/pdf2djvu/patches/patch-pdf-dpi.cc      Wed Jun 24 21:57:36 2026
@@ -0,0 +1,21 @@
+$NetBSD: patch-pdf-dpi.cc,v 1.3 2026/06/24 21:57:36 wiz Exp $
+
+Fix build with poppler 26.06.
+From Arch.
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.01.0.patch?h=pdf2djvu
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.x.patch?h=pdf2djvu
+
+--- pdf-dpi.cc.orig    2022-08-09 20:28:01.000000000 +0000
++++ pdf-dpi.cc
+@@ -91,7 +91,11 @@ void DpiGuessDevice::process_image(pdf::gfx::State *st
+ 
+ void DpiGuessDevice::process_image(pdf::gfx::State *state, int width, int height)
+ {
++#if POPPLER_VERSION > 260100
++  const std::array<double, 6> &ctm = state->getCTM();
++#else
+   const double *ctm = state->getCTM();
++#endif
+   double h_dpi = 72.0 * width / hypot(ctm[0], ctm[1]);
+   double v_dpi = 72.0 * height / hypot(ctm[2], ctm[3]);
+   this->min_ = std::min(this->min_, std::min(h_dpi, v_dpi));
Index: pkgsrc/print/pdf2djvu/patches/patch-pdf-unicode.cc
diff -u /dev/null pkgsrc/print/pdf2djvu/patches/patch-pdf-unicode.cc:1.3
--- /dev/null   Wed Jun 24 21:57:36 2026
+++ pkgsrc/print/pdf2djvu/patches/patch-pdf-unicode.cc  Wed Jun 24 21:57:36 2026
@@ -0,0 +1,31 @@
+$NetBSD: patch-pdf-unicode.cc,v 1.3 2026/06/24 21:57:36 wiz Exp $
+
+Fix build with poppler 26.06.
+From Arch.
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.01.0.patch?h=pdf2djvu
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.x.patch?h=pdf2djvu
+
+--- pdf-unicode.cc.orig        2022-08-09 20:28:01.000000000 +0000
++++ pdf-unicode.cc
+@@ -49,7 +49,7 @@ std::string pdf::string_as_utf8(const pdf::String *str
+      */
+     const static uint32_t replacement_character = 0xFFFD;
+     const char *cstring = pdf::get_c_string(string);
+-    size_t clength = string->getLength();
++    size_t clength = string->size();
+     std::ostringstream stream;
+     if (clength >= 2 && (cstring[0] & 0xFF) == 0xFE && (cstring[1] & 0xFF) == 0xFF) {
+         /* UTF-16-BE Byte Order Mark */
+@@ -105,7 +105,12 @@ std::string pdf::string_as_utf8(pdf::Object &object)
+ 
+ std::string pdf::string_as_utf8(pdf::Object &object)
+ {
++#if POPPLER_VERSION > 260300
++    pdf::String str = pdf::String(object.getString());
++    return pdf::string_as_utf8(&str);
++#else
+     return pdf::string_as_utf8(object.getString());
++#endif
+ }
+ 
+ /* class pdf::FullNFKC
Index: pkgsrc/print/pdf2djvu/patches/patch-system.hh
diff -u /dev/null pkgsrc/print/pdf2djvu/patches/patch-system.hh:1.3
--- /dev/null   Wed Jun 24 21:57:36 2026
+++ pkgsrc/print/pdf2djvu/patches/patch-system.hh       Wed Jun 24 21:57:36 2026
@@ -0,0 +1,18 @@
+$NetBSD: patch-system.hh,v 1.3 2026/06/24 21:57:36 wiz Exp $
+
+Fix build with poppler 26.06.
+From Arch.
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.01.0.patch?h=pdf2djvu
+https://aur.archlinux.org/cgit/aur.git/plain/pdf2djvu-poppler-26.x.patch?h=pdf2djvu
+
+--- system.hh.orig     2022-08-09 20:28:01.000000000 +0000
++++ system.hh
+@@ -223,7 +223,7 @@ namespace encoding
+   protected:
+     const std::string &string;
+   public:
+-    explicit proxy<from, to>(const std::string &string)
++    explicit proxy(const std::string &string)
+     : string(string)
+     { }
+     friend std::ostream &operator << <>(std::ostream &, const proxy<from, to> &);



Home | Main Index | Thread Index | Old Index