[packages/texlive/TEXLIVE_20080816] - build luatex (texlua interpreter is used by some scripts, like rungs) - updated format-security pa

qboosh qboosh at pld-linux.org
Sun Jul 31 08:18:43 CEST 2016


commit 1f77ed9369f1ca3fc4c1f2a0944d504e7d131719
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Jul 31 08:19:05 2016 +0200

    - build luatex (texlua interpreter is used by some scripts, like rungs)
    - updated format-security patch to cover luatex
    - added system-libpng patch (adjust luatex to use system libpng 1.5+)
    - added system-zzip patch (use system libzzip in luatex; unfortunately system lua is not possible due to use of private symbols)
    - use out-of-tree build as advised by docs and expected by luatex
    - removed stdio patch (obsoleted by gcc44 patch)

 format-security.patch       |  51 +++++
 texlive-stdio.patch         |  10 -
 texlive-system-libpng.patch | 453 ++++++++++++++++++++++++++++++++++++++++++++
 texlive-system-zzip.patch   |  38 ++++
 texlive.spec                | 132 +++++++------
 5 files changed, 619 insertions(+), 65 deletions(-)
---
diff --git a/texlive.spec b/texlive.spec
index 514c901..5badbb8 100644
--- a/texlive.spec
+++ b/texlive.spec
@@ -84,7 +84,6 @@ Patch0:		%{name}-am.patch
 Patch1:		%{name}-20080816-kpathsea-ar.patch
 Patch2:		%{name}-gcc44.patch
 Patch3:		%{name}-getline.patch
-Patch4:		%{name}-stdio.patch
 Patch5:		%{name}-aclocal.patch
 Patch6:		%{name}-libpng.patch
 Patch7:		%{name}-libpng15.patch
@@ -92,6 +91,8 @@ Patch8:		%{name}-extramembot.patch
 Patch9:		%{name}-5yr-old.patch
 Patch10:	format-security.patch
 Patch11:	%{name}-clisp.patch
+Patch12:	%{name}-system-libpng.patch
+Patch13:	%{name}-system-zzip.patch
 URL:		http://www.tug.org/texlive/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -158,6 +159,7 @@ BuildRequires:	xorg-lib-libXext-devel
 BuildRequires:	xorg-lib-libXmu-devel
 BuildRequires:	xorg-lib-libXpm-devel
 BuildRequires:	zlib-devel >= 1.2.1
+BuildRequires:	zziplib-devel
 Requires:	%{name}-dirs-fonts = %{epoch}:%{version}-%{release}
 Requires:	%{name}-fonts-cm = %{epoch}:%{version}-%{release}
 Requires:	%{name}-fonts-misc = %{epoch}:%{version}-%{release}
@@ -6398,6 +6400,20 @@ BuildArch:	noarch
 XMLTeX is a non-validating, namespace-aware XML parser written in TeX.
 It allows TeX to directly process XML files.
 
+%package luatex
+Summary:	Extended version of pdfTeX using Lua as an embedded scripting language
+Summary(pl.UTF-8):	Rozszerzona wersja pdfTeXa wykorzystująca Lua jako wbudowany język skryptowy
+Group:		Applications/Publishing/TeX
+Requires(post,postun):	/usr/bin/texhash
+
+%description luatex
+LuaTeX is an extended version of pdfTeX using Lua as an embedded
+scripting language.
+
+%description luatex -l pl.UTF-8
+LuaTeX to rozszerzona wersja pdfTeXa, wykorzystująca Lua jako
+wbudowany język skryptowy.
+
 %prep
 %setup -q -c -T -n %{name}-%{version}-source
 lzma -dc %{SOURCE0} | tar xf - -C ..
@@ -6405,39 +6421,39 @@ lzma -dc %{SOURCE0} | tar xf - -C ..
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p1
 %patch5 -p1
 %patch6 -p0
 %patch7 -p1
 %patch8 -p1
 %patch10 -p1
 %patch11 -p1
-CURDIR=$(pwd)
+%patch12 -p1
+%patch13 -p1
 
+CURDIR=$(pwd)
 cd utils/xindy/make-rules/alphabets
 tar xvf %{SOURCE11}
 cp $(find fonts -type f) .
 for i in larm?00.tfm; do ln -s $i $(echo $i | sed "s at larm\(.\).*@larm0\100.tfm@") ; done
 cd ${CURDIR}
 
+%build
+find . -name "config.sub" -exec cp /usr/share/automake/config.sub '{}' ';'
+%{__sed} -i 's@"extend/\(.*\)"@<\1>@' texk/ttf2pk/*.c
+%{__sed} -e 's@^TEXMFMAIN =.*@TEXMFMAIN = %{texmf}@' \
+	-e 's@^TEXMFDIST =.*@TEXMFDIST = %{texmfdist}@' \
+	-e 's@^TEXMFLOCAL =.*@TEXMFLOCAL = %{texmf}@' \
+	-e 's@^TEXMFSYSVAR =.*@TEXMFSYSVAR = %{_localstatedir}@' \
+	-e 's@^TEXMFSYSCONFIG =.*@TEXMFSYSCONFIG = %{_sysconfdir}/%{name}@' \
+	-e 's@^TEXMFVAR =.*@TEXMFVAR = %{_localstatedir}@' \
+	-e 's@^trie_size.*@trie_size = 1262000@' -i texk/kpathsea/texmf.cnf
+
 cd libs/teckit
 cat ax*.m4 > acinclude.m4
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
 %{__automake}
-
-%build
-find . -name "config.sub" -exec cp /usr/share/automake/config.sub '{}' ';'
-%{__sed} -i 's@"extend/\(.*\)"@<\1>@' texk/ttf2pk/*.c
-cd texk/kpathsea
-%{__sed} -i 's@^TEXMFMAIN =.*@TEXMFMAIN = %{texmf}@' texmf.cnf
-%{__sed} -i 's@^TEXMFDIST =.*@TEXMFDIST = %{texmfdist}@' texmf.cnf
-%{__sed} -i 's@^TEXMFLOCAL =.*@TEXMFLOCAL = %{texmf}@' texmf.cnf
-%{__sed} -i 's@^TEXMFSYSVAR =.*@TEXMFSYSVAR = %{_localstatedir}@' texmf.cnf
-%{__sed} -i 's@^TEXMFSYSCONFIG =.*@TEXMFSYSCONFIG = %{_sysconfdir}/%{name}@' texmf.cnf
-%{__sed} -i 's@^TEXMFVAR =.*@TEXMFVAR = %{_localstatedir}@' texmf.cnf
-%{__sed} -i 's@^trie_size.*@trie_size = 1262000@' texmf.cnf
 cd ../..
 
 %ifarch ppc ppc64
@@ -6445,9 +6461,11 @@ cd ../..
 ulimit -s unlimited
 %endif
 
-%configure \
-	--with%{!?with_xindy:out}-xindy \
-	--without-luatex \
+install -d build/utils/xindy/make-rules/alphabets
+for f in utils/xindy/make-rules/alphabets/larm????.* ; do ln -sf ../../../../../$f build/$f ; done
+cd build
+../%configure \
+	--with-xindy%{!?with_xindy:=no}\
 	--disable-multiplatform \
 	--disable-static \
 	--enable-a4 \
@@ -6515,7 +6533,7 @@ install -d $RPM_BUILD_ROOT%{texmf}/fonts/opentype/public
 
 LD_LIBRARY_PATH=$RPM_BUILD_ROOT%{_libdir}; export LD_LIBRARY_PATH
 
-%{__make} install \
+%{__make} -C build install \
 	prefix=$RPM_BUILD_ROOT%{_prefix} \
 	bindir=$RPM_BUILD_ROOT%{_bindir} \
 	mandir=$RPM_BUILD_ROOT%{_mandir} \
@@ -6643,7 +6661,7 @@ tex user_manual.tex
 yes | tex prog_manual.tex
 tex example1.tex
 tex example2.tex
-rm formlett.sty
+%{__rm} formlett.sty
 
 cd $CURDIR
 
@@ -6670,7 +6688,7 @@ cp $RPM_BUILD_ROOT%{texmfdist}/doc/latex/xstring/xstring.tex $RPM_BUILD_ROOT%{te
 %{__rm} -r $RPM_BUILD_ROOT%{texmf}/doc/man
 %{__rm} -r $RPM_BUILD_ROOT%{texmfdoc}/source
 
-perl -pi \
+%{__perl} -pi \
 	-e "s|$RPM_BUILD_ROOT||g;" \
 	$RPM_BUILD_ROOT%{texmf}/web2c/texmf.cnf
 
@@ -6682,37 +6700,20 @@ install %{SOURCE6} $RPM_BUILD_ROOT%{_pixmapsdir}
 # not included in package
 rm -f $RPM_BUILD_ROOT%{_datadir}/texinfo/html/texi2html.html
 rm -f $RPM_BUILD_ROOT%{_infodir}/dir*
-rm -f $RPM_BUILD_ROOT%{_infodir}/dvipng*
-rm -f $RPM_BUILD_ROOT%{_mandir}/{README.*,hu/man1/readlink.1*}
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/Makefile
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/fonts/oldgerman/COPYING
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/help/Catalogue-upd.sh
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/help/faq/uktug-faq-upd.sh
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/helpfile
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/helpindex.html
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/index.html
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/index.php
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/mkhtml*
-rm -f $RPM_BUILD_ROOT%{texmf}/doc/programs/texinfo.*
-rm -f $RPM_BUILD_ROOT%{texmf}/fonts/pk/ljfour/lh/lh-lcy/*.600pk
-rm -f $RPM_BUILD_ROOT%{texmf}/generic/config/pdftex-dvi.tex
-rm -f $RPM_BUILD_ROOT%{texmf}/release-tetex-{src,texmf}.txt
-rm -f $RPM_BUILD_ROOT%{texmf}/scripts/uniqleaf/uniqleaf.pl
-rm -f $RPM_BUILD_ROOT%{texmf}/tex/generic/pdftex/glyphtounicode.tex
-rm -rf $RPM_BUILD_ROOT%{_datadir}/lcdf-typetools
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/doc/generic/pdf-trans
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/source/generic/hyph-utf8
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/source/generic/patch
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/source/plain/plgraph
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/tex/generic/pdf-trans
-rm -rf $RPM_BUILD_ROOT%{texmfdist}/tex/generic/xecyr
-rm -rf $RPM_BUILD_ROOT%{texmf}/cef5conv
-rm -rf $RPM_BUILD_ROOT%{texmf}/cefsconv
-rm -rf $RPM_BUILD_ROOT%{texmf}/chktex
-rm -rf $RPM_BUILD_ROOT%{texmf}/doc/cef5conv
-rm -rf $RPM_BUILD_ROOT%{texmf}/doc/cefsconv
-rm -rf $RPM_BUILD_ROOT%{texmf}/doc/chktex
-rm -rf $RPM_BUILD_ROOT%{texmf}/doc/gzip
+%{__rm} $RPM_BUILD_ROOT%{_infodir}/dvipng*
+%{__rm} $RPM_BUILD_ROOT%{texmf}/tex/generic/pdftex/glyphtounicode.tex
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/lcdf-typetools
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/doc/generic/pdf-trans
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/source/generic/hyph-utf8
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/source/generic/patch
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/source/plain/plgraph
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/tex/generic/pdf-trans
+%{__rm} -r $RPM_BUILD_ROOT%{texmfdist}/tex/generic/xecyr
+%{__rm} -r $RPM_BUILD_ROOT%{texmf}/chktex
+%{__rm} -r $RPM_BUILD_ROOT%{texmf}/doc/cef5conv
+%{__rm} -r $RPM_BUILD_ROOT%{texmf}/doc/cefsconv
+%{__rm} -r $RPM_BUILD_ROOT%{texmf}/doc/chktex
+%{__rm} -r $RPM_BUILD_ROOT%{texmf}/doc/gzip
 
 # move format logs to BUILD, so $RPM_BUILD_ROOT is not polluted
 # and we can still analyze them
@@ -6720,8 +6721,10 @@ rm -rf $RPM_BUILD_ROOT%{texmf}/doc/gzip
 # mv -fv $RPM_BUILD_ROOT%{fmtdir}/*.log format-logs
 
 # xindy files are in %%{texmf}
-rm -rf $RPM_BUILD_ROOT%{_datadir}/xindy
-rm -rf $RPM_BUILD_ROOT%{_docdir}
+%if %{with xindy}
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/xindy
+%{__rm} -r $RPM_BUILD_ROOT%{_docdir}
+%endif
 
 # Create format files
 for format in \
@@ -6758,8 +6761,9 @@ done
 %if %{with bootstrap}
 touch $RPM_BUILD_ROOT%{fmtdir}/xetex/xelatex.fmt
 %endif
+
 # We don't need the log files
-rm -f $(find $RPM_BUILD_ROOT%{fmtdir} -name "*.log")
+find $RPM_BUILD_ROOT%{fmtdir} -name "*.log" | xargs -r %{__rm}
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -8251,6 +8255,12 @@ fi
 %postun xmltex
 %texhash
 
+%post luatex
+%texhash
+
+%postun luatex
+%texhash
+
 %files
 %defattr(644,root,root,755)
 # There isn't doc/fonts directory
@@ -9361,6 +9371,7 @@ fi
 %files pdftex
 %defattr(644,root,root,755)
 %config(noreplace) %verify(not md5 mtime size) %{texmf}/tex/generic/config/pdftexconfig.tex
+%config(noreplace) %verify(not md5 mtime size) %{texmf}/tex/generic/config/pdftex-dvi.tex
 %dir %{texmfdist}/doc/support
 %dir %{texmf}/fonts/map/pdftex
 %dir %{texmf}/scripts/epstopdf
@@ -13283,6 +13294,7 @@ fi
 %dir %{texmfdist}/fonts/map/dvips
 %dir %{texmfdist}/fonts/pk/ljfour/public
 %doc %{texmfdist}/doc/fonts/cm
+%{texmfdist}/fonts/afm/bluesky/ams
 %{texmfdist}/fonts/afm/bluesky/cm
 %{texmfdist}/fonts/map/dvips/cm
 %{texmfdist}/fonts/pk/ljfour/public/cm
@@ -14702,3 +14714,13 @@ fi
 %{texmf}/fmtutil/format.xmltex.cnf
 %{fmtdir}/pdftex/pdfxmltex.fmt
 %{fmtdir}/pdftex/xmltex.fmt
+
+%files luatex
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/lualatex
+%attr(755,root,root) %{_bindir}/luatex
+%attr(755,root,root) %{_bindir}/pdflualatex
+%attr(755,root,root) %{_bindir}/pdfluatex
+%attr(755,root,root) %{_bindir}/texlua
+%attr(755,root,root) %{_bindir}/texluac
+
diff --git a/format-security.patch b/format-security.patch
index 28842ff..3842ee6 100644
--- a/format-security.patch
+++ b/format-security.patch
@@ -607,3 +607,54 @@
  	/* Note: If a mad function continues to open popups, this will
  	 * stop after MAX_POPUPS, but open a new window for each
  	 * window the user pops down. Maybe we ought to do something
+--- texlive-20080816-source/texk/web2c/luatexdir/font/subfont.c.orig	2008-03-24 16:47:15.000000000 +0100
++++ texlive-20080816-source/texk/web2c/luatexdir/font/subfont.c	2016-07-20 18:08:12.696272467 +0200
+@@ -162,7 +162,7 @@
+       sfd_close();
+     }
+     tex_printf ("{");
+-    tex_printf (cur_file_name);
++    tex_printf ("%s", cur_file_name);
+     sfd = new_sfd_entry ();
+     sfd->name = xstrdup (sfd_name);
+     while (!sfd_eof ()) {
+--- texlive-20080816-source/texk/web2c/luatexdir/font/writet1.c.orig	2008-03-24 16:47:15.000000000 +0100
++++ texlive-20080816-source/texk/web2c/luatexdir/font/writet1.c	2016-07-20 19:32:56.457541671 +0200
+@@ -27,7 +27,7 @@
+ #  include <string.h>
+ #  include "luatex-api.h"
+ 
+-#  define t1_log(s)        if(tracefilenames) tex_printf(s)
++#  define t1_log(s)        if(tracefilenames) tex_printf("%s", s)
+ #  define get_length1()    t1_length1 = t1_offset() - t1_save_offset
+ #  define get_length2()    t1_length2 = t1_offset() - t1_save_offset
+ #  define get_length3()    t1_length3 = fixedcontent? t1_offset() - t1_save_offset : 0
+--- texlive-20080816-source/texk/web2c/luatexdir/image/pdftoepdf.cc.orig	2008-04-18 14:27:06.000000000 +0200
++++ texlive-20080816-source/texk/web2c/luatexdir/image/pdftoepdf.cc	2016-07-20 19:33:45.793414942 +0200
+@@ -858,13 +858,13 @@
+         if (writematrix) {      // The matrix is only written if the image is rotated.
+             sprintf(s, "/Matrix [%.8f %.8f %.8f %.8f %.8f %.8f]\n",
+                     scale[0], scale[1], scale[2], scale[3], scale[4], scale[5]);
+-            pdf_printf(stripzeros(s));
++            pdf_printf("%s", stripzeros(s));
+         }
+     }
+ 
+     sprintf(s, "/BBox [%.8f %.8f %.8f %.8f]\n",
+             pagebox->x1, pagebox->y1, pagebox->x2, pagebox->y2);
+-    pdf_printf(stripzeros(s));
++    pdf_printf("%s", stripzeros(s));
+ 
+     // write the page Group if it's there
+     if (page->getGroup() != NULL) {
+--- texlive-20080816-source/texk/web2c/luatexdir/image/writeimg.c.orig	2008-04-28 10:45:24.000000000 +0200
++++ texlive-20080816-source/texk/web2c/luatexdir/image/writeimg.c	2016-07-20 19:34:04.597716369 +0200
+@@ -269,7 +269,7 @@
+ void pdf_print_resname_prefix()
+ {
+     if (pdf_resname_prefix != 0)
+-        pdf_printf(makecstring(pdf_resname_prefix));
++        pdf_printf("%s", makecstring(pdf_resname_prefix));
+ }
+ 
+ void read_img(image_dict * idict, integer pdf_minor_version,
diff --git a/texlive-stdio.patch b/texlive-stdio.patch
deleted file mode 100644
index 40f4596..0000000
--- a/texlive-stdio.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- texlive-20080816-source.orig/libs/teckit/source/Compiler.h	2009-07-04 10:12:18.509825692 +0200
-+++ texlive-20080816-source/libs/teckit/source/Compiler.h	2009-07-04 11:21:01.692867633 +0200
-@@ -56,6 +56,7 @@
- #include <string>
- #include <vector>
- #include <map>
-+#include <stdio.h>
- 
- using namespace std;
- 
diff --git a/texlive-system-libpng.patch b/texlive-system-libpng.patch
new file mode 100644
index 0000000..0fc9e22
--- /dev/null
+++ b/texlive-system-libpng.patch
@@ -0,0 +1,453 @@
+--- texlive-20080816-source/texk/web2c/luatexdir/image/image.h.orig	2008-04-28 10:45:24.000000000 +0200
++++ texlive-20080816-source/texk/web2c/luatexdir/image/image.h	2016-07-23 18:18:25.545919882 +0200
+@@ -22,7 +22,7 @@
+ #ifndef IMAGE_H
+ #  define IMAGE_H
+ 
+-#  include <../libpng/png.h>
++#  include <png.h>
+ 
+ #  define JPG_UINT16      unsigned int
+ #  define JPG_UINT32      unsigned long
+--- texlive-20080816-source/texk/web2c/luatexdir/image/writepng.c.orig	2008-04-28 10:45:24.000000000 +0200
++++ texlive-20080816-source/texk/web2c/luatexdir/image/writepng.c	2016-07-24 08:43:25.776117469 +0200
+@@ -59,7 +59,7 @@
+     if ((info_p = png_create_info_struct(png_p)) == NULL)
+         pdftex_fail("libpng: png_create_info_struct() failed");
+     img_png_info_ptr(idict) = info_p;
+-    if (setjmp(png_p->jmpbuf))
++    if (png_jmpbuf(png_p))
+         pdftex_fail("libpng: internal error");
+     png_init_io(png_p, img_file(idict));
+     png_read_info(png_p, info_p);
+@@ -68,12 +68,12 @@
+         png_set_tRNS_to_alpha(png_p);
+     }
+     /* alpha channel support  */
+-    if (fixed_pdf_minor_version < 4 && png_p->color_type | PNG_COLOR_MASK_ALPHA)
++    if (fixed_pdf_minor_version < 4 && png_get_color_type(png_p, info_p) & PNG_COLOR_MASK_ALPHA)
+         png_set_strip_alpha(png_p);
+     /* 16bit depth support */
+     if (fixed_pdf_minor_version < 5)
+         fixed_image_hicolor = 0;
+-    if (info_p->bit_depth == 16 && !fixed_image_hicolor)
++    if (png_get_bit_depth(png_p, info_p) == 16 && !fixed_image_hicolor)
+         png_set_strip_16(png_p);
+     /* gamma support */
+     if (fixed_image_apply_gamma) {
+@@ -86,15 +86,15 @@
+     /* reset structure */
+     png_read_update_info(png_p, info_p);
+     /* resolution support */
+-    img_xsize(idict) = info_p->width;
+-    img_ysize(idict) = info_p->height;
+-    if (info_p->valid & PNG_INFO_pHYs) {
++    img_xsize(idict) = png_get_image_width(png_p, info_p);
++    img_ysize(idict) = png_get_image_height(png_p, info_p);
++    if (png_get_valid(png_p, info_p, PNG_INFO_pHYs)) {
+         img_xres(idict) =
+             round(0.0254 * png_get_x_pixels_per_meter(png_p, info_p));
+         img_yres(idict) =
+             round(0.0254 * png_get_y_pixels_per_meter(png_p, info_p));
+     }
+-    switch (info_p->color_type) {
++    switch (png_get_color_type(png_p, info_p)) {
+     case PNG_COLOR_TYPE_PALETTE:
+         img_color(idict) = IMAGE_COLOR_C | IMAGE_COLOR_I;
+         break;
+@@ -107,9 +107,9 @@
+         img_color(idict) = IMAGE_COLOR_C;
+         break;
+     default:
+-        pdftex_fail("unsupported type of color_type <%i>", info_p->color_type);
++        pdftex_fail("unsupported type of color_type <%i>", png_get_color_type(png_p, info_p));
+     }
+-    img_colordepth(idict) = info_p->bit_depth;
++    img_colordepth(idict) = png_get_bit_depth(png_p, info_p);
+     if (readtype == IMG_CLOSEINBETWEEN)
+         close_and_cleanup_png(idict);
+ }
+@@ -134,10 +134,10 @@
+ #define write_simple_pixel(r)    pdf_buf[pdf_ptr++] = *r++
+ 
+ #define write_noninterlaced(outmac)                      \
+-  for (i = 0; (unsigned) i < (int)info_p->height; i++) { \
++  for (i = 0; (unsigned) i < (int)height; i++) {         \
+     png_read_row(png_p, row, NULL);                      \
+     r = row;                                             \
+-    k = info_p->rowbytes;                                \
++    k = rowbytes;                                        \
+     while(k > 0) {                                       \
+ 	l = (k > pdf_buf_size)? pdf_buf_size : k;        \
+ 		pdfroom(l);                              \
+@@ -149,9 +149,9 @@
+         }
+ 
+ #define write_interlaced(outmac)                         \
+-  for (i = 0; (unsigned) i < (int)info_p->height; i++) { \
++  for (i = 0; (unsigned) i < (int)height; i++) {         \
+             row = rows[i];                               \
+-	    k = info_p->rowbytes;                        \
++	    k = rowbytes;                                \
+ 	    while(k > 0) {                               \
+ 		l = (k > pdf_buf_size)? pdf_buf_size : k;\
+ 		pdfroom(l);                              \
+@@ -173,36 +173,46 @@
+     if (img_colorspace(idict) != 0) {
+         pdf_printf("%i 0 R\n", (int) img_colorspace(idict));
+     } else {
++	png_colorp palette;
++	int num_palette;
+         pdf_create_obj(0, 0);
+         palette_objnum = obj_ptr;
++	png_get_PLTE(png_p, info_p, &palette, &num_palette);
+         pdf_printf("[/Indexed /DeviceRGB %i %i 0 R]\n",
+-                   (int) (info_p->num_palette - 1), (int) palette_objnum);
++                   (int) (num_palette - 1), (int) palette_objnum);
+     }
+     pdf_begin_stream();
+-    if (info_p->interlace_type == PNG_INTERLACE_NONE) {
+-        row = xtalloc(info_p->rowbytes, png_byte);
++    if (png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE) {
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        row = xtalloc(rowbytes, png_byte);
+         write_noninterlaced(write_simple_pixel(r));
+         xfree(row);
+     } else {
+-        if (info_p->height * info_p->rowbytes >= 10240000L)
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        if (height * rowbytes >= 10240000L)
+             pdftex_warn
+                 ("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
+-        rows = xtalloc(info_p->height, png_bytep);
+-        for (i = 0; (unsigned) i < info_p->height; i++)
+-            rows[i] = xtalloc(info_p->rowbytes, png_byte);
++        rows = xtalloc(height, png_bytep);
++        for (i = 0; (unsigned) i < height; i++)
++            rows[i] = xtalloc(rowbytes, png_byte);
+         png_read_image(png_p, rows);
+         write_interlaced(write_simple_pixel(row));
+         xfree(rows);
+     }
+     pdf_end_stream();
+     if (palette_objnum > 0) {
++        png_colorp palette;
++	int num_palette;
++	png_get_PLTE(png_p, info_p, &palette, &num_palette);
+         pdf_begin_dict(palette_objnum, 0);
+         pdf_begin_stream();
+-        for (i = 0; (unsigned) i < info_p->num_palette; i++) {
++        for (i = 0; (unsigned) i < num_palette; i++) {
+             pdfroom(3);
+-            pdf_buf[pdf_ptr++] = info_p->palette[i].red;
+-            pdf_buf[pdf_ptr++] = info_p->palette[i].green;
+-            pdf_buf[pdf_ptr++] = info_p->palette[i].blue;
++            pdf_buf[pdf_ptr++] = palette[i].red;
++            pdf_buf[pdf_ptr++] = palette[i].green;
++            pdf_buf[pdf_ptr++] = palette[i].blue;
+         }
+         pdf_end_stream();
+     }
+@@ -220,17 +230,21 @@
+         pdf_puts("/DeviceGray\n");
+     }
+     pdf_begin_stream();
+-    if (info_p->interlace_type == PNG_INTERLACE_NONE) {
+-        row = xtalloc(info_p->rowbytes, png_byte);
++    if (png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE) {
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        row = xtalloc(rowbytes, png_byte);
+         write_noninterlaced(write_simple_pixel(r));
+         xfree(row);
+     } else {
+-        if (info_p->height * info_p->rowbytes >= 10240000L)
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        if (height * rowbytes >= 10240000L)
+             pdftex_warn
+                 ("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
+-        rows = xtalloc(info_p->height, png_bytep);
+-        for (i = 0; (unsigned) i < info_p->height; i++)
+-            rows[i] = xtalloc(info_p->rowbytes, png_byte);
++        rows = xtalloc(height, png_bytep);
++        for (i = 0; (unsigned) i < height; i++)
++            rows[i] = xtalloc(rowbytes, png_byte);
+         png_read_image(png_p, rows);
+         write_interlaced(write_simple_pixel(row));
+         xfree(rows);
+@@ -257,26 +271,30 @@
+     pdf_create_obj(0, 0);
+     smask_objnum = obj_ptr;
+     pdf_printf("/SMask %i 0 R\n", (int) smask_objnum);
+-    smask_size = (info_p->rowbytes / 2) * info_p->height;
++    smask_size = (png_get_rowbytes(png_p, info_p) / 2) * png_get_image_height(png_p, info_p);
+     smask = xtalloc(smask_size, png_byte);
+     pdf_begin_stream();
+-    if (info_p->interlace_type == PNG_INTERLACE_NONE) {
+-        row = xtalloc(info_p->rowbytes, png_byte);
+-        if ((info_p->bit_depth == 16) && fixed_image_hicolor) {
++    if (png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE) {
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        row = xtalloc(rowbytes, png_byte);
++        if ((png_get_bit_depth(png_p, info_p) == 16) && fixed_image_hicolor) {
+             write_noninterlaced(write_gray_pixel_16(r));
+         } else {
+             write_noninterlaced(write_gray_pixel_8(r));
+         }
+         xfree(row);
+     } else {
+-        if (info_p->height * info_p->rowbytes >= 10240000L)
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        if (height * rowbytes >= 10240000L)
+             pdftex_warn
+                 ("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
+-        rows = xtalloc(info_p->height, png_bytep);
+-        for (i = 0; (unsigned) i < info_p->height; i++)
+-            rows[i] = xtalloc(info_p->rowbytes, png_byte);
++        rows = xtalloc(height, png_bytep);
++        for (i = 0; (unsigned) i < height; i++)
++            rows[i] = xtalloc(rowbytes, png_byte);
+         png_read_image(png_p, rows);
+-        if ((info_p->bit_depth == 16) && fixed_image_hicolor) {
++        if ((png_get_bit_depth(png_p, info_p) == 16) && fixed_image_hicolor) {
+             write_interlaced(write_gray_pixel_16(row));
+         } else {
+             write_interlaced(write_gray_pixel_8(row));
+@@ -286,14 +304,14 @@
+     pdf_end_stream();
+     pdf_flush();
+     /* now write the Smask object */
+-    bitdepth = (int) info_p->bit_depth;
++    bitdepth = (int) png_get_bit_depth(png_p, info_p);
+     pdf_begin_dict(smask_objnum, 0);
+     pdf_puts("/Type /XObject\n/Subtype /Image\n");
+     if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
+         pdf_printf("%s\n", img_attr(idict));
+     pdf_printf("/Width %i\n/Height %i\n/BitsPerComponent %i\n",
+-               (int) info_p->width,
+-               (int) info_p->height, (bitdepth == 16 ? 8 : bitdepth));
++               (int) png_get_image_width(png_p, info_p),
++               (int) png_get_image_height(png_p, info_p), (bitdepth == 16 ? 8 : bitdepth));
+     pdf_puts("/ColorSpace /DeviceGray\n");
+     pdf_begin_stream();
+     for (i = 0; i < smask_size; i++) {
+@@ -319,17 +337,21 @@
+         pdf_puts("/DeviceRGB\n");
+     }
+     pdf_begin_stream();
+-    if (info_p->interlace_type == PNG_INTERLACE_NONE) {
+-        row = xtalloc(info_p->rowbytes, png_byte);
++    if (png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE) {
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        row = xtalloc(rowbytes, png_byte);
+         write_noninterlaced(write_simple_pixel(r));
+         xfree(row);
+     } else {
+-        if (info_p->height * info_p->rowbytes >= 10240000L)
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        if (height * rowbytes >= 10240000L)
+             pdftex_warn
+                 ("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
+-        rows = xtalloc(info_p->height, png_bytep);
+-        for (i = 0; (unsigned) i < info_p->height; i++)
+-            rows[i] = xtalloc(info_p->rowbytes, png_byte);
++        rows = xtalloc(height, png_bytep);
++        for (i = 0; (unsigned) i < height; i++)
++            rows[i] = xtalloc(rowbytes, png_byte);
+         png_read_image(png_p, rows);
+         write_interlaced(write_simple_pixel(row));
+         xfree(rows);
+@@ -356,26 +378,30 @@
+     pdf_create_obj(0, 0);
+     smask_objnum = obj_ptr;
+     pdf_printf("/SMask %i 0 R\n", (int) smask_objnum);
+-    smask_size = (info_p->rowbytes / 2) * info_p->height;
++    smask_size = (png_get_rowbytes(png_p, info_p) / 2) * png_get_image_height(png_p, info_p);
+     smask = xtalloc(smask_size, png_byte);
+     pdf_begin_stream();
+-    if (info_p->interlace_type == PNG_INTERLACE_NONE) {
+-        row = xtalloc(info_p->rowbytes, png_byte);
+-        if ((info_p->bit_depth == 16) && fixed_image_hicolor) {
++    if (png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE) {
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        row = xtalloc(rowbytes, png_byte);
++        if ((png_get_bit_depth(png_p, info_p) == 16) && fixed_image_hicolor) {
+             write_noninterlaced(write_rgb_pixel_16(r));
+         } else {
+             write_noninterlaced(write_rgb_pixel_8(r));
+         }
+         xfree(row);
+     } else {
+-        if (info_p->height * info_p->rowbytes >= 10240000L)
++        png_uint_32 height = png_get_image_height(png_p, info_p);
++	png_size_t rowbytes = png_get_rowbytes(png_p, info_p);
++        if (height * rowbytes >= 10240000L)
+             pdftex_warn
+                 ("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
+-        rows = xtalloc(info_p->height, png_bytep);
+-        for (i = 0; (unsigned) i < info_p->height; i++)
+-            rows[i] = xtalloc(info_p->rowbytes, png_byte);
++        rows = xtalloc(height, png_bytep);
++        for (i = 0; (unsigned) i < height; i++)
++            rows[i] = xtalloc(rowbytes, png_byte);
+         png_read_image(png_p, rows);
+-        if ((info_p->bit_depth == 16) && fixed_image_hicolor) {
++        if ((png_get_bit_depth(png_p, info_p) == 16) && fixed_image_hicolor) {
+             write_interlaced(write_rgb_pixel_16(row));
+         } else {
+             write_interlaced(write_rgb_pixel_8(row));
+@@ -386,14 +412,14 @@
+     pdf_flush();
+     /* now write the Smask object */
+     if (smask_objnum > 0) {
+-        bitdepth = (int) info_p->bit_depth;
++        bitdepth = (int) png_get_bit_depth(png_p, info_p);
+         pdf_begin_dict(smask_objnum, 0);
+         pdf_puts("/Type /XObject\n/Subtype /Image\n");
+         if (img_attr(idict) != NULL)
+             pdf_printf("%s\n", img_attr(idict));
+         pdf_printf("/Width %i\n/Height %i\n/BitsPerComponent %i\n",
+-                   (int) info_p->width,
+-                   (int) info_p->height, (bitdepth == 16 ? 8 : bitdepth));
++                   (int) png_get_image_width(png_p, info_p),
++                   (int) png_get_image_height(png_p, info_p), (bitdepth == 16 ? 8 : bitdepth));
+         pdf_puts("/ColorSpace /DeviceGray\n");
+         pdf_begin_stream();
+         for (i = 0; i < smask_size; i++) {
+@@ -442,7 +468,7 @@
+     assert(idict != NULL);
+     png_p = img_png_png_ptr(idict);
+     info_p = img_png_info_ptr(idict);
+-    fp = (FILE *) png_p->io_ptr;
++    fp = (FILE *) png_get_io_ptr(png_p);
+     /* 1st pass to find overall stream /Length */
+     if (fseek(fp, 8, SEEK_SET) != 0)
+         pdftex_fail("writepng: fseek in PNG file failed");
+@@ -463,9 +489,9 @@
+     pdf_printf("/Length %d\n", streamlength);
+     pdf_printf("/Filter /FlateDecode\n");
+     pdf_printf("/DecodeParms << ");
+-    pdf_printf("/Colors %d ", info_p->color_type == 2 ? 3 : 1);
+-    pdf_printf("/Columns %d ", (int) info_p->width);
+-    pdf_printf("/BitsPerComponent %i ", (int) info_p->bit_depth);
++    pdf_printf("/Colors %d ", png_get_color_type(png_p, info_p) == PNG_COLOR_TYPE_RGB ? 3 : 1);
++    pdf_printf("/Columns %d ", (int) png_get_image_width(png_p, info_p));
++    pdf_printf("/BitsPerComponent %i ", (int) png_get_bit_depth(png_p, info_p));
+     pdf_printf("/Predictor %d ", 10);   /* actual predictor defined on line basis */
+     pdf_printf(">>\n>>\nstream\n");
+     /* 2nd pass to copy data */
+@@ -535,8 +561,8 @@
+     if (img_attr(idict) != NULL && strlen(img_attr(idict)) > 0)
+         pdf_printf("%s\n", img_attr(idict));
+     pdf_printf("/Width %i\n/Height %i\n/BitsPerComponent %i\n",
+-               (int) info_p->width,
+-               (int) info_p->height, (int) info_p->bit_depth);
++               (int) png_get_image_width(png_p, info_p),
++               (int) png_get_image_height(png_p, info_p), (int) png_get_bit_depth(png_p, info_p));
+     pdf_puts("/ColorSpace ");
+     checked_gamma = 1.0;
+     if (fixed_image_apply_gamma) {
+@@ -549,22 +575,27 @@
+     }
+     /* the switching between |info_p| and |png_p| queries has been trial and error. 
+      */
+-    if (fixed_pdf_minor_version > 1 && info_p->interlace_type == PNG_INTERLACE_NONE && (png_p->transformations == 0 || png_p->transformations == 0x2000)        /* gamma */
+-        &&!(png_p->color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
+-            png_p->color_type == PNG_COLOR_TYPE_RGB_ALPHA)
+-        && (fixed_image_hicolor || (png_p->bit_depth <= 8))
++    if (fixed_pdf_minor_version > 1 && png_get_interlace_type(png_p, info_p) == PNG_INTERLACE_NONE /* && (png_p->transformations == PNG_TRANSFORM_IDENTITY || png_p->transformations == PNG_TRANSFORM_GRAY_TO_PNG) */        /* gamma */
++        &&!(png_get_color_type(png_p, info_p) == PNG_COLOR_TYPE_GRAY_ALPHA ||
++            png_get_color_type(png_p, info_p) == PNG_COLOR_TYPE_RGB_ALPHA)
++        && (fixed_image_hicolor || (png_get_bit_depth(png_p, info_p) <= 8))
+         && (checked_gamma <= 1.01 && checked_gamma > 0.99)
+         ) {
+         if (img_colorspace(idict) != 0) {
+             pdf_printf("%i 0 R\n", (int) img_colorspace(idict));
+         } else {
+-            switch (info_p->color_type) {
++            switch (png_get_color_type(png_p, info_p)) {
+             case PNG_COLOR_TYPE_PALETTE:
++	        {
++		png_colorp palette;
++		int num_palette;
++		png_get_PLTE(png_p, info_p, &palette, &num_palette);
+                 pdf_create_obj(0, 0);
+                 palette_objnum = obj_ptr;
+                 pdf_printf("[/Indexed /DeviceRGB %i %i 0 R]\n",
+-                           (int) (info_p->num_palette - 1),
++                           (int) (num_palette - 1),
+                            (int) palette_objnum);
++		}
+                 break;
+             case PNG_COLOR_TYPE_GRAY:
+                 pdf_puts("/DeviceGray\n");
+@@ -577,13 +608,16 @@
+             tex_printf(" (PNG copy)");
+         copy_png(idict);
+         if (palette_objnum > 0) {
++	    png_colorp palette;
++	    int num_palette;
++	    png_get_PLTE(png_p, info_p, &palette, &num_palette);
+             pdf_begin_dict(palette_objnum, 0);
+             pdf_begin_stream();
+-            for (i = 0; (unsigned) i < info_p->num_palette; i++) {
++            for (i = 0; (unsigned) i < num_palette; i++) {
+                 pdfroom(3);
+-                pdf_buf[pdf_ptr++] = info_p->palette[i].red;
+-                pdf_buf[pdf_ptr++] = info_p->palette[i].green;
+-                pdf_buf[pdf_ptr++] = info_p->palette[i].blue;
++                pdf_buf[pdf_ptr++] = palette[i].red;
++                pdf_buf[pdf_ptr++] = palette[i].green;
++                pdf_buf[pdf_ptr++] = palette[i].blue;
+             }
+             pdf_end_stream();
+         }
+@@ -593,22 +627,22 @@
+             if (fixed_image_apply_gamma &&
+                 (checked_gamma > 1.01 || checked_gamma < 0.99))
+                 tex_printf("gamma delta=%lf ", checked_gamma);
+-            if (png_p->transformations != PNG_TRANSFORM_IDENTITY)
+-                tex_printf("transform=%lu", (long) png_p->transformations);
+-            if ((info_p->color_type != PNG_COLOR_TYPE_GRAY)
+-                && (info_p->color_type != PNG_COLOR_TYPE_RGB)
+-                && (info_p->color_type != PNG_COLOR_TYPE_PALETTE))
++            /* if (png_p->transformations != PNG_TRANSFORM_IDENTITY)
++                tex_printf("transform=%lu", (long) png_p->transformations); */
++            if ((png_get_color_type(png_p, info_p) != PNG_COLOR_TYPE_GRAY)
++                && (png_get_color_type(png_p, info_p) != PNG_COLOR_TYPE_RGB)
++                && (png_get_color_type(png_p, info_p) != PNG_COLOR_TYPE_PALETTE))
+                 tex_printf("colortype ");
+             if (fixed_pdf_minor_version <= 1)
+                 tex_printf("version=%d ", (int) fixed_pdf_minor_version);
+-            if (info_p->interlace_type != PNG_INTERLACE_NONE)
++            if (png_get_interlace_type(png_p, info_p) != PNG_INTERLACE_NONE)
+                 tex_printf("interlaced ");
+-            if (info_p->bit_depth > 8)
+-                tex_printf("bitdepth=%d ", info_p->bit_depth);
++            if (png_get_bit_depth(png_p, info_p) > 8)
++                tex_printf("bitdepth=%d ", png_get_bit_depth(png_p, info_p));
+             if (png_get_valid(png_p, info_p, PNG_INFO_tRNS))
+                 tex_printf("simple transparancy ");
+         }
+-        switch (info_p->color_type) {
++        switch (png_get_color_type(png_p, info_p)) {
+         case PNG_COLOR_TYPE_PALETTE:
+             write_png_palette(idict);
+             break;
+@@ -632,7 +666,7 @@
+             break;
+         default:
+             pdftex_fail("unsupported type of color_type <%i>",
+-                        info_p->color_type);
++                        png_get_color_type(png_p, info_p));
+         }
+     }
+     pdf_flush();
diff --git a/texlive-system-zzip.patch b/texlive-system-zzip.patch
new file mode 100644
index 0000000..6790a98
--- /dev/null
+++ b/texlive-system-zzip.patch
@@ -0,0 +1,38 @@
+--- texlive-20080816-source/texk/web2c/luatexdir/luatexlib.mk.orig	2016-07-23 18:50:09.881978420 +0200
++++ texlive-20080816-source/texk/web2c/luatexdir/luatexlib.mk	2016-07-23 18:50:13.578838019 +0200
+@@ -72,20 +72,12 @@
+ endif
+ 
+ 
+-ZZIPLIBDIR=../../libs/zziplib
+-ZZIPLIBSRCDIR=$(srcdir)/$(ZZIPLIBDIR)
+-ZZIPLIBDEP = $(ZZIPLIBDIR)/zzip/libzzip.a
+-
+-$(ZZIPLIBDEP): $(ZZIPLIBSRCDIR)
+-	mkdir -p $(ZZIPLIBDIR)/zzip && cd $(ZZIPLIBDIR)/zzip && \
+-	cp ../$(ZZIPLIBSRCDIR)/zzip/Makefile . && $(MAKE) $(common_makeargs)
+-
+ # luazip
+ 
+ LUAZIPDIR=../../libs/luazip
+ LUAZIPSRCDIR=$(srcdir)/$(LUAZIPDIR)
+ LUAZIPDEP=$(LUAZIPDIR)/src/luazip.o
+-LUAZIPINC=-I../../lua51 -I../$(ZZIPLIBSRCDIR) -I../$(ZZIPLIBDIR)
++LUAZIPINC=-I../../lua51
+ 
+ $(LUAZIPDEP): $(LUAZIPDIR)/src/luazip.c
+ 	mkdir -p $(LUAZIPDIR) && cd $(LUAZIPDIR) && cp -R $(LUAZIPSRCDIR)/* . && \
+@@ -142,11 +134,11 @@
+ # Convenience variables.
+ 
+ luatexlibs = $(luapdflib) $(LDLIBPNG) $(LDZLIB) $(LDLIBXPDF) $(LIBMD5DEP) $(LDLIBOBSD) \
+-             $(LIBLUADEP) $(SLNUNICODEDEP)  $(LUAZIPDEP) $(ZZIPLIBDEP) $(LUAFSDEP) \
++             $(LIBLUADEP) $(SLNUNICODEDEP)  $(LUAZIPDEP) -lzzip $(LUAFSDEP) \
+              $(LUAPEGDEP) $(LUAMDVDEP)  $(LUAZLIBDEP) $(LUAFFDEP)
+ 
+ luatexlibsdep = $(luapdflib) $(LIBPNGDEP) $(ZLIBDEP) $(LIBXPDFDEP) $(LIBMD5DEP) $(LIBOBSDDEP) \
+-                $(LIBLUADEP) $(SLNUNICODEDEP) $(ZZIPLIBDEP) $(LUAZIPDEP)  $(LUAFSDEP) \
++                $(LIBLUADEP) $(SLNUNICODEDEP) $(LUAZIPDEP)  $(LUAFSDEP) \
+                 $(LUAPEGDEP) $(LUAMDVDEP)  $(LUAZLIBDEP) $(LUAFFDEP) $(makecpool)
+ 
+ ## end of luatexlib.mk - Makefile fragment for libraries used by pdf[ex]tex.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/texlive.git/commitdiff/1f77ed9369f1ca3fc4c1f2a0944d504e7d131719




More information about the pld-cvs-commit mailing list