Sun May 13 12:46:27 2018 UTC ()
luatex: update to 1.07.0

texlive 2018 version


(markd)
diff -r1.70 -r1.71 pkgsrc/print/luatex/Makefile
diff -r1.29 -r1.30 pkgsrc/print/luatex/distinfo
diff -r1.4 -r1.5 pkgsrc/print/luatex/patches/patch-texk_web2c_luatexdir_image_pdftoepdf.w
diff -r1.4 -r1.5 pkgsrc/print/luatex/patches/patch-texk_web2c_luatexdir_lua_lepdflib.cc
diff -r1.1 -r0 pkgsrc/print/luatex/patches/patch-texk_web2c_luatexdir_lua_lpdfscannerlib.cc
diff -r1.1 -r0 pkgsrc/print/luatex/patches/patch-texk_web2c_luatexdir_luaffi_ctype.c
diff -r1.1 -r0 pkgsrc/print/luatex/patches/patch-texk_web2c_luatexdir_luaffi_ffi.h

cvs diff -r1.70 -r1.71 pkgsrc/print/luatex/Makefile (expand / switch to unified diff)

--- pkgsrc/print/luatex/Makefile 2018/04/28 20:19:11 1.70
+++ pkgsrc/print/luatex/Makefile 2018/05/13 12:46:27 1.71
@@ -1,40 +1,39 @@ @@ -1,40 +1,39 @@
1# $NetBSD: Makefile,v 1.70 2018/04/28 20:19:11 wiz Exp $ 1# $NetBSD: Makefile,v 1.71 2018/05/13 12:46:27 markd Exp $
2 2
3DISTNAME= texlive-20170524-source 3DISTNAME= texlive-20180414-source
4PKGNAME= luatex-1.0.4 4PKGNAME= luatex-1.07.0
5PKGREVISION= 11 
6CATEGORIES= print 5CATEGORIES= print
7MASTER_SITES= ftp://tug.org/historic/systems/texlive/2017/ 6MASTER_SITES= ftp://tug.org/historic/systems/texlive/2018/
8EXTRACT_SUFX= .tar.xz 7EXTRACT_SUFX= .tar.xz
9 8
10MAINTAINER= minskim@NetBSD.org 9MAINTAINER= minskim@NetBSD.org
11HOMEPAGE= http://www.luatex.org/ 10HOMEPAGE= http://www.luatex.org/
12COMMENT= Extended version of pdfTeX using Lua 11COMMENT= Extended version of pdfTeX using Lua
13LICENSE= gnu-gpl-v2 12LICENSE= gnu-gpl-v2
14 13
15EXTRACT_ELEMENTS= ${DISTNAME}/build-aux \ 14EXTRACT_ELEMENTS= ${DISTNAME}/build-aux \
16 ${DISTNAME}/libs/lua52 \ 15 ${DISTNAME}/libs/lua52 \
17 ${DISTNAME}/libs/luajit \ 16 ${DISTNAME}/libs/luajit \
18 ${DISTNAME}/texk/web2c 17 ${DISTNAME}/texk/web2c
19 18
20GNU_CONFIGURE= yes 19GNU_CONFIGURE= yes
21USE_LANGUAGES= c99 c++11 20USE_LANGUAGES= c99 c++11
22USE_LIBTOOL= yes 21USE_LIBTOOL= yes
23USE_TOOLS+= gmake gsed lex perl pkg-config yacc 22USE_TOOLS+= gmake gsed lex perl pkg-config yacc
24CONFIGURE_ARGS+= --disable-aleph --disable-etex --disable-pdftex \ 23CONFIGURE_ARGS+= --disable-aleph --disable-etex --disable-pdftex \
25 --enable-luatex --disable-mf --disable-mf-nowin \ 24 --enable-luatex --disable-mf --disable-mf-nowin \
26 --with-x=no \ 25 --with-x=no \
27 --disable-luajittex --disable-mfluajit \ 26 --disable-luatex53 --disable-luajittex --disable-mfluajit \
28 --disable-mp --disable-pmp --disable-upmp \ 27 --disable-mp --disable-pmp --disable-upmp \
29 --disable-ptex --disable-eptex --disable-uptex --disable-euptex \ 28 --disable-ptex --disable-eptex --disable-uptex --disable-euptex \
30 --disable-web-progs \ 29 --disable-web-progs \
31 --enable-web2c --disable-xetex 30 --enable-web2c --disable-xetex
32CONFIGURE_ARGS+= --with-system-poppler 31CONFIGURE_ARGS+= --with-system-poppler
33CONFIGURE_ARGS+= \ 32CONFIGURE_ARGS+= \
34 --with-fontconfig-includes=${BUILDLINK_PREFIX.fontconfig}/include \ 33 --with-fontconfig-includes=${BUILDLINK_PREFIX.fontconfig}/include \
35 --with-fontconfig-libdir=${BUILDLINK_PREFIX.fontconfig}/lib 34 --with-fontconfig-libdir=${BUILDLINK_PREFIX.fontconfig}/lib
36CONFIGURE_ARGS+= --with-system-kpathsea 35CONFIGURE_ARGS+= --with-system-kpathsea
37CONFIGURE_ARGS+= --with-system-zlib \ 36CONFIGURE_ARGS+= --with-system-zlib \
38 --with-zlib-includes=${BUILDLINK_PREFIX.zlib}/include \ 37 --with-zlib-includes=${BUILDLINK_PREFIX.zlib}/include \
39 --with-zlib-libdir=${BUILDLINK_PREFIX.zlib}/lib 38 --with-zlib-libdir=${BUILDLINK_PREFIX.zlib}/lib
40CONFIGURE_ARGS+= --with-system-cairo 39CONFIGURE_ARGS+= --with-system-cairo

cvs diff -r1.29 -r1.30 pkgsrc/print/luatex/distinfo (expand / switch to unified diff)

--- pkgsrc/print/luatex/distinfo 2018/04/29 20:57:26 1.29
+++ pkgsrc/print/luatex/distinfo 2018/05/13 12:46:27 1.30
@@ -1,14 +1,11 @@ @@ -1,14 +1,11 @@
1$NetBSD: distinfo,v 1.29 2018/04/29 20:57:26 ryoon Exp $ 1$NetBSD: distinfo,v 1.30 2018/05/13 12:46:27 markd Exp $
2 2
3SHA1 (texlive-20170524-source.tar.xz) = 1c1383ddb1b871c6b8ce49a4ae3c1a33d454a7b6 3SHA1 (texlive-20180414-source.tar.xz) = 81bdd9999b6ab860d1d3c388cf27062aba960255
4RMD160 (texlive-20170524-source.tar.xz) = a8430c19fe1727cf308fe03e5838105260c0d71e 4RMD160 (texlive-20180414-source.tar.xz) = 0ff63bbd7f8a0fb6417089f5d1ae1e4124a1dd95
5SHA512 (texlive-20170524-source.tar.xz) = 18c18940992ab94ce22e22ccd4ad798253ea14ac2ab296a10ea5e9a8da9f33989f2e2641b42b564d1d5fb53bd371da3e68726b676d706b469016ad146cd19daa 5SHA512 (texlive-20180414-source.tar.xz) = ecac9b8203d2747be7ba7f82d68096d859fb35713276106d7049035dd3a8cfca07f8a8648982f0317b3812f8480db7326714de32f95998e3e6f73571de2aa140
6Size (texlive-20170524-source.tar.xz) = 63483372 bytes 6Size (texlive-20180414-source.tar.xz) = 49770944 bytes
7SHA1 (patch-ac) = 1ee83833a03eace2eada892130ddb2198e829f3d 7SHA1 (patch-ac) = 1ee83833a03eace2eada892130ddb2198e829f3d
8SHA1 (patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c) = 34fa742ed696f97df637c5086bf1faf3d718cb69 8SHA1 (patch-libs_luajit_LuaJIT-src_src_host_buildvm__asm.c) = 34fa742ed696f97df637c5086bf1faf3d718cb69
9SHA1 (patch-libs_luajit_LuaJIT-src_src_vm__x86.dasc) = 491d33adbbaab8b2b81a65a8d7ba30aee775b75f 9SHA1 (patch-libs_luajit_LuaJIT-src_src_vm__x86.dasc) = 491d33adbbaab8b2b81a65a8d7ba30aee775b75f
10SHA1 (patch-texk_web2c_luatexdir_image_pdftoepdf.w) = ef0950aeeba70fdb286835dd5eab85555fd1131a 10SHA1 (patch-texk_web2c_luatexdir_image_pdftoepdf.w) = 9b6d637abe2fbb246a2435caf8aec5070abd1c5f
11SHA1 (patch-texk_web2c_luatexdir_lua_lepdflib.cc) = 0758888fd2bf23e339a858fdde84c0aa111a7350 11SHA1 (patch-texk_web2c_luatexdir_lua_lepdflib.cc) = 24052cbff1a087badbeefe8b58bf7ce97e4ab4fb
12SHA1 (patch-texk_web2c_luatexdir_lua_lpdfscannerlib.cc) = ddb11816de22cc7b3f286b3a7838dcf6debbf892 
13SHA1 (patch-texk_web2c_luatexdir_luaffi_ctype.c) = 57d51564d5dd0200be10154216158fe801d7c630 
14SHA1 (patch-texk_web2c_luatexdir_luaffi_ffi.h) = 2fbf91152fc3438d8e989d5f5f95877faaec6790 

cvs diff -r1.4 -r1.5 pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_image_pdftoepdf.w (expand / switch to unified diff)

--- pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_image_pdftoepdf.w 2018/04/29 20:57:26 1.4
+++ pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_image_pdftoepdf.w 2018/05/13 12:46:27 1.5
@@ -1,217 +1,27 @@ @@ -1,217 +1,27 @@
1$NetBSD: patch-texk_web2c_luatexdir_image_pdftoepdf.w,v 1.4 2018/04/29 20:57:26 ryoon Exp $ 1$NetBSD: patch-texk_web2c_luatexdir_image_pdftoepdf.w,v 1.5 2018/05/13 12:46:27 markd Exp $
2 2
3The ctangle tex-to-C generator strips whitespace, resulting in "C++11 requires 3Build with poppler 0.64
4a space between literal and identifier" failures. Pull in hacky patch from 
5Gentoo which avoids this problem by using newlines. 
6 4
7Add support for newer poppler's from ArchLinux 5--- texk/web2c/luatexdir/image/pdftoepdf.w.orig 2018-01-17 18:00:12.000000000 +0000
8 
9--- texk/web2c/luatexdir/image/pdftoepdf.w.orig 2016-11-25 18:09:14.000000000 +0000 
10+++ texk/web2c/luatexdir/image/pdftoepdf.w 6+++ texk/web2c/luatexdir/image/pdftoepdf.w
11@@ -71,7 +71,11 @@ static char *get_file_checksum(const cha 7@@ -361,9 +361,9 @@ void copyReal(PDF pdf, double d)
12 ck = (char *) malloc(PDF_CHECKSUM_SIZE); 8 pdf->cave = true;
13 if (ck == NULL) 
14 formatted_error("pdf inclusion","out of memory while processing '%s'", a); 
15- snprintf(ck, PDF_CHECKSUM_SIZE, "%" PRIu64 "_%" PRIu64, (uint64_t) size,(uint64_t) mtime); 
16+ snprintf(ck, PDF_CHECKSUM_SIZE, "%" 
17+PRIu64 
18+"_%" 
19+PRIu64 
20+, (uint64_t) size,(uint64_t) mtime); 
21 } else { 
22 switch (fe) { 
23 case FE_FAIL: 
24@@ -224,7 +228,7 @@ PdfDocument *refMemStreamPdfDocument(cha 
25 free(checksum); 
26 } 
27 if (pdf_doc->doc == NULL) { 
28- docmemstream = new MemStream( docstream,0,streamsize, obj.initNull() ); 
29+ docmemstream = new MemStream( docstream,0,streamsize, Object(objNull) ); 
30 doc = new PDFDoc(docmemstream); /* takes ownership of docmemstream */ 
31 pdf_doc->pc++; 
32 if (!doc->isOk() || !doc->okToPrint()) { 
33@@ -408,9 +412,8 @@ static void copyArray(PDF pdf, PdfDocume 
34 Object obj1; 
35 pdf_begin_array(pdf); 
36 for (i = 0, l = array->getLength(); i < l; ++i) { 
37- array->getNF(i, &obj1); 
38+ obj1 = array->getNF(i); 
39 copyObject(pdf, pdf_doc, &obj1); 
40- obj1.free(); 
41 } 
42 pdf_end_array(pdf); 
43 } 9 }
44@@ -422,9 +425,8 @@ static void copyDict(PDF pdf, PdfDocumen 10
45 pdf_begin_dict(pdf); 11-static void copyString(PDF pdf, GooString * string)
46 for (i = 0, l = dict->getLength(); i < l; ++i) { 12+static void copyString(PDF pdf, const GooString * string)
47 copyName(pdf, dict->getKey(i)); 13 {
48- dict->getValNF(i, &obj1); 14- char *p;
49+ obj1 = dict->getValNF(i); 15+ const char *p;
50 copyObject(pdf, pdf_doc, &obj1); 16 unsigned char c;
51- obj1.free(); 17 size_t i, l;
52 } 18 p = string->getCString();
53 pdf_end_dict(pdf); 19@@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooStrin
 20 pdf->cave = true;
54 } 21 }
55@@ -470,10 +472,10 @@ static void copyObject(PDF pdf, PdfDocum 
56 break; 
57 */ 
58 case objString: 
59- copyString(pdf, obj->getString()); 
60+ copyString(pdf, const_cast<GooString*>(obj->getString())); 
61 break; 
62 case objName: 
63- copyName(pdf, obj->getName()); 
64+ copyName(pdf, const_cast<char*>(obj->getName())); 
65 break; 
66 case objNull: 
67 pdf_add_null(pdf); 
68@@ -510,13 +512,12 @@ static void writeRefs(PDF pdf, PdfDocume 
69 PDFDoc *doc = pdf_doc->doc; 
70 xref = doc->getXRef(); 
71 for (r = pdf_doc->inObjList; r != NULL;) { 
72- xref->fetch(r->ref.num, r->ref.gen, &obj1); 
73+ obj1 = xref->fetch(r->ref.num, r->ref.gen); 
74 if (obj1.isStream()) 
75 pdf_begin_obj(pdf, r->num, OBJSTM_NEVER); 
76 else 
77 pdf_begin_obj(pdf, r->num, 2); 
78 copyObject(pdf, pdf_doc, &obj1); 
79- obj1.free(); 
80 pdf_end_obj(pdf); 
81 n = r->next; 
82 delete r; 
83@@ -740,7 +741,7 @@ void write_epdf(PDF pdf, image_dict * id 
84 catalog = doc->getCatalog(); 
85 page = catalog->getPage(img_pagenum(idict)); 
86 pageref = catalog->getPageRef(img_pagenum(idict)); 
87- doc->getXRef()->fetch(pageref->num, pageref->gen, &pageobj); 
88+ pageobj = doc->getXRef()->fetch(pageref->num, pageref->gen); 
89 pageDict = pageobj.getDict(); 
90 /* write the Page header */ 
91 pdf_begin_obj(pdf, img_objnum(idict), OBJSTM_NEVER); 
92@@ -757,12 +758,11 @@ void write_epdf(PDF pdf, image_dict * id 
93 pdf_dict_add_int(pdf, "PTEX.PageNumber", (int) img_pagenum(idict)); 
94 } 
95 if ((suppress_optional_info & 8) == 0) { 
96- doc->getDocInfoNF(&obj1); 
97+ obj1 = doc->getDocInfoNF(); 
98 if (obj1.isRef()) { 
99 /* the info dict must be indirect (PDF Ref p. 61) */ 
100 pdf_dict_add_ref(pdf, "PTEX.InfoDict", addInObj(pdf, pdf_doc, obj1.getRef())); 
101 } 
102- obj1.free(); 
103 } 
104 if (img_is_bbox(idict)) { 
105 bbox[0] = sp2bp(img_bbox(idict)[0]); 
106@@ -788,19 +788,17 @@ void write_epdf(PDF pdf, image_dict * id 
107 Now all relevant parts of the Page dictionary are copied. Metadata validity 
108 check is needed(as a stream it must be indirect). 
109 */ 
110- pageDict->lookupNF("Metadata", &obj1); 
111+ obj1 = pageDict->lookupNF("Metadata"); 
112 if (!obj1.isNull() && !obj1.isRef()) 
113 formatted_warning("pdf inclusion","/Metadata must be indirect object"); 
114- obj1.free(); 
115 /* copy selected items in Page dictionary */ 
116 for (i = 0; pagedictkeys[i] != NULL; i++) { 
117- pageDict->lookupNF(pagedictkeys[i], &obj1); 
118+ obj1 = pageDict->lookupNF(pagedictkeys[i]); 
119 if (!obj1.isNull()) { 
120 pdf_add_name(pdf, pagedictkeys[i]); 
121 /* preserves indirection */ 
122 copyObject(pdf, pdf_doc, &obj1); 
123 } 
124- obj1.free(); 
125 } 
126 /* 
127 If there are no Resources in the Page dict of the embedded page, 
128@@ -808,32 +806,28 @@ void write_epdf(PDF pdf, image_dict * id 
129 PDF file, climbing up the tree until the Resources are found. 
130 (This fixes a problem with Scribus 1.3.3.14.) 
131 */ 
132- pageDict->lookupNF("Resources", &obj1); 
133+ obj1 = pageDict->lookupNF("Resources"); 
134 if (obj1.isNull()) { 
135 op1 = &pagesobj1; 
136 op2 = &pagesobj2; 
137- pageDict->lookup("Parent", op1); 
138+ *op1 = pageDict->lookup("Parent"); 
139 while (op1->isDict()) { 
140- obj1.free(); 
141- op1->dictLookupNF("Resources", &obj1); 
142+ obj1 = op1->dictLookupNF("Resources"); 
143 if (!obj1.isNull()) { 
144 pdf_add_name(pdf, "Resources"); 
145 copyObject(pdf, pdf_doc, &obj1); 
146 break; 
147 } 
148- op1->dictLookup("Parent", op2); 
149+ *op2 = op1->dictLookup("Parent"); 
150 optmp = op1; 
151 op1 = op2; 
152 op2 = optmp; 
153- op2->free(); 
154 }; 
155 if (!op1->isDict()) 
156 formatted_warning("pdf inclusion","Page /Resources missing"); 
157- op1->free(); 
158 } 
159- obj1.free(); 
160 /* Write the Page contents. */ 
161- page->getContents(&contents); 
162+ contents = page->getContents(); 
163 if (contents.isStream()) { 
164 /* 
165 Variant A: get stream and recompress under control of \pdfcompresslevel 
166@@ -844,27 +838,23 @@ void write_epdf(PDF pdf, image_dict * id 
167  22
168 Variant B: copy stream without recompressing 23-static void copyName(PDF pdf, char *s)
169 */ 24+static void copyName(PDF pdf, const char *s)
170- contents.streamGetDict()->lookup("F", &obj1); 25 {
171+ obj1 = contents.streamGetDict()->lookup("F"); 26 pdf_out(pdf, '/');
172 if (!obj1.isNull()) { 27 for (; *s != 0; s++) {
173 normal_error("pdf inclusion","unsupported external stream"); 
174 } 
175- obj1.free(); 
176- contents.streamGetDict()->lookup("Length", &obj1); 
177+ obj1 = contents.streamGetDict()->lookup("Length"); 
178 pdf_add_name(pdf, "Length"); 
179 copyObject(pdf, pdf_doc, &obj1); 
180- obj1.free(); 
181- contents.streamGetDict()->lookup("Filter", &obj1); 
182+ obj1 = contents.streamGetDict()->lookup("Filter"); 
183 if (!obj1.isNull()) { 
184 pdf_add_name(pdf, "Filter"); 
185 copyObject(pdf, pdf_doc, &obj1); 
186- obj1.free(); 
187- contents.streamGetDict()->lookup("DecodeParms", &obj1); 
188+ obj1 = contents.streamGetDict()->lookup("DecodeParms"); 
189 if (!obj1.isNull()) { 
190 pdf_add_name(pdf, "DecodeParms"); 
191 copyObject(pdf, pdf_doc, &obj1); 
192 } 
193 } 
194- obj1.free(); 
195 pdf_end_dict(pdf); 
196 pdf_begin_stream(pdf); 
197 copyStreamStream(pdf, contents.getStream()->getUndecodedStream()); 
198@@ -875,8 +865,8 @@ void write_epdf(PDF pdf, image_dict * id 
199 pdf_end_dict(pdf); 
200 pdf_begin_stream(pdf); 
201 for (i = 0, l = contents.arrayGetLength(); i < l; ++i) { 
202- copyStreamStream(pdf, (contents.arrayGet(i, &obj1))->getStream()); 
203- obj1.free(); 
204+ obj1 = contents.arrayGet(i); 
205+ copyStreamStream(pdf, obj1.getStream()); 
206 if (i < (l - 1)) { 
207 /* 
208 Put a space between streams to be on the safe side (streams 
209@@ -897,8 +887,6 @@ void write_epdf(PDF pdf, image_dict * id 
210 } 
211 /* write out all indirect objects */ 
212 writeRefs(pdf, pdf_doc); 
213- contents.free(); 
214- pageobj.free(); 
215 /* 
216 unrefPdfDocument() must come after contents.free() and pageobj.free()! 
217 TH: The next line makes repeated pdf inclusion unacceptably slow 

cvs diff -r1.4 -r1.5 pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_lua_lepdflib.cc (expand / switch to unified diff)

--- pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_lua_lepdflib.cc 2018/04/29 20:57:26 1.4
+++ pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_lua_lepdflib.cc 2018/05/13 12:46:27 1.5
@@ -1,457 +1,24 @@ @@ -1,457 +1,24 @@
1$NetBSD: patch-texk_web2c_luatexdir_lua_lepdflib.cc,v 1.4 2018/04/29 20:57:26 ryoon Exp $ 1$NetBSD: patch-texk_web2c_luatexdir_lua_lepdflib.cc,v 1.5 2018/05/13 12:46:27 markd Exp $
2 2
3Add support for newer poppler's from ArchLinux 3Build with poppler 0.64
4 4
5--- texk/web2c/luatexdir/lua/lepdflib.cc.orig 2017-03-11 01:04:06.000000000 +0000 5--- texk/web2c/luatexdir/lua/lepdflib.cc.orig 2018-02-14 14:44:38.000000000 +0000
6+++ texk/web2c/luatexdir/lua/lepdflib.cc 6+++ texk/web2c/luatexdir/lua/lepdflib.cc
7@@ -521,7 +521,7 @@ static int m_##in##_##function(lua_State 7@@ -669,7 +669,7 @@ static int m_##in##_##function(lua_State
 8 #define m_poppler_get_GOOSTRING(in, function) \
 9 static int m_##in##_##function(lua_State * L) \
 10 { \
 11- GooString *gs; \
 12+ const GooString *gs; \
 13 udstruct *uin; \
8 uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \ 14 uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \
9 if (uin->pd != NULL && uin->pd->pc != uin->pc) \ 15 if (uin->pd != NULL && uin->pd->pc != uin->pc) \
10 pdfdoc_changed_error(L); \ 16@@ -1807,7 +1807,7 @@ static int m_Object_getNum(lua_State * L
11- gs = ((in *) uin->d)->function(); \ 
12+ gs = const_cast<GooString*>(((in *) uin->d)->function()); \ 
13 if (gs != NULL) \ 
14 lua_pushlstring(L, gs->getCString(), gs->getLength()); \ 
15 else \ 
16@@ -538,7 +538,7 @@ static int m_##in##_##function(lua_State 
17 pdfdoc_changed_error(L); \ 
18 uout = new_Object_userdata(L); \ 
19 uout->d = new Object(); \ 
20- ((in *) uin->d)->function((Object *) uout->d); \ 
21+ *((Object *)uout->d) = ((in *) uin->d)->function(); \ 
22 uout->atype = ALLOC_LEPDF; \ 
23 uout->pc = uin->pc; \ 
24 uout->pd = uin->pd; \ 
25@@ -668,13 +668,11 @@ static const struct luaL_Reg Annots_m[]  
26  17
27 static int m_Array_incRef(lua_State * L) 18 static int m_Object_getString(lua_State * L)
28 { 19 {
29- int i; 20- GooString *gs;
 21+ const GooString *gs;
30 udstruct *uin; 22 udstruct *uin;
31 uin = (udstruct *) luaL_checkudata(L, 1, M_Array); 
32 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
33 pdfdoc_changed_error(L); 
34- i = ((Array *) uin->d)->incRef(); 
35- lua_pushinteger(L, i); 
36+ lua_pushinteger(L, 1); 
37 return 1; 
38 } 
39  
40@@ -685,8 +683,7 @@ static int m_Array_decRef(lua_State * L) 
41 uin = (udstruct *) luaL_checkudata(L, 1, M_Array); 
42 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
43 pdfdoc_changed_error(L); 
44- i = ((Array *) uin->d)->decRef(); 
45- lua_pushinteger(L, i); 
46+ lua_pushinteger(L, 1); 
47 return 1; 
48 } 
49  
50@@ -702,7 +699,7 @@ static int m_Array_add(lua_State * L) 
51 if ((uin->pd != NULL && uin->pd->pc != uin->pc) 
52 || (uobj->pd != NULL && uobj->pd->pc != uobj->pc)) 
53 pdfdoc_changed_error(L); 
54- ((Array *) uin->d)->add(((Object *) uobj->d)); 
55+ ((Array *) uin->d)->add(std::move(*((Object *) uobj->d))); 
56 return 0; 
57 } 
58  
59@@ -718,7 +715,7 @@ static int m_Array_get(lua_State * L) 
60 if (i > 0 && i <= len) { 
61 uout = new_Object_userdata(L); 
62 uout->d = new Object(); 
63- ((Array *) uin->d)->get(i - 1, (Object *) uout->d); 
64+ *((Object *) uout->d) = ((Array *) uin->d)->get(i - 1); 
65 uout->atype = ALLOC_LEPDF; 
66 uout->pc = uin->pc; 
67 uout->pd = uin->pd; 
68@@ -739,7 +736,7 @@ static int m_Array_getNF(lua_State * L) 
69 if (i > 0 && i <= len) { 
70 uout = new_Object_userdata(L); 
71 uout->d = new Object(); 
72- ((Array *) uin->d)->getNF(i - 1, (Object *) uout->d); 
73+ *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1); 
74 uout->atype = ALLOC_LEPDF; 
75 uout->pc = uin->pc; 
76 uout->pd = uin->pd; 
77@@ -953,25 +950,21 @@ static const struct luaL_Reg Catalog_m[] 
78  
79 static int m_Dict_incRef(lua_State * L) 
80 { 
81- int i; 
82 udstruct *uin; 
83 uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); 
84 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
85 pdfdoc_changed_error(L); 
86- i = ((Dict *) uin->d)->incRef(); 
87- lua_pushinteger(L, i); 
88+ lua_pushinteger(L, 1); 
89 return 1; 
90 } 
91  
92 static int m_Dict_decRef(lua_State * L) 
93 { 
94- int i; 
95 udstruct *uin; 
96 uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); 
97 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
98 pdfdoc_changed_error(L); 
99- i = ((Dict *) uin->d)->decRef(); 
100- lua_pushinteger(L, i); 
101+ lua_pushinteger(L, 1); 
102 return 1; 
103 } 
104  
105@@ -986,7 +979,7 @@ static int m_Dict_add(lua_State * L) 
106 pdfdoc_changed_error(L); 
107 s = copyString(luaL_checkstring(L, 2)); 
108 uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); 
109- ((Dict *) uin->d)->add(s, ((Object *) uobj->d)); 
110+ ((Dict *) uin->d)->add(s, std::move(*((Object *) uobj->d))); 
111 return 0; 
112 } 
113  
114@@ -999,7 +992,7 @@ static int m_Dict_set(lua_State * L) 
115 pdfdoc_changed_error(L); 
116 s = luaL_checkstring(L, 2); 
117 uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); 
118- ((Dict *) uin->d)->set(s, ((Object *) uobj->d)); 
119+ ((Dict *) uin->d)->set(s, std::move(*((Object *) uobj->d))); 
120 return 0; 
121 } 
122  
123@@ -1027,7 +1020,7 @@ static int m_Dict_lookup(lua_State * L) 
124 s = luaL_checkstring(L, 2); 
125 uout = new_Object_userdata(L); 
126 uout->d = new Object(); 
127- ((Dict *) uin->d)->lookup(s, (Object *) uout->d); 
128+ *((Object *) uout->d) = ((Dict *) uin->d)->lookup(s); 
129 uout->atype = ALLOC_LEPDF; 
130 uout->pc = uin->pc; 
131 uout->pd = uin->pd; 
132@@ -1044,7 +1037,7 @@ static int m_Dict_lookupNF(lua_State * L 
133 s = luaL_checkstring(L, 2); 
134 uout = new_Object_userdata(L); 
135 uout->d = new Object(); 
136- ((Dict *) uin->d)->lookupNF(s, (Object *) uout->d); 
137+ *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s); 
138 uout->atype = ALLOC_LEPDF; 
139 uout->pc = uin->pc; 
140 uout->pd = uin->pd; 
141@@ -1096,7 +1089,7 @@ static int m_Dict_getVal(lua_State * L) 
142 if (i > 0 && i <= len) { 
143 uout = new_Object_userdata(L); 
144 uout->d = new Object(); 
145- ((Dict *) uin->d)->getVal(i - 1, (Object *) uout->d); 
146+ *((Object *) uout->d) = ((Dict *) uin->d)->getVal(i - 1); 
147 uout->atype = ALLOC_LEPDF; 
148 uout->pc = uin->pc; 
149 uout->pd = uin->pd; 
150@@ -1117,7 +1110,7 @@ static int m_Dict_getValNF(lua_State * L 
151 if (i > 0 && i <= len) { 
152 uout = new_Object_userdata(L); 
153 uout->d = new Object(); 
154- ((Dict *) uin->d)->getValNF(i - 1, (Object *) uout->d); 
155+ *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1); 
156 uout->atype = ALLOC_LEPDF; 
157 uout->pc = uin->pc; 
158 uout->pd = uin->pd; 
159@@ -1381,9 +1374,9 @@ static int m_Object_initBool(lua_State * 
160 pdfdoc_changed_error(L); 
161 luaL_checktype(L, 2, LUA_TBOOLEAN); 
162 if (lua_toboolean(L, 2) != 0) 
163- ((Object *) uin->d)->initBool(gTrue); 
164+ *((Object *) uin->d) = Object(gTrue); 
165 else 
166- ((Object *) uin->d)->initBool(gFalse); 
167+ *((Object *) uin->d) = Object(gFalse); 
168 return 0; 
169 } 
170  
171@@ -1395,7 +1388,7 @@ static int m_Object_initInt(lua_State *  
172 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
173 pdfdoc_changed_error(L); 
174 i = luaL_checkint(L, 2); 
175- ((Object *) uin->d)->initInt(i); 
176+ *((Object *) uin->d) = Object(i); 
177 return 0; 
178 } 
179  
180@@ -1407,7 +1400,7 @@ static int m_Object_initReal(lua_State * 
181 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
182 pdfdoc_changed_error(L); 
183 d = luaL_checknumber(L, 2); 
184- ((Object *) uin->d)->initReal(d); 
185+ *((Object *) uin->d) = Object(d); 
186 return 0; 
187 } 
188  
189@@ -1422,7 +1415,7 @@ static int m_Object_initString(lua_State 
190 pdfdoc_changed_error(L); 
191 s = luaL_checklstring(L, 2, &len); 
192 gs = new GooString(s, len); 
193- ((Object *) uin->d)->initString(gs); 
194+ *((Object *) uin->d) = Object(gs); 
195 return 0; 
196 } 
197  
198@@ -1434,7 +1427,7 @@ static int m_Object_initName(lua_State * 
199 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
200 pdfdoc_changed_error(L); 
201 s = luaL_checkstring(L, 2); 
202- ((Object *) uin->d)->initName(s); 
203+ *((Object *) uin->d) = Object(objName, s); 
204 return 0; 
205 } 
206  
207@@ -1444,13 +1437,14 @@ static int m_Object_initNull(lua_State * 
208 uin = (udstruct *) luaL_checkudata(L, 1, M_Object); 23 uin = (udstruct *) luaL_checkudata(L, 1, M_Object);
209 if (uin->pd != NULL && uin->pd->pc != uin->pc) 24 if (uin->pd != NULL && uin->pd->pc != uin->pc)
210 pdfdoc_changed_error(L); 
211- ((Object *) uin->d)->initNull(); 
212+ *((Object *) uin->d) = Object(objNull); 
213 return 0; 
214 } 
215  
216 static int m_Object_initArray(lua_State * L) 
217 { 
218 udstruct *uin, *uxref; 
219+ Array *a; 
220 uin = (udstruct *) luaL_checkudata(L, 1, M_Object); 
221 uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); 
222 if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) 
223@@ -1458,7 +1452,8 @@ static int m_Object_initArray(lua_State  
224 if ((uin->pd != NULL && uin->pd->pc != uin->pc) 
225 || (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) 
226 pdfdoc_changed_error(L); 
227- ((Object *) uin->d)->initArray((XRef *) uxref->d); 
228+ a = new Array((XRef *) uxref->d); 
229+ *((Object *) uin->d) = Object(a); 
230 return 0; 
231 } 
232  
233@@ -1469,6 +1464,7 @@ static int m_Object_initArray(lua_State  
234 static int m_Object_initDict(lua_State * L) 
235 { 
236 udstruct *uin, *uxref; 
237+ Dict *d; 
238 uin = (udstruct *) luaL_checkudata(L, 1, M_Object); 
239 uxref = (udstruct *) luaL_checkudata(L, 2, M_XRef); 
240 if (uin->pd != NULL && uxref->pd != NULL && uin->pd != uxref->pd) 
241@@ -1476,7 +1472,8 @@ static int m_Object_initDict(lua_State * 
242 if ((uin->pd != NULL && uin->pd->pc != uin->pc) 
243 || (uxref->pd != NULL && uxref->pd->pc != uxref->pc)) 
244 pdfdoc_changed_error(L); 
245- ((Object *) uin->d)->initDict((XRef *) uxref->d); 
246+ d = new Dict((XRef *) uxref->d); 
247+ *((Object *) uin->d) = Object(d); 
248 return 0; 
249 } 
250  
251@@ -1490,7 +1487,7 @@ static int m_Object_initStream(lua_State 
252 if ((uin->pd != NULL && uin->pd->pc != uin->pc) 
253 || (ustream->pd != NULL && ustream->pd->pc != ustream->pc)) 
254 pdfdoc_changed_error(L); 
255- ((Object *) uin->d)->initStream((Stream *) ustream->d); 
256+ *((Object *) uin->d) = Object((Stream *) ustream->d); 
257 return 0; 
258 } 
259  
260@@ -1503,7 +1500,7 @@ static int m_Object_initRef(lua_State *  
261 pdfdoc_changed_error(L); 
262 num = luaL_checkint(L, 2); 
263 gen = luaL_checkint(L, 3); 
264- ((Object *) uin->d)->initRef(num, gen); 
265+ *((Object *) uin->d) = Object(num, gen); 
266 return 0; 
267 } 
268  
269@@ -1515,7 +1512,7 @@ static int m_Object_initCmd(lua_State *  
270 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
271 pdfdoc_changed_error(L); 
272 s = luaL_checkstring(L, 2); 
273- ((Object *) uin->d)->initCmd(CHARP_CAST s); 
274+ *((Object *) uin->d) = Object(objCmd, CHARP_CAST s); 
275 return 0; 
276 } 
277  
278@@ -1525,7 +1522,7 @@ static int m_Object_initError(lua_State  
279 uin = (udstruct *) luaL_checkudata(L, 1, M_Object); 
280 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
281 pdfdoc_changed_error(L); 
282- ((Object *) uin->d)->initError(); 
283+ *((Object *) uin->d) = Object(objError); 
284 return 0; 
285 } 
286  
287@@ -1535,7 +1532,7 @@ static int m_Object_initEOF(lua_State *  
288 uin = (udstruct *) luaL_checkudata(L, 1, M_Object); 
289 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
290 pdfdoc_changed_error(L); 
291- ((Object *) uin->d)->initEOF(); 
292+ *((Object *) uin->d) = Object(objEOF); 
293 return 0; 
294 } 
295  
296@@ -1551,7 +1548,7 @@ static int m_Object_fetch(lua_State * L) 
297 pdfdoc_changed_error(L); 
298 uout = new_Object_userdata(L); 
299 uout->d = new Object(); 
300- ((Object *) uin->d)->fetch((XRef *) uxref->d, (Object *) uout->d); 
301+ *((Object *) uout->d) = ((Object *) uin->d)->fetch((XRef *) uxref->d); 
302 uout->atype = ALLOC_LEPDF; 
303 uout->pc = uin->pc; 
304 uout->pd = uin->pd; 
305@@ -1659,7 +1656,7 @@ static int m_Object_getString(lua_State  
306 if (uin->pd != NULL && uin->pd->pc != uin->pc) 
307 pdfdoc_changed_error(L); 
308 if (((Object *) uin->d)->isString()) { 
309- gs = ((Object *) uin->d)->getString(); 
310+ gs = const_cast<GooString*>(((Object *) uin->d)->getString()); 
311 lua_pushlstring(L, gs->getCString(), gs->getLength()); 
312 } else 
313 lua_pushnil(L); 
314@@ -1816,7 +1813,7 @@ static int m_Object_arrayAdd(lua_State * 
315 pdfdoc_changed_error(L); 
316 if (!((Object *) uin->d)->isArray()) 
317 luaL_error(L, "Object is not an Array"); 
318- ((Object *) uin->d)->arrayAdd((Object *) uobj->d); 
319+ ((Object *) uin->d)->arrayAdd(std::move(*((Object *) uobj->d))); 
320 return 0; 
321 } 
322  
323@@ -1833,7 +1830,7 @@ static int m_Object_arrayGet(lua_State * 
324 if (i > 0 && i <= len) { 
325 uout = new_Object_userdata(L); 
326 uout->d = new Object(); 
327- ((Object *) uin->d)->arrayGet(i - 1, (Object *) uout->d); 
328+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGet(i - 1); 
329 uout->atype = ALLOC_LEPDF; 
330 uout->pc = uin->pc; 
331 uout->pd = uin->pd; 
332@@ -1857,7 +1854,7 @@ static int m_Object_arrayGetNF(lua_State 
333 if (i > 0 && i <= len) { 
334 uout = new_Object_userdata(L); 
335 uout->d = new Object(); 
336- ((Object *) uin->d)->arrayGetNF(i - 1, (Object *) uout->d); 
337+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1); 
338 uout->atype = ALLOC_LEPDF; 
339 uout->pc = uin->pc; 
340 uout->pd = uin->pd; 
341@@ -1897,7 +1894,7 @@ static int m_Object_dictAdd(lua_State *  
342 pdfdoc_changed_error(L); 
343 if (!((Object *) uin->d)->isDict()) 
344 luaL_error(L, "Object is not a Dict"); 
345- ((Object *) uin->d)->dictAdd(copyString(s), (Object *) uobj->d); 
346+ ((Object *) uin->d)->dictAdd(copyString(s), std::move(*((Object *) uobj->d))); 
347 return 0; 
348 } 
349  
350@@ -1915,7 +1912,7 @@ static int m_Object_dictSet(lua_State *  
351 pdfdoc_changed_error(L); 
352 if (!((Object *) uin->d)->isDict()) 
353 luaL_error(L, "Object is not a Dict"); 
354- ((Object *) uin->d)->dictSet(s, (Object *) uobj->d); 
355+ ((Object *) uin->d)->dictSet(s, std::move(*((Object *) uobj->d))); 
356 return 0; 
357 } 
358  
359@@ -1930,7 +1927,7 @@ static int m_Object_dictLookup(lua_State 
360 if (((Object *) uin->d)->isDict()) { 
361 uout = new_Object_userdata(L); 
362 uout->d = new Object(); 
363- ((Object *) uin->d)->dictLookup(s, (Object *) uout->d); 
364+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookup(s); 
365 uout->atype = ALLOC_LEPDF; 
366 uout->pc = uin->pc; 
367 uout->pd = uin->pd; 
368@@ -1950,7 +1947,7 @@ static int m_Object_dictLookupNF(lua_Sta 
369 if (((Object *) uin->d)->isDict()) { 
370 uout = new_Object_userdata(L); 
371 uout->d = new Object(); 
372- ((Object *) uin->d)->dictLookupNF(s, (Object *) uout->d); 
373+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s); 
374 uout->atype = ALLOC_LEPDF; 
375 uout->pc = uin->pc; 
376 uout->pd = uin->pd; 
377@@ -1991,7 +1988,7 @@ static int m_Object_dictGetVal(lua_State 
378 if (i > 0 && i <= len) { 
379 uout = new_Object_userdata(L); 
380 uout->d = new Object(); 
381- ((Object *) uin->d)->dictGetVal(i - 1, (Object *) uout->d); 
382+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetVal(i - 1); 
383 uout->atype = ALLOC_LEPDF; 
384 uout->pc = uin->pc; 
385 uout->pd = uin->pd; 
386@@ -2015,7 +2012,7 @@ static int m_Object_dictGetValNF(lua_Sta 
387 if (i > 0 && i <= len) { 
388 uout = new_Object_userdata(L); 
389 uout->d = new Object(); 
390- ((Object *) uin->d)->dictGetValNF(i - 1, (Object *) uout->d); 
391+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1); 
392 uout->atype = ALLOC_LEPDF; 
393 uout->pc = uin->pc; 
394 uout->pd = uin->pd; 
395@@ -2243,7 +2240,7 @@ m_poppler_get_poppler(Page, Stream, getM 
396 m_poppler_get_poppler(Page, Dict, getPieceInfo); 
397 m_poppler_get_poppler(Page, Dict, getSeparationInfo); 
398 m_poppler_get_poppler(Page, Dict, getResourceDict); 
399-m_poppler_get_OBJECT(Page, getAnnots); 
400+m_poppler_get_OBJECT(Page, getAnnotsObject); 
401  
402 m_poppler_get_OBJECT(Page, getContents); 
403  
404@@ -2270,7 +2267,7 @@ static const struct luaL_Reg Page_m[] =  
405 {"getPieceInfo", m_Page_getPieceInfo}, 
406 {"getSeparationInfo", m_Page_getSeparationInfo}, 
407 {"getResourceDict", m_Page_getResourceDict}, 
408- {"getAnnots", m_Page_getAnnots}, 
409+ {"getAnnots", m_Page_getAnnotsObject}, 
410 {"getContents", m_Page_getContents}, 
411 {"__tostring", m_Page__tostring}, 
412 {NULL, NULL} // sentinel 
413@@ -2520,7 +2517,7 @@ static int m_PDFDoc_getDocInfo(lua_State 
414 if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { 
415 uout = new_Object_userdata(L); 
416 uout->d = new Object(); 
417- ((PdfDocument *) uin->d)->doc->getDocInfo((Object *) uout->d); 
418+ *((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfo(); 
419 uout->atype = ALLOC_LEPDF; 
420 uout->pc = uin->pc; 
421 uout->pd = uin->pd; 
422@@ -2538,7 +2535,7 @@ static int m_PDFDoc_getDocInfoNF(lua_Sta 
423 if (((PdfDocument *) uin->d)->doc->getXRef()->isOk()) { 
424 uout = new_Object_userdata(L); 
425 uout->d = new Object(); 
426- ((PdfDocument *) uin->d)->doc->getDocInfoNF((Object *) uout->d); 
427+ *((Object *) uout->d) = ((PdfDocument *) uin->d)->doc->getDocInfoNF(); 
428 uout->atype = ALLOC_LEPDF; 
429 uout->pc = uin->pc; 
430 uout->pd = uin->pd; 
431@@ -2841,7 +2838,7 @@ static int m_Attribute_getValue(lua_Stat 
432 uout = new_Object_userdata(L); 
433 uout->d = new Object(); 
434 origin = (Object *) (((Attribute *) uin->d)->getValue()); 
435- origin->copy ( ((Object *)uout->d) ); 
436+ *((Object *) uout->d) = origin->copy(); 
437 uout->atype = ALLOC_LEPDF; 
438 uout->pc = uin->pc; 
439 uout->pd = uin->pd; 
440@@ -3320,7 +3317,7 @@ static int m_StructTreeRoot_findParentEl 
441 parent = root->findParentElement(i-1); 
442 if (parent != NULL) { 
443 uout = new_StructElement_userdata(L); 
444- uout->d = new StructElement( *parent ); 
445+ uout->d = (StructElement *) parent; 
446 uout->atype = ALLOC_LEPDF; 
447 uout->pc = uin->pc; 
448 uout->pd = uin->pd; 
449@@ -3370,7 +3367,7 @@ static int m_XRef_fetch(lua_State * L) 
450 gen = luaL_checkint(L, 3); 
451 uout = new_Object_userdata(L); 
452 uout->d = new Object(); 
453- ((XRef *) uin->d)->fetch(num, gen, (Object *) uout->d); 
454+ *((Object *) uout->d) = ((XRef *) uin->d)->fetch(num, gen); 
455 uout->atype = ALLOC_LEPDF; 
456 uout->pc = uin->pc; 
457 uout->pd = uin->pd; 

File Deleted: pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_lua_lpdfscannerlib.cc

File Deleted: pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_luaffi_ctype.c

File Deleted: pkgsrc/print/luatex/patches/Attic/patch-texk_web2c_luatexdir_luaffi_ffi.h