Switch back to xpdf-3.04 until printing works again.

Too many people suffered from it, and I don't know much time it
will take to fix it.
This commit is contained in:
kili 2017-11-08 18:30:24 +00:00
parent 7c5d2f9438
commit 389048d47b
9 changed files with 152 additions and 47 deletions

View File

@ -1,50 +1,34 @@
# $OpenBSD: Makefile,v 1.90 2017/11/04 16:05:23 kili Exp $
# $OpenBSD: Makefile,v 1.91 2017/11/08 18:30:24 kili Exp $
COMMENT= PDF viewer for X11
DISTNAME= xpdf-4.00
DISTNAME= xpdf-3.04
CATEGORIES= textproc x11
EPOCH= 0
MASTER_SITES= https://www.xpdfreader.com/dl/
MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \
http://mirror.ctan.org/support/xpdf/
HOMEPAGE= https://www.xpdfreader.com/
HOMEPAGE= http://www.foolabs.com/xpdf/
# GPLv2 only or GPLv3 only or both (at our choice)
PERMIT_PACKAGE_CDROM= Yes
MODULES= devel/cmake \
X11/qt5
LIB_DEPENDS+= graphics/png 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'
RUN_DEPENDS= print/ghostscript/gnu-fonts
# Add jpeg, png, tiff as rdep and bdep so cmake always pick them up and
# xpdf is able to export to those formats. Not strictly needed for jpeg
# and png, because they are pulled in by qt and its dependencies, but
# better be explicit here.
# In addtion, qtimageformats is required at runtime to let tiff export
# work.
RUN_DEPENDS += graphics/jpeg \
graphics/png \
graphics/tiff \
x11/qt5/qtimageformats
BUILD_DEPENDS +=graphics/jpeg \
graphics/png \
graphics/tiff
# Don't pick up libpaper -- the build currently fails to link against
# it.
CONFIGURE_ARGS += -DHAVE_PAPER_H=0
# XXX
# Doesn't work, neither with -DCMAKE_LIBRARY_PATH=${LOCALBASE}/lib nor
# with CMAKE_LIBRARY_PATH=${LOCALBASE}/lib in the environment.
# CONFIGURE_ARGS += -DXPDFWIDGET_PRINTING=true
CXXFLAGS+= -DLOCALBASE=\\\"${LOCALBASE}\\\"
WANTLIB= Qt5Core Qt5Gui Qt5Widgets freetype c m png pthread \
${COMPILER_LIBCXX} z
WANTLIB= ICE SM X11 Xext Xpm Xt freetype Xm \
c m png pthread ${COMPILER_LIBCXX} z
NO_TEST= Yes
@ -53,9 +37,13 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/sample-xpdfrc \
${PREFIX}/share/examples/xpdf/xpdfrc
# already in poppler-utils
.for i in pdffonts pdfimages pdfinfo pdftohtml pdftoppm pdftops pdftotext
.for i in pdffonts pdfimages pdfinfo pdftoppm pdftops pdftotext
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>

View File

@ -1,2 +1,2 @@
SHA256 (xpdf-4.00.tar.gz) = /z2SxCFm41sbpq7JtfCt/7X8BaPrldxJUFtuNE5CFtY=
SIZE (xpdf-4.00.tar.gz) = 854175
SHA256 (xpdf-3.04.tar.gz) = ETkMdHM6vLJiqspNtocQ8T///UK/4qCGGl38kSspd+U=
SIZE (xpdf-3.04.tar.gz) = 825519

View File

@ -0,0 +1,19 @@
$OpenBSD: patch-Makefile_in,v 1.4 2017/11/08 18:30:24 kili Exp $
--- Makefile.in.orig Mon Aug 15 23:08:52 2011
+++ Makefile.in Thu Aug 18 21:10:22 2011
@@ -102,13 +102,8 @@ install: dummy
$(INSTALL_DATA) $(srcdir)/doc/pdfimages.1 $(DESTDIR)@mandir@/man1/pdfimages.1
-mkdir -p $(DESTDIR)@mandir@/man5
$(INSTALL_DATA) $(srcdir)/doc/xpdfrc.5 $(DESTDIR)@mandir@/man5/xpdfrc.5
- -mkdir -p $(DESTDIR)@sysconfdir@
- @if test ! -f $(DESTDIR)@sysconfdir@/xpdfrc; then \
- echo "$(INSTALL_DATA) $(srcdir)/doc/sample-xpdfrc $(DESTDIR)@sysconfdir@/xpdfrc"; \
- $(INSTALL_DATA) $(srcdir)/doc/sample-xpdfrc $(DESTDIR)@sysconfdir@/xpdfrc; \
- else \
- echo "# not overwriting the existing $(DESTDIR)@sysconfdir@/xpdfrc"; \
- fi
+ -mkdir -p $(PREFIX)/share/examples/xpdf
+ $(INSTALL_DATA) $(srcdir)/doc/sample-xpdfrc $(PREFIX)/share/examples/xpdf/xpdfrc
clean:
-cd goo; $(MAKE) clean

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-splash_Makefile_in,v 1.4 2017/11/08 18:30:24 kili Exp $
--- 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@

View File

@ -0,0 +1,49 @@
$OpenBSD: patch-splash_SplashXPath_cc,v 1.6 2017/11/08 18:30:24 kili Exp $
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;

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-splash_SplashXPath_h,v 1.3 2017/11/08 18:30:24 kili Exp $
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,

View File

@ -1,8 +1,7 @@
$OpenBSD: patch-xpdf_GlobalParams_cc,v 1.5 2017/11/04 16:05:23 kili Exp $
Index: xpdf/GlobalParams.cc
--- xpdf/GlobalParams.cc.orig
+++ xpdf/GlobalParams.cc
@@ -103,14 +103,7 @@ static const char *displayFontDirs[] = {
$OpenBSD: patch-xpdf_GlobalParams_cc,v 1.6 2017/11/08 18:30:24 kili Exp $
--- 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[] = {

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-xpdf_Makefile_in,v 1.8 2017/11/08 18:30:24 kili Exp $
--- 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@

View File

@ -1,8 +1,7 @@
$OpenBSD: patch-xpdf_XRef_cc,v 1.8 2017/11/04 16:05:23 kili Exp $
Index: xpdf/XRef.cc
--- xpdf/XRef.cc.orig
+++ xpdf/XRef.cc
@@ -1003,19 +1003,19 @@ GBool XRef::getEncryption(int *permFlagsA, GBool *owne
$OpenBSD: patch-xpdf_XRef_cc,v 1.9 2017/11/08 18:30:24 kili Exp $
--- 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) {