[Dev-luatex] Building luatex with poppler

Norbert Preining preining at logic.at
Thu Apr 16 18:42:51 CEST 2009


Hi all,

for Debian I have adjusted the libpoppler patch for luatex. Thanks to
the work of Peter it is getting easier and easier, and AFAIS the patch
for TeX Live itself well shrink, too.

Besides the code change (which is rather minimal), the patch to the
Makefile.in and configure is as follows:

Index: luatex-0.39.0/source/configure
===================================================================
--- luatex-0.39.0.orig/source/configure	2009-04-16 18:11:31.000000000 +0200
+++ luatex-0.39.0/source/configure	2009-04-16 18:11:59.000000000 +0200
@@ -2387,7 +2387,7 @@
 esac
 
 test "x$enable_pdftex" = xno || {
-  need_xpdf=yes
+  need_xpdf=no
   need_libpng=yes
   need_obsdcompat=yes
 }
@@ -2401,7 +2401,7 @@
 esac
 
 test "x$enable_luatex" = xno || {
-  need_xpdf=yes
+  need_xpdf=no
   need_libpng=yes
   need_obsdcompat=yes
 }
@@ -2415,7 +2415,7 @@
 esac
 
 test "x$enable_xetex" = xno || {
-  need_xpdf=yes
+  need_xpdf=no
   need_libpng=yes
   need_freetype2=yes
 }

Index: luatex-0.39.0/source/texk/web2c/Makefile.in
===================================================================
--- luatex-0.39.0.orig/source/texk/web2c/Makefile.in	2009-04-16 18:11:31.000000000 +0200
+++ luatex-0.39.0/source/texk/web2c/Makefile.in	2009-04-16 18:11:59.000000000 +0200
@@ -872,10 +872,10 @@
 	-I$(srcdir)/mplibdir -Dextra_version_info=`date +-%Y%m%d%H`
 luatex_ldadd = libluatex.a libff.a libluamisc.a libzzip.a \
 	libluasocket.a liblua51.a $(LIBPNG_LIBS) $(ZLIB_LIBS) \
-	$(XPDF_LIBS) $(OBSDCOMPAT_LIBS) libmd5.a libmplib.a
+	-lpoppler $(OBSDCOMPAT_LIBS) libmd5.a libmplib.a
 luatex_LDADD = $(luatex_ldadd) $(LDADD) $(socketlibs)
 luatex_DEPENDENCIES = $(proglib) libluatex.a $(LIBPNG_DEPEND) \
-	$(ZLIB_DEPEND) $(XPDF_DEPEND) $(OBSDCOMPAT_DEPEND) libmd5.a
+	$(ZLIB_DEPEND) $(OBSDCOMPAT_DEPEND) libmd5.a
 luatex_c_h = luatexini.c luatex0.c luatexcoerce.h luatexd.h
 nodist_luatex_SOURCES = $(luatex_c_h) luatex-pool.c luatexextra.c luatexdir/luatexextra.h
 luatex_sources = luatexdir/luatex.web luatexdir/luatex.ch
@@ -1149,11 +1149,13 @@
     luatexdir/luafontloader/src/ffdummies.c \
     luatexdir/luafontloader/src/luafflib.c
 
+POPPLERVERSION=`pkg-config --modversion poppler`
+
 libluatex_a_DEPENDENCIES = libff.a
 libluatex_a_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) \
-	$(XPDF_INCLUDES) $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5 \
+	-I/usr/include/poppler $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5 \
 	-Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51 \
-	-DpdfTeX
+	-DpdfTeX -DPOPPLERVERSION=\"$(POPPLERVERSION)\"
 libluatex_a_SOURCES = \
 	luatexdir/commands.h  \
 	luatexdir/font/dofont.c  \


The magic with POPPLERVERSION is only necessary because the poppler
library does not support getting the current built version from the
header files, so I have to set it like that for the output in 
source/texk/web2c/luatexdir/utils/utils.c.



Now two things:
1) is there any chance to make that even simpler? I mean if one selects
   --with-poppler we would only have to change the value of
	XPDF_LIBS to -lpoppler
   and
	XPDF_DEPEND to nothing
   (because poppler would be always system wide)
   and
	XPDF_INCLUDES to something given with --with-poppler-include
   Whether the need_xpdf is set to true/false I do not know if it makes 
   any difference.

2) Concerning system libpng: Most things work out of the box if one
   gives
	--with-system-png
   but in source/texk/web2c/luatexdir/image/image.h there is a
	#  include <../libpng/png.h>
   which has to be changed to
	#  include <png.h>
   Taco, any chance to fix that in one or the other way?


In any case, big thanks to all for the nice work.

For completeness, the diffstat of the libpoppler patch:
 source/configure                               |    6 +--
 source/texk/web2c/Makefile.in                  |   10 +++---
	both shown above
 source/texk/web2c/luatexdir/image/pdftoepdf.cc |   39 ++++++++++++-------------
	only header changes and 4 times GString -> GooString
 source/texk/web2c/luatexdir/luatexextra.in     |    2 -
	adjustment of the bannder adding "... using libpoppler"
 source/texk/web2c/luatexdir/utils/utils.c      |    6 +--
	one header change
		#include "xpdf/config.h" 
	to
		#include "poppler/poppler-config.h"
	and replacing xpdfVersion with POPPLERVERSION

That is all.

Best wishes

Norbert

-------------------------------------------------------------------------------
Dr. Norbert Preining <preining at logic.at>        Vienna University of Technology
Debian Developer <preining at debian.org>                         Debian TeX Group
gpg DSA: 0x09C5B094      fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
-------------------------------------------------------------------------------
ZEAL MONACHORUM (n.)
(Skiing term.) To ski with 'zeal monachorum' is to descend the top
three quarters of the mountain in a quivering blue funk, but on
arriving at the gentle bit just in front of the restaurant to whizz to
a stop like a victorious slalom-champion.
                        --- Douglas Adams, The Meaning of Liff


More information about the dev-luatex mailing list