Hi,
On Tue, Oct 24, 2017 at 07:48:03PM +0200, Ingo Schwarze wrote:
> > tiff export still doesn't work).
>
> That's strange, it just works for me with the patch as you sent it,
> both for a small text-only PDF and for a large graphics-heavy PDF.
Oh, the joy of modern plugin-based software "architecture".
After some more tracing, it looks like x11/qt5/qtimageformats is
required at runtime (but not necessarily at build time) by xpdf to
export to tiff.
Updated diff (completely untested for now) appended to this mail.
Maybe the dependencies are still not optimal (e.g. make qtimageformats
both build and run dep and drop tiff instead), but this is something
which can be done later.
> > For printing (using DXPDFWIDGET_PRINTING=true), the cmake magic
> > fails to add -L${LOCALBASE}/lib when linking the xpdf executable.
> > I really need some help from a cmake expert here (CMAKE_LIBRARY_PATH
> > doesn't help).
>
> As far as i understand, CMAKE_LIBRARY_PATH only tells commands like
> find_library() to search such places when detecting libraries, but
> doesn't by itself pass any options to the linker.
>
> The problem is here:
>
> c++ [...] -o xpdf-qt/xpdf -L/usr/local/lib/qt5/. -L/usr/X11R6/lib \
> -Wl,-rpath,/usr/local/lib/qt5/.:/usr/X11R6/lib: \
> -lQt5PrintSupport -lcups -lcups -lfreetype -lpthread \
> -lQt5Widgets -lQt5Gui -lQt5Core \
> -Wl,-rpath-link,/usr/X11R6/lib:/usr/local/lib
>
> The path /usr/local/lib is already mentioned, but too late, after -lcups.
>
> I poked around quite a bit but still have no idea why cmake screws
> up the order of the arguments so badly.
>
> Yet i got a bit further. With the dirty patch below, to be applied
> on top of what you sent, i got the port to build, package, pass
> lib-depends-check, run, and display a "Print" menu item and dialogue.
> But it is not yet useful. The only "Printer Name" that dialogue
> offers is "Print to file (PDF)", no default printer, even though:
[...]
I hope to find some cmake, cups and qt experts in Berlin and get
them drunk enough to explain things to me before I'm too drunk to
understand ;-)
Until then, I'll just ignore the "xpdf doesn't print" problem.
Ciao,
Kili
ps: there's a new xpdf/XpdfReader version around (4.00.01), fixing
printing problems, but AFAIK that only affects Windows builds.
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/xpdf/Makefile,v
retrieving revision 1.89
diff -u -p -r1.89 Makefile
--- Makefile 26 Jul 2017 22:45:31 -0000 1.89
+++ Makefile 30 Oct 2017 21:08:47 -0000
@@ -2,33 +2,49 @@
COMMENT= PDF viewer for X11
-DISTNAME= xpdf-3.04
+DISTNAME= xpdf-4.00
CATEGORIES= textproc x11
-REVISION= 2
-MASTER_SITES= ftp://ftp.foolabs.com/pub/xpdf/ \
- http://mirror.ctan.org/support/xpdf/
+MASTER_SITES= https://www.xpdfreader.com/dl/
-HOMEPAGE= http://www.foolabs.com/xpdf/
+HOMEPAGE= https://www.xpdfreader.com/
# GPLv2 only or GPLv3 only or both (at our choice)
PERMIT_PACKAGE_CDROM= Yes
-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'
+MODULES= devel/cmake \
+ X11/qt5
RUN_DEPENDS= print/ghostscript/gnu-fonts
-WANTLIB= ICE SM X11 Xext Xpm Xt freetype Xm \
- c m png pthread ${COMPILER_LIBCXX} z
+# 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
NO_TEST= Yes
@@ -37,13 +53,9 @@ post-install:
${INSTALL_DATA} ${WRKSRC}/doc/sample-xpdfrc \
${PREFIX}/share/examples/xpdf/xpdfrc
# already in poppler-utils
-.for i in pdffonts pdfimages pdfinfo pdftoppm pdftops pdftotext
+.for i in pdffonts pdfimages pdfinfo pdftohtml 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>
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/xpdf/distinfo,v
retrieving revision 1.18
diff -u -p -r1.18 distinfo
--- distinfo 8 Jun 2014 18:56:33 -0000 1.18
+++ distinfo 30 Oct 2017 21:08:47 -0000
@@ -1,2 +1,2 @@
-SHA256 (xpdf-3.04.tar.gz) = ETkMdHM6vLJiqspNtocQ8T///UK/4qCGGl38kSspd+U=
-SIZE (xpdf-3.04.tar.gz) = 825519
+SHA256 (xpdf-4.00.tar.gz) = /z2SxCFm41sbpq7JtfCt/7X8BaPrldxJUFtuNE5CFtY=
+SIZE (xpdf-4.00.tar.gz) = 854175
Index: patches/patch-Makefile_in
===================================================================
RCS file: patches/patch-Makefile_in
diff -N patches/patch-Makefile_in
--- patches/patch-Makefile_in 1 Oct 2011 19:46:35 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,19 +0,0 @@
-$OpenBSD: patch-Makefile_in,v 1.2 2011/10/01 19:46:35 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
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 8 Jun 2014 18:56:33 -0000 1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-splash_Makefile_in,v 1.2 2014/06/08 18:56:33 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@
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 8 Jun 2014 18:56:33 -0000 1.4
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,49 +0,0 @@
-$OpenBSD: patch-splash_SplashXPath_cc,v 1.4 2014/06/08 18:56:33 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
-
No comments:
Post a Comment