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