Debian and Gentoo use a version of xpdf 3 that has been modified to
use Poppler. The fork is currently maintained by Adam Samson at
https://offog.org/code/xpopple/ and regularly gets updates for new
Poppler versions.
I wonder about moving our version across; what does anyone think?
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/xpdf3/Makefile,v
diff -u -p -r1.2 Makefile
--- Makefile 10 Nov 2026 12:17:04 -0000 1.2
+++ Makefile 12 Nov 2026 18:52:00 -0000
@@ -1,39 +1,31 @@
-COMMENT= PDF viewer for X11
+COMMENT= PDF viewer for X11 using poppler
-V= 3.04
-DISTNAME= xpdf-${V}
-PKGNAME= xpdf3-${V}
+V= 20261106
+DISTNAME= xpopple-0.0.$V
+PKGNAME= xpdf3-3.04pl$V
CATEGORIES= textproc x11
-SITES= https://dl.xpdfreader.com/old/
+HOMEPAGE= https://offog.org/code/xpopple/
-HOMEPAGE= https://www.xpdfreader.com/
+# tarred from git checkout; http://offog.org/git/xpopple.git
+SITES= https://spacehopper.org/mirrors/
-# GPLv2 only or GPLv3 only or both (at our choice)
+# GPLv2 only, GPLv3 only, or GPLv2/v3 (at our choice)
PERMIT_PACKAGE= Yes
-LIB_DEPENDS+= x11/motif
-USE_GMAKE= Yes
-CONFIGURE_STYLE=gnu
-CONFIGURE_ARGS= --enable-multithreaded \
- --without-Sgm-library \
- --without-libpaper-library
-
-CONFIGURE_ENV= CPPFLAGS='-I${X11BASE}/include/freetype2 -I${X11BASE}/include
-I${LOCALBASE}/include -DLOCALBASE="\"${LOCALBASE}\""' \
- LDFLAGS="-L${X11BASE}/lib -L${LOCALBASE}/lib -lm -lz"
-MAKE_ENV+=MOTIFLIB='-L${LOCALBASE}/lib -lXm'
+WANTLIB += ${COMPILER_LIBCXX} X11 Xm Xt c m paper poppler
-RUN_DEPENDS= print/ghostscript/gnu-fonts
+COMPILER= base-clang ports-gcc
+
+LIB_DEPENDS= print/libpaper \
+ print/poppler \
+ x11/motif
-WANTLIB= ICE SM X11 Xext Xpm Xt freetype Xm \
- c m pthread ${COMPILER_LIBCXX} z
+RUN_DEPENDS= print/ghostscript/gnu-fonts
-COMPILER = base-clang ports-gcc base-gcc
+CONFIGURE_STYLE= gnu
NO_TEST= Yes
-
-# others are already in xpdf>=4 and popper-utils
-ALL_TARGET= xpdf
do-install:
${INSTALL_PROGRAM} ${WRKBUILD}/xpdf/xpdf ${PREFIX}/bin/xpdf3
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/xpdf3/distinfo,v
diff -u -p -r1.1.1.1 distinfo
--- distinfo 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ distinfo 12 Nov 2026 18:52:00 -0000
@@ -1,2 +1,2 @@
-SHA256 (xpdf-3.04.tar.gz) = ETkMdHM6vLJiqspNtocQ8T///UK/4qCGGl38kSspd+U=
-SIZE (xpdf-3.04.tar.gz) = 825519
+SHA256 (xpopple-0.0.20261106.tar.gz) =
6os3mzENJEIUU6TlCIQNbdpcMUDLmJacODNGswhfgNc=
+SIZE (xpopple-0.0.20261106.tar.gz) = 455725
Index: patches/patch-Makefile_in
===================================================================
RCS file: /cvs/ports/textproc/xpdf3/patches/patch-Makefile_in,v
diff -u -p -r1.1.1.1 patch-Makefile_in
--- patches/patch-Makefile_in 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ patches/patch-Makefile_in 12 Nov 2026 18:52:00 -0000
@@ -1,16 +1,12 @@
Index: Makefile.in
--- Makefile.in.orig
+++ Makefile.in
-@@ -67,6 +67,12 @@ pdfdetach:
- cd @UP_DIR@splash; $(MAKE)
- cd @UP_DIR@xpdf; $(MAKE) pdfdetach$(EXE)
+@@ -541,7 +541,7 @@ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
+ top_srcdir = @top_srcdir@
+ xpdf_xpdf_CPPFLAGS = \
+- -DSYSTEM_XPDFRC=\"$(sysconfdir)/xpdf/xpdfrc\" \
++ -DSYSTEM_XPDFRC=\"$(sysconfdir)/xpdfrc3\" \
+ -I$(srcdir)/goo
-+pdftopng:
-+ cd goo; $(MAKE)
-+ cd @UP_DIR@fofi; $(MAKE)
-+ cd @UP_DIR@splash; $(MAKE)
-+ cd @UP_DIR@xpdf; $(MAKE) pdftopng$(EXE)
-+
- pdftoppm:
- cd goo; $(MAKE)
- cd @UP_DIR@fofi; $(MAKE)
+ xpdf_xpdf_SOURCES = \
Index: patches/patch-configure
===================================================================
RCS file: patches/patch-configure
diff -N patches/patch-configure
--- patches/patch-configure 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-Add "3" suffix to default user config file
-
-Index: configure
---- configure.orig
-+++ configure
-@@ -2453,7 +2453,7 @@ if test "$sysconfdir" = '${prefix}/etc'; then
- system_xpdfrc="$prefix/etc/xpdfrc"
- fi
- else
-- system_xpdfrc="$sysconfdir/xpdfrc"
-+ system_xpdfrc="$sysconfdir/xpdfrc3"
- fi
- cat >>confdefs.h <<_ACEOF
- #define SYSTEM_XPDFRC "$system_xpdfrc"
Index: patches/patch-doc_sample-xpdfrc
===================================================================
RCS file: /cvs/ports/textproc/xpdf3/patches/patch-doc_sample-xpdfrc,v
diff -u -p -r1.1.1.1 patch-doc_sample-xpdfrc
--- patches/patch-doc_sample-xpdfrc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ patches/patch-doc_sample-xpdfrc 12 Nov 2026 18:52:00 -0000
@@ -1,6 +1,18 @@
---- doc/sample-xpdfrc.orig Wed May 28 20:50:50 2014
-+++ doc/sample-xpdfrc Fri May 30 14:26:13 2014
-@@ -56,7 +56,7 @@
+Index: doc/sample-xpdfrc
+--- doc/sample-xpdfrc.orig
++++ doc/sample-xpdfrc
+@@ -3,8 +3,8 @@
+ # Sample xpdfrc file
+ #
+ # The Xpdf tools look for a config file in two places:
+-# 1. ~/.xpdfrc
+-# 2. in a system-wide directory, typically /usr/local/etc/xpdfrc
++# 1. ~/.xpdfrc3
++# 2. in a system-wide directory, typically /etc/xpdfrc
+ #
+ # This sample config file demonstrates some of the more common
+ # configuration options. Everything here is commented out. You
+@@ -48,7 +48,7 @@
# Set the default PostScript file or command.
@@ -9,7 +21,7 @@
# Set the default PostScript paper size -- this can be letter, legal,
# A4, or A3. You can also specify a paper size as width and height
-@@ -87,5 +87,5 @@
+@@ -69,5 +69,5 @@
# Set the command used to run a web browser when a URL hyperlink is
# clicked.
Index: patches/patch-doc_xpdfrc_5
===================================================================
RCS file: patches/patch-doc_xpdfrc_5
diff -N patches/patch-doc_xpdfrc_5
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-doc_xpdfrc_5 12 Nov 2026 18:52:00 -0000
@@ -0,0 +1,25 @@
+Index: doc/xpdfrc.5
+--- doc/xpdfrc.5.orig
++++ doc/xpdfrc.5
+@@ -5,10 +5,10 @@
+ xpdfrc \- configuration file for xpdf (xpopple)
+ .SH DESCRIPTION
+ The xpdf program reads a single configuration file. If you have a
+-.I .xpdfrc
++.I .xpdfrc3
+ file in your home directory, it will be read. Otherwise, a
+ system-wide configuration file will be read from
+-.IR /etc/xpdf/xpdfrc ,
++.IR /etc/xpdfrc3 ,
+ if it exists. (This is its default location; depending on build
+ options, it may be placed elsewhere.)
+ .PP
+@@ -454,7 +454,7 @@ urlCommand "netscape \-remote 'openURL(%s)'"
+ This is the default location for the system-wide configuration file.
+ Depending on build options, it may be placed elsewhere.
+ .TP
+-.B $HOME/.xpdfrc
++.B $HOME/.xpdfrc3
+ This is the user's configuration file. If it exists, it will be read
+ in place of the system-wide file.
+ .SH AUTHORS
Index: patches/patch-splash_Makefile_in
===================================================================
RCS file: patches/patch-splash_Makefile_in
diff -N patches/patch-splash_Makefile_in
--- patches/patch-splash_Makefile_in 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
---- splash/Makefile.in.orig Wed May 28 20:50:50 2014
-+++ splash/Makefile.in Fri May 30 14:29:41 2014
-@@ -16,7 +16,7 @@ GOOLIBDIR = ../goo
- FOFISRCDIR = $(srcdir)/../fofi
- FOFILIBDIR = ../fofi
-
--CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR)
-I$(FOFISRCDIR) -I$(srcdir) @freetype2_CFLAGS@
-+CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR)
-I$(FOFISRCDIR) -I$(srcdir) @freetype2_CFLAGS@
-
- CXX = @CXX@
- AR = @AR@
Index: patches/patch-splash_SplashXPath_cc
===================================================================
RCS file: patches/patch-splash_SplashXPath_cc
diff -N patches/patch-splash_SplashXPath_cc
--- patches/patch-splash_SplashXPath_cc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,47 +0,0 @@
-Replace Miod's fix from 2009 by some assert's, because the bug
-*should* have been fixed in a different way and I'm too lazy to
-verify it. (needs a change to strokeAdjust(), which is private)
-
---- splash/SplashXPath.cc.orig Wed May 28 20:50:50 2014
-+++ splash/SplashXPath.cc Fri May 30 15:31:49 2014
-@@ -8,6 +8,8 @@
-
- #include <aconf.h>
-
-+#include <assert.h>
-+
- #ifdef USE_GCC_PRAGMAS
- #pragma implementation
- #endif
-@@ -69,7 +71,7 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord
-
- // do stroke adjustment
- if (path->hints) {
-- strokeAdjust(pts, path->hints, path->hintsLength);
-+ strokeAdjust(pts, path->hints, path->hintsLength, path->length);
- }
-
- segs = NULL;
-@@ -176,7 +178,8 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord
- }
-
- void SplashXPath::strokeAdjust(SplashXPathPoint *pts,
-- SplashPathHint *hints, int nHints) {
-+ SplashPathHint *hints, int nHints,
-+ int plength) {
- SplashXPathAdjust *adjusts, *adjust;
- SplashPathHint *hint;
- SplashCoord x0, y0, x1, y1, x2, y2, x3, y3;
-@@ -188,9 +191,12 @@ void SplashXPath::strokeAdjust(SplashXPathPoint *pts,
- adjusts = (SplashXPathAdjust *)gmallocn(nHints, sizeof(SplashXPathAdjust));
- for (i = 0; i < nHints; ++i) {
- hint = &hints[i];
-+ assert(hint->firstPt < plength && hint->lastPt < plength);
- x0 = pts[hint->ctrl0 ].x; y0 = pts[hint->ctrl0 ].y;
-+ assert(hint->ctrl0 + 1 < plength);
- x1 = pts[hint->ctrl0 + 1].x; y1 = pts[hint->ctrl0 + 1].y;
- x2 = pts[hint->ctrl1 ].x; y2 = pts[hint->ctrl1 ].y;
-+ assert(hint->ctrl1 + 1 < plength);
- x3 = pts[hint->ctrl1 + 1].x; y3 = pts[hint->ctrl1 + 1].y;
- if (x0 == x1 && x2 == x3) {
- adjusts[i].vert = gTrue;
Index: patches/patch-splash_SplashXPath_h
===================================================================
RCS file: patches/patch-splash_SplashXPath_h
diff -N patches/patch-splash_SplashXPath_h
--- patches/patch-splash_SplashXPath_h 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-Replace Miod's fix from 2009 by some assert's, because the bug
-*should* have been fixed in a different way and I'm too lazy to
-verify it. (needs a change to strokeAdjust(), which is private)
-
---- splash/SplashXPath.h.orig Wed May 28 20:50:50 2014
-+++ splash/SplashXPath.h Fri May 30 15:33:45 2014
-@@ -99,7 +99,8 @@ class SplashXPath { (private)
- void transform(SplashCoord *matrix, SplashCoord xi, SplashCoord yi,
- SplashCoord *xo, SplashCoord *yo);
- void strokeAdjust(SplashXPathPoint *pts,
-- SplashPathHint *hints, int nHints);
-+ SplashPathHint *hints, int nHints,
-+ int plength);
- void grow(int nSegs);
- void addCurve(SplashCoord x0, SplashCoord y0,
- SplashCoord x1, SplashCoord y1,
Index: patches/patch-xpdf_GlobalParams_cc
===================================================================
RCS file: patches/patch-xpdf_GlobalParams_cc
diff -N patches/patch-xpdf_GlobalParams_cc
--- patches/patch-xpdf_GlobalParams_cc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
---- xpdf/GlobalParams.cc.orig Wed May 28 20:50:50 2014
-+++ xpdf/GlobalParams.cc Fri May 30 14:27:13 2014
-@@ -120,14 +120,7 @@ static const char *displayFontDirs[] = {
- };
- #else
- static const char *displayFontDirs[] = {
-- "/usr/share/ghostscript/fonts",
-- "/usr/local/share/ghostscript/fonts",
-- "/usr/share/fonts/default/Type1",
-- "/usr/share/fonts/default/ghostscript",
-- "/usr/share/fonts/type1/gsfonts",
--#if defined(__sun) && defined(__SVR4)
-- "/usr/sfw/share/ghostscript/fonts",
--#endif
-+ LOCALBASE "/share/fonts/ghostscript",
- NULL
- };
- #endif
Index: patches/patch-xpdf_JBIG2Stream_cc
===================================================================
RCS file: patches/patch-xpdf_JBIG2Stream_cc
diff -N patches/patch-xpdf_JBIG2Stream_cc
--- patches/patch-xpdf_JBIG2Stream_cc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,22 +0,0 @@
-Security fix for CVE-2022-38171.
-Extracted from upstream 4.04
-
-Index: xpdf/JBIG2Stream.cc
---- xpdf/JBIG2Stream.cc.orig
-+++ xpdf/JBIG2Stream.cc
-@@ -1977,7 +1977,14 @@ void JBIG2Stream::readTextRegionSeg(Guint segNum, GBoo
- for (i = 0; i < nRefSegs; ++i) {
- if ((seg = findSegment(refSegs[i]))) {
- if (seg->getType() == jbig2SegSymbolDict) {
-- numSyms += ((JBIG2SymbolDict *)seg)->getSize();
-+ Guint segSize = ((JBIG2SymbolDict *)seg)->getSize();
-+ if (segSize > INT_MAX || numSyms > INT_MAX - segSize) {
-+ error(errSyntaxError, getPos(),
-+ "Too many symbols in JBIG2 text region");
-+ delete codeTables;
-+ return;
-+ }
-+ numSyms += segSize;
- } else if (seg->getType() == jbig2SegCodeTable) {
- codeTables->append(seg);
- }
Index: patches/patch-xpdf_Makefile_in
===================================================================
RCS file: patches/patch-xpdf_Makefile_in
diff -N patches/patch-xpdf_Makefile_in
--- patches/patch-xpdf_Makefile_in 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,20 +0,0 @@
---- xpdf/Makefile.in.orig Wed May 28 20:50:50 2014
-+++ xpdf/Makefile.in Fri May 30 14:28:24 2014
-@@ -19,7 +19,7 @@ FOFILIBDIR = ../fofi
- SPLASHSRCDIR = $(srcdir)/../splash
- SPLASHLIBDIR = ../splash
-
--CXXFLAGS = @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR)
-I$(FOFISRCDIR) -I$(SPLASHSRCDIR) -I$(srcdir) @freetype2_CFLAGS@ @Sgm_CFLAGS@
@Xm_CFLAGS@ @Xt_CFLAGS@ @Xp_CFLAGS@ @Xext_CFLAGS@ @Xpm_CFLAGS@ @libpng_CFLAGS@
@libpaper_CFLAGS@ @X_CFLAGS@ @EXTRA_CFLAGS@
-+CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @DEFS@ -I.. -I$(srcdir)/.. -I$(GOOSRCDIR)
-I$(FOFISRCDIR) -I$(SPLASHSRCDIR) -I$(srcdir) @freetype2_CFLAGS@ @Sgm_CFLAGS@
@Xm_CFLAGS@ @Xt_CFLAGS@ @Xp_CFLAGS@ @Xext_CFLAGS@ @Xpm_CFLAGS@ @libpng_CFLAGS@
@libpaper_CFLAGS@ @X_CFLAGS@ @EXTRA_CFLAGS@
-
- LDFLAGS = @LDFLAGS@
-
-@@ -33,7 +33,7 @@ SPLASHLIBS = -L$(SPLASHLIBDIR) -lsplash
-
- OTHERLIBS = @LIBS@ @libpaper_LIBS@ @EXTRA_LIBS@ \
- -L$(FOFILIBDIR) -lfofi \
-- -L$(GOOLIBDIR) -lGoo
-+ -L$(GOOLIBDIR) -lGoo -pthread
-
- CXX = @CXX@
-
Index: patches/patch-xpdf_TextOutputDev_cc
===================================================================
RCS file: patches/patch-xpdf_TextOutputDev_cc
diff -N patches/patch-xpdf_TextOutputDev_cc
--- patches/patch-xpdf_TextOutputDev_cc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,18 +0,0 @@
-CVE-2019-16927, CVE-2019-9877 from 4.02
-
-Index: xpdf/TextOutputDev.cc
---- xpdf/TextOutputDev.cc.orig
-+++ xpdf/TextOutputDev.cc
-@@ -2472,6 +2472,12 @@ TextBlock *TextPage::split(GList *charsA, int rot) {
-
- //----- compute the horizontal and vertical profiles
-
-+ if (xMin / splitPrecision < 0.5 * INT_MIN ||
-+ xMax / splitPrecision > 0.5 * INT_MAX ||
-+ yMin / splitPrecision < 0.5 * INT_MIN ||
-+ xMax / splitPrecision > 0.5 * INT_MAX) {
-+ return NULL;
-+ }
- // add some slack to the array bounds to avoid floating point
- // precision problems
- xMinI = (int)floor(xMin / splitPrecision) - 1;
Index: patches/patch-xpdf_XRef_cc
===================================================================
RCS file: patches/patch-xpdf_XRef_cc
diff -N patches/patch-xpdf_XRef_cc
--- patches/patch-xpdf_XRef_cc 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,26 +0,0 @@
---- xpdf/XRef.cc.orig Wed May 28 20:50:50 2014
-+++ xpdf/XRef.cc Fri May 30 14:26:13 2014
-@@ -958,19 +958,19 @@ void XRef::setEncryption(int permFlagsA, GBool ownerPa
- }
-
- GBool XRef::okToPrint(GBool ignoreOwnerPW) {
-- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permPrint);
-+ return (1);
- }
-
- GBool XRef::okToChange(GBool ignoreOwnerPW) {
-- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permChange);
-+ return (1);
- }
-
- GBool XRef::okToCopy(GBool ignoreOwnerPW) {
-- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permCopy);
-+ return (1);
- }
-
- GBool XRef::okToAddNotes(GBool ignoreOwnerPW) {
-- return (!ignoreOwnerPW && ownerPasswordOk) || (permFlags & permNotes);
-+ return (1);
- }
-
- Object *XRef::fetch(int num, int gen, Object *obj, int recursion) {
Index: patches/patch-xpdf_config_h
===================================================================
RCS file: /cvs/ports/textproc/xpdf3/patches/patch-xpdf_config_h,v
diff -u -p -r1.1.1.1 patch-xpdf_config_h
--- patches/patch-xpdf_config_h 11 Nov 2023 12:50:54 -0000 1.1.1.1
+++ patches/patch-xpdf_config_h 12 Nov 2026 18:52:00 -0000
@@ -1,14 +1,12 @@
-Add "3" suffix to default user config file
-
Index: xpdf/config.h
--- xpdf/config.h.orig
+++ xpdf/config.h
-@@ -55,7 +55,7 @@
- #if defined(VMS) || defined(_WIN32)
- #define xpdfUserConfigFile "xpdfrc"
- #else
--#define xpdfUserConfigFile ".xpdfrc"
-+#define xpdfUserConfigFile ".xpdfrc3"
- #endif
+@@ -42,7 +42,7 @@
+ //------------------------------------------------------------------------
+
+ // user config file name, relative to the user's home directory
+-#define xpoppleUserConfigFile ".xpdfrc"
++#define xpoppleUserConfigFile ".xpdfrc3"
// system config file name (set via the configure script)
+ #define xpoppleSysConfigFile SYSTEM_XPDFRC
Index: patches/patch-xpdf_xpdf_cc
===================================================================
RCS file: patches/patch-xpdf_xpdf_cc
diff -N patches/patch-xpdf_xpdf_cc
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-xpdf_xpdf_cc 12 Nov 2026 18:52:00 -0000
@@ -0,0 +1,12 @@
+Index: xpdf/xpdf.cc
+--- xpdf/xpdf.cc.orig
++++ xpdf/xpdf.cc
+@@ -103,7 +103,7 @@ static ArgDesc argDesc[] = {
+ {"-q", argFlag, &quiet, 0,
+ "don't print any messages or errors"},
+ {"-cfg", argString, cfgFileName, sizeof(cfgFileName),
+- "configuration file to use in place of .xpdfrc"},
++ "configuration file to use in place of .xpdfrc3"},
+ {"-v", argFlag, &printVersion, 0,
+ "print copyright and version info"},
+ {"-h", argFlag, &printHelp, 0,