Gentoo Archives: gentoo-commits

From: "Andreas HAttel (dilfridge)" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in dev-tex/luatex/files: poppler026.patch
Date: Wed, 30 Apr 2014 23:47:03
Message-Id: 20140430234658.071C32004B@flycatcher.gentoo.org
1 dilfridge 14/04/30 23:46:57
2
3 Added: poppler026.patch
4 Log:
5 Add patch for building against poppler-0.26, bug 508890; without keywords for testing
6
7 (Portage version: 2.2.10/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!)
8
9 Revision Changes Path
10 1.1 dev-tex/luatex/files/poppler026.patch
11
12 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-tex/luatex/files/poppler026.patch?rev=1.1&view=markup
13 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-tex/luatex/files/poppler026.patch?rev=1.1&content-type=text/plain
14
15 Index: poppler026.patch
16 ===================================================================
17 Source: NetBSD CVS
18 http://mail-index.netbsd.org/pkgsrc-bugs/2014/04/29/msg053974.html
19 http://cvsweb.de.netbsd.org/cgi-bin/cvsweb.cgi/pkgsrc/print/luatex/patches/
20
21
22 diff -ruN luatex-beta-0.76.0.orig/source/texk/web2c/luatexdir/image/epdf.h luatex-beta-0.76.0/source/texk/web2c/luatexdir/image/epdf.h
23 --- luatex-beta-0.76.0.orig/source/texk/web2c/luatexdir/image/epdf.h 2013-04-05 12:58:37.000000000 +0200
24 +++ luatex-beta-0.76.0/source/texk/web2c/luatexdir/image/epdf.h 2014-05-01 01:39:39.838462783 +0200
25 @@ -37,6 +37,7 @@
26 # include <sys/stat.h>
27 # include <dirent.h>
28 # include <poppler-config.h>
29 +# include <StructTreeRoot.h>
30 # include <goo/GooString.h>
31 # include <goo/gmem.h>
32 # include <goo/gfile.h>
33 diff -ruN luatex-beta-0.76.0.orig/source/texk/web2c/luatexdir/lua/lepdflib.cc luatex-beta-0.76.0/source/texk/web2c/luatexdir/lua/lepdflib.cc
34 --- luatex-beta-0.76.0.orig/source/texk/web2c/luatexdir/lua/lepdflib.cc 2013-04-05 12:58:37.000000000 +0200
35 +++ luatex-beta-0.76.0/source/texk/web2c/luatexdir/lua/lepdflib.cc 2014-05-01 01:40:15.698461067 +0200
36 @@ -48,25 +48,26 @@
37
38 //**********************************************************************
39
40 -#define M_Annot "Annot"
41 -#define M_Annots "Annots"
42 -#define M_Array "Array"
43 -#define M_Catalog "Catalog"
44 -#define M_Dict "Dict"
45 -#define M_EmbFile "EmbFile"
46 -#define M_FileSpec "FileSpec"
47 -#define M_GooString "GooString"
48 -#define M_LinkDest "LinkDest"
49 -#define M_Link "Link"
50 -#define M_Links "Links"
51 -#define M_Object "Object"
52 -#define M_Page "Page"
53 -#define M_PDFDoc "PDFDoc"
54 -#define M_PDFRectangle "PDFRectangle"
55 -#define M_Ref "Ref"
56 -#define M_Stream "Stream"
57 -#define M_XRefEntry "XRefEntry"
58 -#define M_XRef "XRef"
59 +#define M_Annot "epdf.Annot" /* ls-hh: epdf.* gives better protection in registry */
60 +#define M_Annots "epdf.Annots"
61 +#define M_Array "epdf.Array"
62 +#define M_Catalog "epdf.Catalog"
63 +#define M_Dict "epdf.Dict"
64 +#define M_EmbFile "epdf.EmbFile"
65 +#define M_FileSpec "epdf.FileSpec"
66 +#define M_GooString "epdf.GooString"
67 +#define M_LinkDest "epdf.LinkDest"
68 +#define M_Link "epdf.Link"
69 +#define M_Links "epdf.Links"
70 +#define M_Object "epdf.Object"
71 +#define M_Page "epdf.Page"
72 +#define M_PDFDoc "epdf.PDFDoc"
73 +#define M_PDFRectangle "epdf.PDFRectangle"
74 +#define M_Ref "epdf.Ref"
75 +#define M_Stream "epdf.Stream"
76 +#define M_StructTreeRoot "epdf.StructTreeRoot"
77 +#define M_XRefEntry "epdf.XRefEntry"
78 +#define M_XRef "epdf.XRef"
79
80 //**********************************************************************
81
82 @@ -96,6 +97,7 @@
83 new_poppler_userdata(PDFRectangle);
84 new_poppler_userdata(Ref);
85 new_poppler_userdata(Stream);
86 +new_poppler_userdata(StructTreeRoot);
87 new_poppler_userdata(XRef);
88
89 //**********************************************************************
90 @@ -573,7 +575,11 @@
91
92 m_poppler_get_GOOSTRING(Catalog, getBaseURI);
93 m_poppler_get_GOOSTRING(Catalog, readMetadata);
94 +#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
95 m_poppler_get_poppler(Catalog, Object, getStructTreeRoot);
96 +#else
97 +m_poppler_get_poppler(Catalog, StructTreeRoot, getStructTreeRoot);
98 +#endif
99
100 static int m_Catalog_findPage(lua_State * L)
101 {
102 @@ -2146,14 +2152,22 @@
103
104 static int m_PDFDoc_getStructTreeRoot(lua_State * L)
105 {
106 +#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
107 Object *obj;
108 +#else
109 + StructTreeRoot *obj;
110 +#endif
111 udstruct *uin, *uout;
112 uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc);
113 if (uin->pd != NULL && uin->pd->pc != uin->pc)
114 pdfdoc_changed_error(L);
115 if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) {
116 obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot();
117 +#ifdef GETSTRUCTTREEROOT_RETURNS_OBJECT
118 uout = new_Object_userdata(L);
119 +#else
120 + uout = new_StructTreeRoot_userdata(L);
121 +#endif
122 uout->d = obj;
123 uout->pc = uin->pc;
124 uout->pd = uin->pd;
125 @@ -2617,6 +2631,15 @@
126
127 //**********************************************************************
128
129 +#ifdef LuajitTeX
130 +#define setfuncs_meta(type) \
131 + luaL_newmetatable(L, M_##type); \
132 + lua_pushvalue(L, -1); \
133 + lua_setfield(L, -2, "__index"); \
134 + lua_pushstring(L, "no user access"); \
135 + lua_setfield(L, -2, "__metatable"); \
136 + luaL_register(L, NULL, type##_m)
137 +#else
138 #define setfuncs_meta(type) \
139 luaL_newmetatable(L, M_##type); \
140 lua_pushvalue(L, -1); \
141 @@ -2624,6 +2647,7 @@
142 lua_pushstring(L, "no user access"); \
143 lua_setfield(L, -2, "__metatable"); \
144 luaL_setfuncs(L, type##_m, 0)
145 +#endif
146
147 int luaopen_epdf(lua_State * L)
148 {
149 @@ -2646,6 +2670,10 @@
150 setfuncs_meta(XRef);
151 setfuncs_meta(XRefEntry);
152
153 +#ifdef LuajitTeX
154 + luaL_register(L, "epdf", epdflib_f);
155 +#else
156 luaL_newlib(L, epdflib_f);
157 +#endif
158 return 1;
159 }