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
Norbert Preining wrote:
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.
This is beyond my knowledge of autoconf.
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
Taco, any chance to fix that in one or the other way?
Changed in commit #12735 Best wishes, Taco
On Do, 16 Apr 2009, Taco Hoekwater wrote:
# include
Changed in commit #12735
Thanks, I guess you have checked that it still compiles and finds png.h
with the shipped libpng?
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining
On Thu, 16 Apr 2009, Norbert Preining wrote:
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:
..........
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.
Hi Norbert, I have something like that in mind: configuring with --with-system-poppler (use installed libpoppler instead of libxpdf from TL tree) will set the CPPFLAGS, INCLUDES, and DEPENDENCIES for libpoppler, including one flag like -DPOPPLERVERSION that can be used by the {pdf,lua,Xe}TeX code to distinguish which one is used. In other words the build systems pretends that libxpdf and libpoppler are essentially the same thing (which they are), one from the TL tree and one installed. I think that will have the minimal impact on the TL build system (at the price of renaming libs/xpdf => libs/poppler). If Karl objects to that renaming, --with-system-xpdf would have the same effect (the name being slightly misleading, but the help text could elaborate). [The configure options --with-system-XXX are generated automatically with names derived from the libs/* directories]. ================= So, all that would be needed for this are the -DPOPPLERVERSION dependent changes in the *TeX code.
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
Taco, any chance to fix that in one or the other way?
I think Taco has already fixed that. Regards Peter
Hi Peter, first of all, again thanks for all the work you have done!!!! On Mo, 20 Apr 2009, Peter Breitenlohner wrote:
configuring with --with-system-poppler (use installed libpoppler instead of libxpdf from TL tree) will set the CPPFLAGS, INCLUDES, and DEPENDENCIES for libpoppler, including one flag like -DPOPPLERVERSION that can be used by the {pdf,lua,Xe}TeX code to distinguish which one is used.
Perfect! That would be fine. The problem is about getting the POPPLERVERSION as you know. Anyway, that sound actually great. Of course, there are still changes to the source code necessary, but they are quite small.
So, all that would be needed for this are the -DPOPPLERVERSION dependent changes in the *TeX code.
Right, and I can even help with that. I have patches for all the
programs in TL2007 and current luatex, so I am sure that it is not too
hard. Especially, with poppler v0.10 there are really a few things to
change.
Again, thanks.
Best wishes
Norbert
-------------------------------------------------------------------------------
Dr. Norbert Preining
participants (3)
-
Norbert Preining
-
Peter Breitenlohner
-
Taco Hoekwater