From: Andreas Sturmlechner Date: Wed, 8 May 2019 22:45:17 +0000 (+0200) Subject: app-text/texlive-core: Fix build w/ poppler-0.75 and poppler-0.76 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=a790d0f672d6f7f2e2afc0ec6c0f69fe77b86644;p=gentoo.git app-text/texlive-core: Fix build w/ poppler-0.75 and poppler-0.76 Closes: https://bugs.gentoo.org/681338 Closes: https://bugs.gentoo.org/685284 Thanks-to: Arfrever Frehtes Taifersar Arahesis Package-Manager: Portage-2.3.66, Repoman-2.3.12 Signed-off-by: Andreas Sturmlechner --- diff --git a/app-text/texlive-core/Manifest b/app-text/texlive-core/Manifest index 47e26302447e..5e327cf3ac1d 100644 --- a/app-text/texlive-core/Manifest +++ b/app-text/texlive-core/Manifest @@ -1,5 +1,6 @@ DIST texlive-20170524-source-freetype.patch.xz 625056 BLAKE2B 70bcd15da1edfe5422f6dc0e736bc842f93787d45a81f823c8ddc5a420eff65f176ccce20cb17ac1dbc3b4eef3081de7dfbe34eb390f1baaa925e17f3d55c6c1 SHA512 daa0ff9306b39e6d5058c53572fdc741adad17cec9a874785005aacd0e57b75ce59f21d0d12260f4178d47b7b0e6509e49c44e2ab524613fe962ac1199a9120b DIST texlive-20170524-source.tar.xz 63483372 BLAKE2B 44669d1228f5be27e9d93672a4f4ead40f7f4c6cf386f2db6fef54d64f8b8a743a485fe1170904d8117b9745f71ec77db8434caa6cdd79359b1f3f387130a3b4 SHA512 18c18940992ab94ce22e22ccd4ad798253ea14ac2ab296a10ea5e9a8da9f33989f2e2641b42b564d1d5fb53bd371da3e68726b676d706b469016ad146cd19daa +DIST texlive-core-2017-poppler076.tar.xz 9232 BLAKE2B 945e4f8e6f3230b78dc43560c664fbe4989fb32759b41c0ef83d656b43b008030cebdbf668718c4f22831d01c3fe1466f686f7f6b76183d3d1bb5e760f17140d SHA512 63fb2b426921be5f6d310b31e7fea6fc0edc0900f4790445fcaface9c931ca6c3e8f98b81a3bccfd1c877750e854c9410a59ff9a124aa2826d7b4187d54ed8ab DIST texlive-core-patches-70.tar.xz 13068 BLAKE2B 011cf51af10d28ac9df7c9b9d7aea2cac3e562d393dcf09d57b3c2832fe6816cf926458417577f7c9d9414639a291c09240444145bdbb3d132170f51a8a16980 SHA512 fd26b92a03cd0446007728d0c16a8c7301e254515b997e6a0bd9b325db162bf3f2a2e96be0cb185f042038205c4b4dacf1785a216c8326328682f1c42da9079e DIST texlive-module-a2ping-2017.tar.xz 31136 BLAKE2B cc0d99992cb780711a2a423fa26135845fa1f2cbbac76485d64a0b3184e338e7a60cdcfeaca129e6251f72110b0069c32164f9c4904d7f7c9c2edc6306f50411 SHA512 4711f184222fd95498a6d3ee94db19209c7836e6b775303926766d97921f2e8324b0aa2252a958fb619dbeca50729d2be4851a2add5503e7e8f4e713fc993e41 DIST texlive-module-a2ping.doc-2017.tar.xz 17524 BLAKE2B dea1db9fb3650c56161190823e4015d3e6399be3612f7e54702264a5187e72c7be987abb2cf8465d82711c9894d604fa03d79dc770bbf93b3404f18a633fbfa0 SHA512 8cfcc3b2a5dc462895a2bbd82f3a21537ae5d3fe81217b0b664b2008d6d18259f18de10e6eb3e3ac2655f96067b0f9bc6e30f69d068d9335598eb0b075eb4cea diff --git a/app-text/texlive-core/files/texlive-core-2017-poppler064.patch b/app-text/texlive-core/files/texlive-core-2017-poppler064.patch deleted file mode 100644 index 9e4c7044975d..000000000000 --- a/app-text/texlive-core/files/texlive-core-2017-poppler064.patch +++ /dev/null @@ -1,118 +0,0 @@ -Source: https://github.com/TeX-Live/texlive-source/commit/ea9e7b25c6566505fe6d994aa5263bd736593be1 -Backport: dilfridge@gentoo.org - -diff -ruN texlive-20170524-source.orig/texk/web2c/luatexdir/image/pdftoepdf.w texlive-20170524-source/texk/web2c/luatexdir/image/pdftoepdf.w ---- texlive-20170524-source.orig/texk/web2c/luatexdir/image/pdftoepdf.w 2018-05-20 22:11:35.787633516 +0200 -+++ texlive-20170524-source/texk/web2c/luatexdir/image/pdftoepdf.w 2018-05-20 22:12:26.607265149 +0200 -@@ -472,10 +472,10 @@ - break; - */ - case objString: -- copyString(pdf, obj->getString()); -+ copyString(pdf, (GooString *)obj->getString()); - break; - case objName: -- copyName(pdf, obj->getName()); -+ copyName(pdf, (char *)obj->getName()); - break; - case objNull: - pdf_add_null(pdf); -diff -ruN texlive-20170524-source.orig/texk/web2c/luatexdir/lua/lepdflib.cc texlive-20170524-source/texk/web2c/luatexdir/lua/lepdflib.cc ---- texlive-20170524-source.orig/texk/web2c/luatexdir/lua/lepdflib.cc 2018-05-20 22:11:35.788633528 +0200 -+++ texlive-20170524-source/texk/web2c/luatexdir/lua/lepdflib.cc 2018-05-20 22:12:26.608265161 +0200 -@@ -521,7 +521,7 @@ - uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \ - if (uin->pd != NULL && uin->pd->pc != uin->pc) \ - pdfdoc_changed_error(L); \ -- gs = ((in *) uin->d)->function(); \ -+ gs = (GooString *)((in *) uin->d)->function(); \ - if (gs != NULL) \ - lua_pushlstring(L, gs->getCString(), gs->getLength()); \ - else \ -@@ -1656,7 +1656,7 @@ - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); - if (((Object *) uin->d)->isString()) { -- gs = ((Object *) uin->d)->getString(); -+ gs = (GooString *)((Object *) uin->d)->getString(); - lua_pushlstring(L, gs->getCString(), gs->getLength()); - } else - lua_pushnil(L); -diff -ruN texlive-20170524-source.orig/texk/web2c/pdftexdir/pdftoepdf.cc texlive-20170524-source/texk/web2c/pdftexdir/pdftoepdf.cc ---- texlive-20170524-source.orig/texk/web2c/pdftexdir/pdftoepdf.cc 2018-05-20 22:11:35.788633528 +0200 -+++ texlive-20170524-source/texk/web2c/pdftexdir/pdftoepdf.cc 2018-05-20 22:12:34.398361984 +0200 -@@ -284,7 +284,7 @@ - static void copyDictEntry(Object * obj, int i) - { - Object obj1; -- copyName(obj->dictGetKey(i)); -+ copyName((char *)obj->dictGetKey(i)); - pdf_puts(" "); - obj1 = obj->dictGetValNF(i); - copyObject(&obj1); -@@ -349,7 +349,7 @@ - if (!procset.isName()) - pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", - procset.getTypeName()); -- copyName(procset.getName()); -+ copyName((char *)procset.getName()); - pdf_puts(" "); - } - pdf_puts("]\n"); -@@ -412,7 +412,7 @@ - && fontdescRef.isRef() - && fontdesc.isDict() - && embeddableFont(&fontdesc) -- && (fontmap = lookup_fontmap(basefont.getName())) != NULL) { -+ && (fontmap = lookup_fontmap((char *)basefont.getName())) != NULL) { - // round /StemV value, since the PDF input is a float - // (see Font Descriptors in PDF reference), but we only store an - // integer, since we don't want to change the struct. -@@ -421,7 +421,7 @@ - charset = fontdesc.dictLookup("CharSet"); - if (!charset.isNull() && - charset.isString() && is_subsetable(fontmap)) -- epdf_mark_glyphs(fd, charset.getString()->getCString()); -+ epdf_mark_glyphs(fd, (char *)charset.getString()->getCString()); - else - embed_whole_font(fd); - addFontDesc(fontdescRef.getRef(), fd); -@@ -450,7 +450,7 @@ - if (fontRef.isRef()) - copyFont(obj->dictGetKey(i), &fontRef); - else if (fontRef.isDict()) { // some programs generate pdf with embedded font object -- copyName(obj->dictGetKey(i)); -+ copyName((char *)obj->dictGetKey(i)); - pdf_puts(" "); - copyObject(&fontRef); - } -@@ -559,7 +559,7 @@ - } else if (obj->isNum()) { - pdf_printf("%s", convertNumToPDF(obj->getNum())); - } else if (obj->isString()) { -- s = obj->getString(); -+ s = (GooString *)obj->getString(); - p = s->getCString(); - l = s->getLength(); - if (strlen(p) == (unsigned int) l) { -@@ -583,7 +583,7 @@ - pdf_puts(">"); - } - } else if (obj->isName()) { -- copyName(obj->getName()); -+ copyName((char *)obj->getName()); - } else if (obj->isNull()) { - pdf_puts("null"); - } else if (obj->isArray()) { -diff -ruN texlive-20170524-source.orig/texk/web2c/pdftexdir/pdftosrc.cc texlive-20170524-source/texk/web2c/pdftexdir/pdftosrc.cc ---- texlive-20170524-source.orig/texk/web2c/pdftexdir/pdftosrc.cc 2018-05-20 22:11:35.788633528 +0200 -+++ texlive-20170524-source/texk/web2c/pdftexdir/pdftosrc.cc 2018-05-20 22:12:31.369324336 +0200 -@@ -104,7 +104,7 @@ - fprintf(stderr, "No SourceName found\n"); - exit(1); - } -- outname = srcName.getString()->getCString(); -+ outname = (char *)srcName.getString()->getCString(); - // We cannot free srcName, as objname shares its string. - // srcName.free(); - } else if (objnum > 0) { diff --git a/app-text/texlive-core/files/texlive-core-2017-poppler069.patch b/app-text/texlive-core/files/texlive-core-2017-poppler069.patch deleted file mode 100644 index 309341705006..000000000000 --- a/app-text/texlive-core/files/texlive-core-2017-poppler069.patch +++ /dev/null @@ -1,216 +0,0 @@ -From 29f2412e10523158f5e601f32482d3d233a934fc Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sat, 12 Jan 2019 21:42:09 +0100 -Subject: [PATCH 1/2] Fix build with poppler-0.69.0 - ---- - texk/web2c/luatexdir/image/epdf.h | 1 + - texk/web2c/luatexdir/image/pdftoepdf.w | 14 +++++++------- - texk/web2c/luatexdir/lua/lepdflib.cc | 18 +++++++++--------- - texk/web2c/luatexdir/lua/lpdfscannerlib.cc | 1 + - texk/web2c/pdftexdir/pdftoepdf.cc | 7 ++++--- - texk/web2c/pdftexdir/pdftosrc.cc | 5 +++-- - 6 files changed, 25 insertions(+), 21 deletions(-) - -diff --git a/texk/web2c/luatexdir/image/epdf.h b/texk/web2c/luatexdir/image/epdf.h -index 57bb2e39..ebc83bdb 100644 ---- a/texk/web2c/luatexdir/image/epdf.h -+++ b/texk/web2c/luatexdir/image/epdf.h -@@ -39,6 +39,7 @@ extern "C" { - # include - # include - # include -+# include - # include - # include - # include -diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w -index 3aebf009..0a23b201 100644 ---- a/texk/web2c/luatexdir/image/pdftoepdf.w -+++ b/texk/web2c/luatexdir/image/pdftoepdf.w -@@ -31,7 +31,7 @@ - - extern void md5(Guchar *msg, int msgLen, Guchar *digest); - --static GBool isInit = gFalse; -+static bool isInit = false; - - /* Maintain AVL tree of all PDF files for embedding */ - -@@ -468,7 +468,7 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, Object * obj) - break; - /* - case objNum: -- GBool isNum() { return type == objInt || type == objReal; } -+ bool isNum() { return type == objInt || type == objReal; } - break; - */ - case objString: -@@ -587,11 +587,11 @@ void read_pdf_info(image_dict * idict) - PDFRectangle *pagebox; - int pdf_major_version_found, pdf_minor_version_found; - float xsize, ysize, xorig, yorig; -- if (isInit == gFalse) { -+ if (isInit == false) { - if (!(globalParams)) - globalParams = new GlobalParams(); -- globalParams->setErrQuiet(gFalse); -- isInit = gTrue; -+ globalParams->setErrQuiet(false); -+ isInit = true; - } - if (img_type(idict) == IMG_TYPE_PDF) - pdf_doc = refPdfDocument(img_filepath(idict), FE_FAIL); -@@ -960,7 +960,7 @@ void epdf_free() - if (PdfDocumentTree != NULL) - avl_destroy(PdfDocumentTree, destroyPdfDocument); - PdfDocumentTree = NULL; -- if (isInit == gTrue) -+ if (isInit == true) - delete globalParams; -- isInit = gFalse; -+ isInit = false; - } -diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc -index 14558510..d47ec941 100644 ---- a/texk/web2c/luatexdir/lua/lepdflib.cc -+++ b/texk/web2c/luatexdir/lua/lepdflib.cc -@@ -1374,9 +1374,9 @@ static int m_Object_initBool(lua_State * L) - pdfdoc_changed_error(L); - luaL_checktype(L, 2, LUA_TBOOLEAN); - if (lua_toboolean(L, 2) != 0) -- *((Object *) uin->d) = Object(gTrue); -+ *((Object *) uin->d) = Object(true); - else -- *((Object *) uin->d) = Object(gFalse); -+ *((Object *) uin->d) = Object(false); - return 0; - } - -@@ -2881,12 +2881,12 @@ m_poppler_get_BOOL(Attribute, isHidden); - - static int m_Attribute_setHidden(lua_State * L) - { -- GBool i; -+ bool i; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- i = (GBool) lua_toboolean(L, 2); -+ i = (bool) lua_toboolean(L, 2); - ((Attribute *) uin->d)->setHidden(i); - return 0; - } -@@ -3023,7 +3023,7 @@ static int m_StructElement_getParentRef(lua_State * L) - // Ref is false if the C++ functione return false - static int m_StructElement_getPageRef(lua_State * L) - { -- GBool b; -+ bool b; - Ref *r; - udstruct *uin, *uout; - uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement); -@@ -3069,13 +3069,13 @@ static int m_StructElement_setRevision(lua_State * L) - - static int m_StructElement_getText(lua_State * L) - { -- GBool i; -+ bool i; - GooString *gs; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- i = (GBool) lua_toboolean(L, 2); -+ i = (bool) lua_toboolean(L, 2); - gs = ((StructElement *) uin->d)->getText(i); - if (gs != NULL) - lua_pushlstring(L, gs->getCString(), gs->getLength()); -@@ -3164,7 +3164,7 @@ static int m_StructElement_findAttribute(lua_State * L) - { - Attribute::Type t; - Attribute::Owner o; -- GBool g; -+ bool g; - udstruct *uin, *uout; - const Attribute *a; - uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement); -@@ -3172,7 +3172,7 @@ static int m_StructElement_findAttribute(lua_State * L) - pdfdoc_changed_error(L); - t = (Attribute::Type) luaL_checkint(L,1); - o = (Attribute::Owner) luaL_checkint(L,2); -- g = (GBool) lua_toboolean(L, 3); -+ g = (bool) lua_toboolean(L, 3); - a = ((StructElement *) uin->d)->findAttribute(t,g,o); - - if (a!=NULL){ -diff --git a/texk/web2c/luatexdir/lua/lpdfscannerlib.cc b/texk/web2c/luatexdir/lua/lpdfscannerlib.cc -index eb881b63..a2d39b83 100644 ---- a/texk/web2c/luatexdir/lua/lpdfscannerlib.cc -+++ b/texk/web2c/luatexdir/lua/lpdfscannerlib.cc -@@ -34,6 +34,7 @@ extern "C" { - # include - # include - # include -+# include - # include - # include - # include -diff --git a/texk/web2c/pdftexdir/pdftoepdf.cc b/texk/web2c/pdftexdir/pdftoepdf.cc -index 0ffc3e19..af12c74e 100644 ---- a/texk/web2c/pdftexdir/pdftoepdf.cc -+++ b/texk/web2c/pdftexdir/pdftoepdf.cc -@@ -37,6 +37,7 @@ with this program. If not, see . - #include - #include - #include -+#include - #define GString GooString - #else - #include -@@ -114,7 +115,7 @@ struct UsedEncoding { - - static InObj *inObjList; - static UsedEncoding *encodingList; --static GBool isInit = gFalse; -+static bool isInit = false; - - // -------------------------------------------------------------------- - // Maintain list of open embedded PDF files -@@ -718,8 +719,8 @@ read_pdf_info(char *image_name, char *page_name, int page_num, - // initialize - if (!isInit) { - globalParams = new GlobalParams(); -- globalParams->setErrQuiet(gFalse); -- isInit = gTrue; -+ globalParams->setErrQuiet(false); -+ isInit = true; - } - // open PDF file - pdf_doc = find_add_document(image_name); -diff --git a/texk/web2c/pdftexdir/pdftosrc.cc b/texk/web2c/pdftexdir/pdftosrc.cc -index ead9f209..22ab6bdc 100644 ---- a/texk/web2c/pdftexdir/pdftosrc.cc -+++ b/texk/web2c/pdftexdir/pdftosrc.cc -@@ -31,6 +31,7 @@ with this program. If not, see . - #include - #include - #include -+#include - #else - #include - #include -@@ -167,8 +168,8 @@ int main(int argc, char *argv[]) - - // parse the header: object numbers and offsets - objStr.streamReset(); -- str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first); -- parser = new Parser(xref, new Lexer(xref, str), gFalse); -+ str = new EmbedStream(objStr.getStream(), Object(objNull), true, first); -+ parser = new Parser(xref, new Lexer(xref, str), false); - for (n = 0; n < nObjects; ++n) { - obj1 = parser->getObj(); - obj2 = parser->getObj(); --- -2.20.1 diff --git a/app-text/texlive-core/files/texlive-core-2017-poppler071.patch b/app-text/texlive-core/files/texlive-core-2017-poppler071.patch deleted file mode 100644 index 6238002c2e59..000000000000 --- a/app-text/texlive-core/files/texlive-core-2017-poppler071.patch +++ /dev/null @@ -1,281 +0,0 @@ -From 2f77decfd2340c9a241dc508ae984a93dfef2643 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sat, 12 Jan 2019 21:43:29 +0100 -Subject: [PATCH 2/2] Fix build with poppler-0.71.0 - -Thanks-to: maurerpe ---- - texk/web2c/luatexdir/image/pdftoepdf.w | 10 +++++----- - texk/web2c/luatexdir/lua/lepdflib.cc | 18 +++++++++--------- - texk/web2c/pdftexdir/pdftex-common.h | 2 +- - texk/web2c/pdftexdir/pdftoepdf.cc | 20 ++++++++++---------- - texk/web2c/pdftexdir/writeenc.c | 2 +- - texk/web2c/xetexdir/pdfimage.cpp | 2 +- - 6 files changed, 27 insertions(+), 27 deletions(-) - -diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w -index 0a23b201..aa1d7f25 100644 ---- a/texk/web2c/luatexdir/image/pdftoepdf.w -+++ b/texk/web2c/luatexdir/image/pdftoepdf.w -@@ -363,7 +363,7 @@ void copyReal(PDF pdf, double d) - - static void copyString(PDF pdf, GooString * string) - { -- char *p; -+ const char *p; - unsigned char c; - size_t i, l; - p = string->getCString(); -@@ -393,7 +393,7 @@ static void copyString(PDF pdf, GooString * string) - pdf->cave = true; - } - --static void copyName(PDF pdf, char *s) -+static void copyName(PDF pdf, const char *s) - { - pdf_out(pdf, '/'); - for (; *s != 0; s++) { -@@ -527,7 +527,7 @@ static void writeRefs(PDF pdf, PdfDocument * pdf_doc) - - /* get the pagebox coordinates according to the pagebox_spec */ - --static PDFRectangle *get_pagebox(Page * page, int pagebox_spec) -+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec) - { - switch (pagebox_spec) { - case PDF_BOX_SPEC_MEDIA: -@@ -584,7 +584,7 @@ void read_pdf_info(image_dict * idict) - Catalog *catalog; - Page *page; - int rotate; -- PDFRectangle *pagebox; -+ const PDFRectangle *pagebox; - int pdf_major_version_found, pdf_minor_version_found; - float xsize, ysize, xorig, yorig; - if (isInit == false) { -@@ -721,7 +721,7 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info) - Ref *pageref; - Dict *pageDict; - Object obj1, contents, pageobj, pagesobj1, pagesobj2, *op1, *op2, *optmp; -- PDFRectangle *pagebox; -+ const PDFRectangle *pagebox; - int i, l; - double bbox[4]; - /* char s[256]; */ -diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc -index d47ec941..01f9415c 100644 ---- a/texk/web2c/luatexdir/lua/lepdflib.cc -+++ b/texk/web2c/luatexdir/lua/lepdflib.cc -@@ -238,7 +238,7 @@ static int l_new_Attribute(lua_State * L) - if (uobj->pd != NULL && uobj->pd->pc != uobj->pc) - pdfdoc_changed_error(L); - uout = new_Attribute_userdata(L); -- uout->d = new Attribute(n, nlen, (Object *)uobj->d); -+ uout->d = new Attribute(GooString(n, nlen), (Object *)uobj->d); - uout->atype = ALLOC_LEPDF; - uout->pc = uobj->pc; - uout->pd = uobj->pd; -@@ -443,7 +443,7 @@ static int m_##in##_##function(lua_State * L) \ - uin = (udstruct *) luaL_checkudata(L, 1, M_##in); \ - if (uin->pd != NULL && uin->pd->pc != uin->pc) \ - pdfdoc_changed_error(L); \ -- o = ((in *) uin->d)->function(); \ -+ o = (out *) ((in *) uin->d)->function(); \ - if (o != NULL) { \ - uout = new_##out##_userdata(L); \ - uout->d = o; \ -@@ -972,12 +972,12 @@ m_poppler_get_INT(Dict, getLength); - - static int m_Dict_add(lua_State * L) - { -- char *s; -+ const char *s; - udstruct *uin, *uobj; - uin = (udstruct *) luaL_checkudata(L, 1, M_Dict); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- s = copyString(luaL_checkstring(L, 2)); -+ s = luaL_checkstring(L, 2); - uobj = (udstruct *) luaL_checkudata(L, 3, M_Object); - ((Dict *) uin->d)->add(s, std::move(*((Object *) uobj->d))); - return 0; -@@ -1894,7 +1894,7 @@ static int m_Object_dictAdd(lua_State * L) - pdfdoc_changed_error(L); - if (!((Object *) uin->d)->isDict()) - luaL_error(L, "Object is not a Dict"); -- ((Object *) uin->d)->dictAdd(copyString(s), std::move(*((Object *) uobj->d))); -+ ((Object *) uin->d)->dictAdd(s, std::move(*((Object *) uobj->d))); - return 0; - } - -@@ -2308,7 +2308,7 @@ m_PDFDoc_INT(getErrorCode); - - static int m_PDFDoc_getFileName(lua_State * L) - { -- GooString *gs; -+ const GooString *gs; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); - if (uin->pd != NULL && uin->pd->pc != uin->pc) -@@ -2396,7 +2396,7 @@ m_PDFDoc_INT(getNumPages); - - static int m_PDFDoc_readMetadata(lua_State * L) - { -- GooString *gs; -+ const GooString *gs; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); - if (uin->pd != NULL && uin->pd->pc != uin->pc) -@@ -2414,7 +2414,7 @@ static int m_PDFDoc_readMetadata(lua_State * L) - - static int m_PDFDoc_getStructTreeRoot(lua_State * L) - { -- StructTreeRoot *obj; -+ const StructTreeRoot *obj; - udstruct *uin, *uout; - uin = (udstruct *) luaL_checkudata(L, 1, M_PDFDoc); - if (uin->pd != NULL && uin->pd->pc != uin->pc) -@@ -2422,7 +2422,7 @@ static int m_PDFDoc_getStructTreeRoot(lua_State * L) - if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) { - obj = ((PdfDocument *) uin->d)->doc->getStructTreeRoot(); - uout = new_StructTreeRoot_userdata(L); -- uout->d = obj; -+ uout->d = (StructTreeRoot *) obj; - uout->pc = uin->pc; - uout->pd = uin->pd; - } else -diff --git a/texk/web2c/pdftexdir/pdftex-common.h b/texk/web2c/pdftexdir/pdftex-common.h -index 307ba64a..09741707 100644 ---- a/texk/web2c/pdftexdir/pdftex-common.h -+++ b/texk/web2c/pdftexdir/pdftex-common.h -@@ -101,7 +101,7 @@ extern void tex_printf(const char *, ...); - extern void write_epdf(void); - - /* writeenc.c */ --extern void epdf_write_enc(char **, int); -+extern void epdf_write_enc(const char **, int); - - /* writeimg.c */ - extern float epdf_width; -diff --git a/texk/web2c/pdftexdir/pdftoepdf.cc b/texk/web2c/pdftexdir/pdftoepdf.cc -index af12c74e..e353b652 100644 ---- a/texk/web2c/pdftexdir/pdftoepdf.cc -+++ b/texk/web2c/pdftexdir/pdftoepdf.cc -@@ -270,7 +270,7 @@ static int getNewObjectNumber(Ref ref) - - static void copyObject(Object *); - --static void copyName(char *s) -+static void copyName(const char *s) - { - pdf_puts("/"); - for (; *s != 0; s++) { -@@ -305,7 +305,7 @@ static void copyDict(Object * obj) - static void copyFontDict(Object * obj, InObj * r) - { - int i, l; -- char *key; -+ const char *key; - if (!obj->isDict()) - pdftex_fail("PDF inclusion: invalid dict type <%s>", - obj->getTypeName()); -@@ -377,7 +377,7 @@ static bool embeddableFont(Object * fontdesc) - return false; - } - --static void copyFont(char *tag, Object * fontRef) -+static void copyFont(const char *tag, Object * fontRef) - { - Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset, - stemV; -@@ -462,7 +462,7 @@ static void copyFontResources(Object * obj) - pdf_puts(">>\n"); - } - --static void copyOtherResources(Object * obj, char *key) -+static void copyOtherResources(Object * obj, const char *key) - { - // copies all other resources (write_epdf handles Fonts and ProcSets), - -@@ -549,7 +549,7 @@ static void copyObject(Object * obj) - Object obj1; - int i, l, c; - Ref ref; -- char *p; -+ const char *p; - GString *s; - if (obj->isBool()) { - pdf_printf("%s", obj->getBool()? "true" : "false"); -@@ -650,7 +650,7 @@ static void writeRefs() - static void writeEncodings() - { - UsedEncoding *r, *n; -- char *glyphNames[256], *s; -+ const char *glyphNames[256], *s; - int i; - for (r = encodingList; r != 0; r = r->next) { - for (i = 0; i < 256; i++) { -@@ -678,7 +678,7 @@ static void writeEncodings() - } - - // get the pagebox according to the pagebox_spec --static PDFRectangle *get_pagebox(Page * page, int pagebox_spec) -+static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec) - { - if (pagebox_spec == pdfboxspecmedia) - return page->getMediaBox(); -@@ -710,7 +710,7 @@ read_pdf_info(char *image_name, char *page_name, int page_num, - { - PdfDocument *pdf_doc; - Page *page; -- PDFRectangle *pagebox; -+ const PDFRectangle *pagebox; - #ifdef POPPLER_VERSION - int pdf_major_version_found, pdf_minor_version_found; - #else -@@ -829,7 +829,7 @@ void write_epdf(void) - Object groupDict; - bool writeSepGroup = false; - Object info; -- char *key; -+ const char *key; - char s[256]; - int i, l; - int rotate; -@@ -856,7 +856,7 @@ void write_epdf(void) - pageObj = xref->fetch(pageRef->num, pageRef->gen); - pageDict = pageObj.getDict(); - rotate = page->getRotate(); -- PDFRectangle *pagebox; -+ const PDFRectangle *pagebox; - // write the Page header - pdf_puts("/Type /XObject\n"); - pdf_puts("/Subtype /Form\n"); -diff --git a/texk/web2c/pdftexdir/writeenc.c b/texk/web2c/pdftexdir/writeenc.c -index bd55103f..08f44633 100644 ---- a/texk/web2c/pdftexdir/writeenc.c -+++ b/texk/web2c/pdftexdir/writeenc.c -@@ -83,7 +83,7 @@ fe_entry *get_fe_entry(char *s) - - /**********************************************************************/ - --void epdf_write_enc(char **glyph_names, int fe_objnum) -+void epdf_write_enc(const char **glyph_names, int fe_objnum) - { - int i, i_old; - assert(glyph_names != NULL); -diff --git a/texk/web2c/xetexdir/pdfimage.cpp b/texk/web2c/xetexdir/pdfimage.cpp -index 85389136..ce46cae1 100644 ---- a/texk/web2c/xetexdir/pdfimage.cpp -+++ b/texk/web2c/xetexdir/pdfimage.cpp -@@ -78,7 +78,7 @@ pdf_get_rect(char* filename, int page_num, int pdf_box, realrect* box) - - Page* page = doc->getCatalog()->getPage(page_num); - -- PDFRectangle* r; -+ const PDFRectangle* r; - switch (pdf_box) { - default: - case pdfbox_crop: --- -2.20.1 diff --git a/app-text/texlive-core/files/texlive-core-2017-poppler072.patch b/app-text/texlive-core/files/texlive-core-2017-poppler072.patch deleted file mode 100644 index 489ff25fa006..000000000000 --- a/app-text/texlive-core/files/texlive-core-2017-poppler072.patch +++ /dev/null @@ -1,157 +0,0 @@ -From 19462cf1b5628d7251cde91031a0635e636d890a Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Sat, 12 Jan 2019 21:59:07 +0100 -Subject: [PATCH] Fix build with poppler-0.72 - ---- - texk/web2c/luatexdir/image/pdftoepdf.w | 2 +- - texk/web2c/luatexdir/lua/lepdflib.cc | 16 ++++++++-------- - texk/web2c/pdftexdir/pdftoepdf.cc | 4 ++-- - texk/web2c/pdftexdir/pdftosrc.cc | 6 +++--- - 4 files changed, 14 insertions(+), 14 deletions(-) - -diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w -index aa1d7f25..2f143068 100644 ---- a/texk/web2c/luatexdir/image/pdftoepdf.w -+++ b/texk/web2c/luatexdir/image/pdftoepdf.w -@@ -366,7 +366,7 @@ static void copyString(PDF pdf, GooString * string) - const char *p; - unsigned char c; - size_t i, l; -- p = string->getCString(); -+ p = string->c_str(); - l = (size_t) string->getLength(); - if (pdf->cave) - pdf_out(pdf, ' '); -diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc -index 01f9415c..6b24a39b 100644 ---- a/texk/web2c/luatexdir/lua/lepdflib.cc -+++ b/texk/web2c/luatexdir/lua/lepdflib.cc -@@ -523,7 +523,7 @@ static int m_##in##_##function(lua_State * L) \ - pdfdoc_changed_error(L); \ - gs = (GooString *)((in *) uin->d)->function(); \ - if (gs != NULL) \ -- lua_pushlstring(L, gs->getCString(), gs->getLength()); \ -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); \ - else \ - lua_pushnil(L); \ - return 1; \ -@@ -758,7 +758,7 @@ static int m_Array_getString(lua_State * L) - if (i > 0 && i <= len) { - gs = new GooString(); - if (((Array *) uin->d)->getString(i - 1, gs)) -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - else - lua_pushnil(L); - delete gs; -@@ -910,7 +910,7 @@ static int m_Catalog_getJS(lua_State * L) - if (i > 0 && i <= len) { - gs = ((Catalog *) uin->d)->getJS(i - 1); - if (gs != NULL) -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - else - lua_pushnil(L); - delete gs; -@@ -1225,7 +1225,7 @@ static int m_GooString__tostring(lua_State * L) - uin = (udstruct *) luaL_checkudata(L, 1, M_GooString); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- lua_pushlstring(L, ((GooString *) uin->d)->getCString(), -+ lua_pushlstring(L, ((GooString *) uin->d)->c_str(), - ((GooString *) uin->d)->getLength()); - return 1; - } -@@ -1657,7 +1657,7 @@ static int m_Object_getString(lua_State * L) - pdfdoc_changed_error(L); - if (((Object *) uin->d)->isString()) { - gs = (GooString *)((Object *) uin->d)->getString(); -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - } else - lua_pushnil(L); - return 1; -@@ -2315,7 +2315,7 @@ static int m_PDFDoc_getFileName(lua_State * L) - pdfdoc_changed_error(L); - gs = ((PdfDocument *) uin->d)->doc->getFileName(); - if (gs != NULL) -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - else - lua_pushnil(L); - return 1; -@@ -2404,7 +2404,7 @@ static int m_PDFDoc_readMetadata(lua_State * L) - if (((PdfDocument *) uin->d)->doc->getCatalog()->isOk()) { - gs = ((PdfDocument *) uin->d)->doc->readMetadata(); - if (gs != NULL) -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - else - lua_pushnil(L); - } else -@@ -3078,7 +3078,7 @@ static int m_StructElement_getText(lua_State * L) - i = (bool) lua_toboolean(L, 2); - gs = ((StructElement *) uin->d)->getText(i); - if (gs != NULL) -- lua_pushlstring(L, gs->getCString(), gs->getLength()); -+ lua_pushlstring(L, gs->c_str(), gs->getLength()); - else - lua_pushnil(L); - return 1; -diff --git a/texk/web2c/pdftexdir/pdftoepdf.cc b/texk/web2c/pdftexdir/pdftoepdf.cc -index e353b652..84e9f7ce 100644 ---- a/texk/web2c/pdftexdir/pdftoepdf.cc -+++ b/texk/web2c/pdftexdir/pdftoepdf.cc -@@ -422,7 +422,7 @@ static void copyFont(const char *tag, Object * fontRef) - charset = fontdesc.dictLookup("CharSet"); - if (!charset.isNull() && - charset.isString() && is_subsetable(fontmap)) -- epdf_mark_glyphs(fd, (char *)charset.getString()->getCString()); -+ epdf_mark_glyphs(fd, (char *)charset.getString()->c_str()); - else - embed_whole_font(fd); - addFontDesc(fontdescRef.getRef(), fd); -@@ -561,7 +561,7 @@ static void copyObject(Object * obj) - pdf_printf("%s", convertNumToPDF(obj->getNum())); - } else if (obj->isString()) { - s = (GooString *)obj->getString(); -- p = s->getCString(); -+ p = s->c_str(); - l = s->getLength(); - if (strlen(p) == (unsigned int) l) { - pdf_puts("("); -diff --git a/texk/web2c/pdftexdir/pdftosrc.cc b/texk/web2c/pdftexdir/pdftosrc.cc -index 22ab6bdc..bad1b78f 100644 ---- a/texk/web2c/pdftexdir/pdftosrc.cc -+++ b/texk/web2c/pdftexdir/pdftosrc.cc -@@ -105,7 +105,7 @@ int main(int argc, char *argv[]) - fprintf(stderr, "No SourceName found\n"); - exit(1); - } -- outname = (char *)srcName.getString()->getCString(); -+ outname = (char *)srcName.getString()->c_str(); - // We cannot free srcName, as objname shares its string. - // srcName.free(); - } else if (objnum > 0) { -@@ -114,7 +114,7 @@ int main(int argc, char *argv[]) - fprintf(stderr, "Not a Stream object\n"); - exit(1); - } -- sprintf(buf, "%s", fileName->getCString()); -+ sprintf(buf, "%s", fileName->c_str()); - if ((p = strrchr(buf, '.')) == 0) - p = strchr(buf, 0); - if (objgen == 0) -@@ -124,7 +124,7 @@ int main(int argc, char *argv[]) - outname = buf; - } else { // objnum < 0 means we are extracting the XRef table - extract_xref_table = true; -- sprintf(buf, "%s", fileName->getCString()); -+ sprintf(buf, "%s", fileName->c_str()); - if ((p = strrchr(buf, '.')) == 0) - p = strchr(buf, 0); - sprintf(p, ".xref"); --- -2.20.1 - diff --git a/app-text/texlive-core/files/texlive-core-2017-poppler073.patch b/app-text/texlive-core/files/texlive-core-2017-poppler073.patch deleted file mode 100644 index 487ecc0129c1..000000000000 --- a/app-text/texlive-core/files/texlive-core-2017-poppler073.patch +++ /dev/null @@ -1,74 +0,0 @@ -From b3df00dcf7332ae9b64f019278af8708c1ced284 Mon Sep 17 00:00:00 2001 -From: Andreas Sturmlechner -Date: Wed, 16 Jan 2019 21:10:09 +0100 -Subject: [PATCH] Fix build with poppler-0.73 - ---- - texk/web2c/luatexdir/image/pdftoepdf.w | 2 +- - texk/web2c/luatexdir/lua/lepdflib.cc | 8 ++++---- - texk/web2c/pdftexdir/pdftosrc.cc | 2 +- - 3 files changed, 6 insertions(+), 6 deletions(-) - -diff --git a/texk/web2c/luatexdir/image/pdftoepdf.w b/texk/web2c/luatexdir/image/pdftoepdf.w -index 2f143068..10ed9879 100644 ---- a/texk/web2c/luatexdir/image/pdftoepdf.w -+++ b/texk/web2c/luatexdir/image/pdftoepdf.w -@@ -29,7 +29,7 @@ - the functions of poppler, which happens to be written in C++. - */ - --extern void md5(Guchar *msg, int msgLen, Guchar *digest); -+extern void md5(unsigned char *msg, int msgLen, unsigned char *digest); - - static bool isInit = false; - -diff --git a/texk/web2c/luatexdir/lua/lepdflib.cc b/texk/web2c/luatexdir/lua/lepdflib.cc -index 6b24a39b..87078fc5 100644 ---- a/texk/web2c/luatexdir/lua/lepdflib.cc -+++ b/texk/web2c/luatexdir/lua/lepdflib.cc -@@ -2867,12 +2867,12 @@ m_poppler_get_GUINT(Attribute,getRevision); - - static int m_Attribute_setRevision(lua_State * L) - { -- Guint i; -+ unsigned int i; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_Attribute); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- i = (Guint) luaL_checkint(L, 2); -+ i = (unsigned int) luaL_checkint(L, 2); - ((Attribute *) uin->d)->setRevision(i); - return 0; - } -@@ -3057,12 +3057,12 @@ static int m_StructElement_getTypeName(lua_State * L) - - static int m_StructElement_setRevision(lua_State * L) - { -- Guint i; -+ unsigned int i; - udstruct *uin; - uin = (udstruct *) luaL_checkudata(L, 1, M_StructElement); - if (uin->pd != NULL && uin->pd->pc != uin->pc) - pdfdoc_changed_error(L); -- i = (Guint) luaL_checkint(L, 2); -+ i = (unsigned int) luaL_checkint(L, 2); - ((StructElement *) uin->d)->setRevision(i); - return 0; - } -diff --git a/texk/web2c/pdftexdir/pdftosrc.cc b/texk/web2c/pdftexdir/pdftosrc.cc -index bad1b78f..295c4e66 100644 ---- a/texk/web2c/pdftexdir/pdftosrc.cc -+++ b/texk/web2c/pdftexdir/pdftosrc.cc -@@ -156,7 +156,7 @@ int main(int argc, char *argv[]) - Object objStr, obj1, obj2; - int nObjects, first, n; - int localOffset = 0; -- Guint firstOffset; -+ unsigned int firstOffset; - - objStr = xref->fetch(e->offset, 0); - assert(objStr.isStream()); --- -2.20.1 - diff --git a/app-text/texlive-core/texlive-core-2017-r4.ebuild b/app-text/texlive-core/texlive-core-2017-r4.ebuild index e0cf232cbf42..890dbd171496 100644 --- a/app-text/texlive-core/texlive-core-2017-r4.ebuild +++ b/app-text/texlive-core/texlive-core-2017-r4.ebuild @@ -19,8 +19,10 @@ LICENSE="GPL-2 LPPL-1.3c TeX" SRC_URI="mirror://gentoo/${MY_PV}.tar.xz" # Fetch patches +POPPLERPATCHES="${P}-poppler076" SRC_URI="${SRC_URI} mirror://gentoo/${PN}-patches-${PATCHLEVEL}.tar.xz https://dev.gentoo.org/~dilfridge/distfiles/${PN%-core}-${TL_SOURCE_VERSION}-source-freetype.patch.xz + https://dev.gentoo.org/~asturm/distfiles/${POPPLERPATCHES}.tar.xz " # mirror://gentoo/texlive-core-upstream-patches-${TL_UPSTREAM_PATCHLEVEL}.tar.xz" @@ -164,10 +166,15 @@ src_prepare() { EPATCH_SUFFIX="patch" epatch "${WORKDIR}/patches" # bug ? - epatch "${FILESDIR}/${P}-poppler064.patch" + epatch "${WORKDIR}/${POPPLERPATCHES}/${P}-poppler064.patch" if has_version ">=app-text/poppler-0.69.0"; then - epatch "${FILESDIR}"/${P}-poppler0{69,71,72,73}.patch # bugs #672854, 675448 + epatch "${WORKDIR}"/${POPPLERPATCHES}/${P}-poppler0{69,71,72,73}.patch # bugs #672854, 675448 + fi + + if has_version ">=app-text/poppler-0.75.0"; then + epatch "${WORKDIR}"/${POPPLERPATCHES}/${P}-pdftexdir-poppler0{75,76}.patch # bugs #681338, 685284 + epatch "${WORKDIR}"/${POPPLERPATCHES}/${P}-luatexdir-poppler0{75,76}.patch # bugs #681338, 685284 fi sed -i \