Update to xpdf-3.04.
See http://www.foolabs.com/xpdf/CHANGES for a full list of changes.
Tested with a couple of (broken and evil) pdf documents on amd64.
The fix from miod@ (dates back to 2009) shouldn't be necessary any
longer, but to be safe I prefer to keep some asserts around for a
while.
I added pdftopng(1) but not pdftohtml(1), because poppler-utils
already contains a program with this name. No idea which one is
more useful.
Tests, comments and oks are welcome.
Ciao,
Kili
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/xpdf/Makefile,v
retrieving revision 1.83
diff -u -p -r1.83 Makefile
--- Makefile 11 Mar 2013 11:42:47 -0000 1.83
+++ Makefile 30 May 2014 14:06:49 -0000
@@ -2,12 +2,10 @@
COMMENT= PDF viewer for X11
-DISTNAME= xpdf-3.03
-REVISION= 0
+DISTNAME= xpdf-3.04
CATEGORIES= textproc x11
MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \
- ftp://gd.tuwien.ac.at/publishing/xpdf/ \
http://mirror.ctan.org/support/xpdf/
HOMEPAGE= http://www.foolabs.com/xpdf/
@@ -15,7 +13,7 @@ HOMEPAGE= http://www.foolabs.com/xpdf/
# GPLv2 only or GPLv3 only or both (at our choice)
PERMIT_PACKAGE_CDROM= Yes
-LIB_DEPENDS+= x11/openmotif
+LIB_DEPENDS+= graphics/png x11/openmotif
USE_GMAKE= Yes
CONFIGURE_STYLE=gnu
CONFIGURE_ARGS= --enable-multithreaded \
@@ -29,7 +27,7 @@ MAKE_ENV+=MOTIFLIB='-L${LOCALBASE}/lib -
RUN_DEPENDS= print/ghostscript/gnu-fonts
WANTLIB= ICE SM X11 Xext Xpm Xt freetype Xm \
- c m pthread stdc++ z
+ c m png pthread stdc++ z
NO_TEST= Yes
@@ -42,5 +40,9 @@ post-install:
rm ${PREFIX}/man/man1/$i.1
rm ${PREFIX}/bin/$i
.endfor
+# forgotten in Makefile.in (there's also a pdfthtml, but it conflicts
+# with poppler-utils):
+ ${INSTALL_PROGRAM} ${WRKBUILD}/xpdf/pdftopng ${PREFIX}/bin
+ ${INSTALL_MAN} ${WRKSRC}/doc/pdftopng.1 ${PREFIX}/man/man1
.include <bsd.port.mk>
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/xpdf/distinfo,v
retrieving revision 1.17
diff -u -p -r1.17 distinfo
--- distinfo 1 Oct 2011 19:46:35 -0000 1.17
+++ distinfo 30 May 2014 13:14:12 -0000
@@ -1,5 +1,2 @@
-MD5 (xpdf-3.03.tar.gz) = r3X3cr7g5a5KgR/50D6sWg==
-RMD160 (xpdf-3.03.tar.gz) = 7xM2wYkCb7Ds0Wnis3taWqIuBL4=
-SHA1 (xpdf-3.03.tar.gz) = SZQj6KeV4O/XbKeYI5600NUv4kg=
-SHA256 (xpdf-3.03.tar.gz) = As9j2PYybtpkQJbND5aeFYhwKthyIsHpOIqTwnD7zso=
-SIZE (xpdf-3.03.tar.gz) = 795537
+SHA256 (xpdf-3.04.tar.gz) = ETkMdHM6vLJiqspNtocQ8T///UK/4qCGGl38kSspd+U=
+SIZE (xpdf-3.04.tar.gz) = 825519
Index: patches/patch-doc_sample-xpdfrc
===================================================================
RCS file: /cvs/ports/textproc/xpdf/patches/patch-doc_sample-xpdfrc,v
retrieving revision 1.4
diff -u -p -r1.4 patch-doc_sample-xpdfrc
--- patches/patch-doc_sample-xpdfrc 1 Oct 2011 19:46:35 -0000 1.4
+++ patches/patch-doc_sample-xpdfrc 30 May 2014 13:14:12 -0000
@@ -1,6 +1,6 @@
$OpenBSD: patch-doc_sample-xpdfrc,v 1.4 2011/10/01 19:46:35 kili Exp $
---- doc/sample-xpdfrc.orig Mon Aug 15 23:08:53 2011
-+++ doc/sample-xpdfrc Thu Aug 18 21:10:22 2011
+--- 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 @@
# Set the default PostScript file or command.
@@ -10,7 +10,7 @@ $OpenBSD: patch-doc_sample-xpdfrc,v 1.4
# 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
-@@ -88,5 +88,5 @@
+@@ -87,5 +87,5 @@
# Set the command used to run a web browser when a URL hyperlink is
# clicked.
Index: patches/patch-splash_Makefile_in
===================================================================
RCS file: /cvs/ports/textproc/xpdf/patches/patch-splash_Makefile_in,v
retrieving revision 1.1
diff -u -p -r1.1 patch-splash_Makefile_in
--- patches/patch-splash_Makefile_in 25 Jan 2004 06:02:40 -0000 1.1
+++ patches/patch-splash_Makefile_in 30 May 2014 13:14:12 -0000
@@ -1,12 +1,12 @@
$OpenBSD: patch-splash_Makefile_in,v 1.1 2004/01/25 06:02:40 brad Exp $
---- splash/Makefile.in.orig 2004-01-24 23:49:23.000000000 -0500
-+++ splash/Makefile.in 2004-01-24 23:49:34.000000000 -0500
+--- 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$(GOOSRCDIR) -I$(FOFISRCDIR) -I$(srcdir)
@t1_CFLAGS@ @freetype2_CFLAGS@
-+CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @DEFS@ -I.. -I$(GOOSRCDIR) -I$(FOFISRCDIR)
-I$(srcdir) @t1_CFLAGS@ @freetype2_CFLAGS@
+-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: /cvs/ports/textproc/xpdf/patches/patch-splash_SplashXPath_cc,v
retrieving revision 1.3
diff -u -p -r1.3 patch-splash_SplashXPath_cc
--- patches/patch-splash_SplashXPath_cc 1 Oct 2011 19:46:35 -0000 1.3
+++ patches/patch-splash_SplashXPath_cc 30 May 2014 13:34:36 -0000
@@ -1,32 +1,49 @@
$OpenBSD: patch-splash_SplashXPath_cc,v 1.3 2011/10/01 19:46:35 kili Exp $
---- splash/SplashXPath.cc.orig Mon Aug 15 23:08:53 2011
-+++ splash/SplashXPath.cc Thu Aug 18 21:10:22 2011
-@@ -73,10 +73,26 @@ SplashXPath::SplashXPath(SplashPath *path, SplashCoord
- sizeof(SplashXPathAdjust));
- for (i = 0; i < path->hintsLength; ++i) {
- hint = &path->hints[i];
-+ if (hint->firstPt >= path->length || hint->lastPt >= path->length) {
-+ path->hintsLength = i;
-+ if (i == 0) {
-+ gfree(adjusts);
-+ adjusts = NULL;
-+ }
-+ break;
-+ }
- x0 = pts[hint->ctrl0 ].x; y0 = pts[hint->ctrl0 ].y;
-- x1 = pts[hint->ctrl0 + 1].x; y1 = pts[hint->ctrl0 + 1].y;
-+ if (hint->ctrl0 + 1 >= path->length) {
-+ x1 = x0; y1 = y0;
-+ } else {
-+ x1 = pts[hint->ctrl0 + 1].x; y1 = pts[hint->ctrl0 + 1].y;
-+ }
- x2 = pts[hint->ctrl1 ].x; y2 = pts[hint->ctrl1 ].y;
-- x3 = pts[hint->ctrl1 + 1].x; y3 = pts[hint->ctrl1 + 1].y;
-+ if (hint->ctrl1 + 1 >= path->length) {
-+ x3 = x2; y3 = y2;
-+ } else {
-+ x3 = pts[hint->ctrl1 + 1].x; y3 = pts[hint->ctrl1 + 1].y;
-+ }
- if (x0 == x1 && x2 == x3) {
- adjusts[i].vert = gTrue;
- adj0 = x0;
+
+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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-splash_SplashXPath_h 30 May 2014 13:34:45 -0000
@@ -0,0 +1,18 @@
+$OpenBSD$
+
+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: /cvs/ports/textproc/xpdf/patches/patch-xpdf_GlobalParams_cc,v
retrieving revision 1.2
diff -u -p -r1.2 patch-xpdf_GlobalParams_cc
--- patches/patch-xpdf_GlobalParams_cc 1 Oct 2011 19:46:35 -0000 1.2
+++ patches/patch-xpdf_GlobalParams_cc 30 May 2014 13:14:12 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-xpdf_GlobalParams_cc,v 1.2 2011/10/01 19:46:35 kili Exp $
---- xpdf/GlobalParams.cc.orig Mon Aug 15 23:08:53 2011
-+++ xpdf/GlobalParams.cc Thu Aug 18 21:56:42 2011
-@@ -110,11 +110,7 @@ static const char *displayFontDirs[] = {
+--- 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[] = {
@@ -10,6 +10,9 @@ $OpenBSD: patch-xpdf_GlobalParams_cc,v 1
- "/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/ghostscript/fonts",
NULL
};
Index: patches/patch-xpdf_Makefile_in
===================================================================
RCS file: /cvs/ports/textproc/xpdf/patches/patch-xpdf_Makefile_in,v
retrieving revision 1.5
diff -u -p -r1.5 patch-xpdf_Makefile_in
--- patches/patch-xpdf_Makefile_in 25 Jan 2004 06:02:40 -0000 1.5
+++ patches/patch-xpdf_Makefile_in 30 May 2014 13:14:12 -0000
@@ -1,18 +1,18 @@
$OpenBSD: patch-xpdf_Makefile_in,v 1.5 2004/01/25 06:02:40 brad Exp $
---- xpdf/Makefile.in.orig 2004-01-21 20:26:45.000000000 -0500
-+++ xpdf/Makefile.in 2004-01-24 23:55:40.000000000 -0500
+--- 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$(GOOSRCDIR) -I$(FOFISRCDIR)
-I$(SPLASHSRCDIR) -I$(srcdir) @freetype2_CFLAGS@ @Sgm_CFLAGS@ @Xm_CFLAGS@
@Xt_CFLAGS@ @Xp_CFLAGS@ @Xext_CFLAGS@ @Xpm_CFLAGS@ @t1_CFLAGS@
@libpaper_CFLAGS@ @X_CFLAGS@
-+CXXFLAGS = @CPPFLAGS@ @CXXFLAGS@ @DEFS@ -I.. -I$(GOOSRCDIR) -I$(FOFISRCDIR)
-I$(SPLASHSRCDIR) -I$(srcdir) @freetype2_CFLAGS@ @Sgm_CFLAGS@ @Xm_CFLAGS@
@Xt_CFLAGS@ @Xp_CFLAGS@ @Xext_CFLAGS@ @Xpm_CFLAGS@ @t1_CFLAGS@
@libpaper_CFLAGS@ @X_CFLAGS@
+-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@
-@@ -32,7 +32,7 @@ SPLASHLIBS = -L$(SPLASHLIBDIR) -lsplash
+@@ -33,7 +33,7 @@ SPLASHLIBS = -L$(SPLASHLIBDIR) -lsplash
- OTHERLIBS = @LIBS@ @libpaper_LIBS@ \
+ OTHERLIBS = @LIBS@ @libpaper_LIBS@ @EXTRA_LIBS@ \
-L$(FOFILIBDIR) -lfofi \
- -L$(GOOLIBDIR) -lGoo
+ -L$(GOOLIBDIR) -lGoo -pthread
Index: patches/patch-xpdf_XRef_cc
===================================================================
RCS file: /cvs/ports/textproc/xpdf/patches/patch-xpdf_XRef_cc,v
retrieving revision 1.6
diff -u -p -r1.6 patch-xpdf_XRef_cc
--- patches/patch-xpdf_XRef_cc 1 Oct 2011 19:46:35 -0000 1.6
+++ patches/patch-xpdf_XRef_cc 30 May 2014 13:14:12 -0000
@@ -1,7 +1,7 @@
$OpenBSD: patch-xpdf_XRef_cc,v 1.6 2011/10/01 19:46:35 kili Exp $
---- xpdf/XRef.cc.orig Mon Aug 15 23:08:53 2011
-+++ xpdf/XRef.cc Thu Aug 18 21:10:22 2011
-@@ -806,19 +806,19 @@ void XRef::setEncryption(int permFlagsA, GBool ownerPa
+--- 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) {
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/xpdf/pkg/PLIST,v
retrieving revision 1.12
diff -u -p -r1.12 PLIST
--- pkg/PLIST 6 Jun 2012 18:28:22 -0000 1.12
+++ pkg/PLIST 30 May 2014 14:06:33 -0000
@@ -1,10 +1,12 @@
@comment $OpenBSD: PLIST,v 1.12 2012/06/06 18:28:22 ajacoutot Exp $
+@conflict xpdf-utils-*
@pkgpath textproc/xpdf,-main
@pkgpath textproc/xpdf,-utils
-@conflict xpdf-utils-*
@bin bin/pdfdetach
+@bin bin/pdftopng
@bin bin/xpdf
@man man/man1/pdfdetach.1
+@man man/man1/pdftopng.1
@man man/man1/xpdf.1
@man man/man5/xpdfrc.5
share/examples/xpdf/