Browse Source

texlive-bin: update for poppler 0.75.0

emacs-27
Tom Yan 6 years ago
committed by Leonid Plyushch
parent
commit
b46e3b1612
  1. 4
      packages/texlive-bin/build.sh
  2. 125
      packages/texlive-bin/luatex-poppler-fixes.patch
  3. 22
      packages/texlive-bin/pdftoepdf-poppler0.75.0.cc

4
packages/texlive-bin/build.sh

@ -3,7 +3,7 @@ TERMUX_PKG_DESCRIPTION="TeX Live is a distribution of the TeX typesetting system
TERMUX_PKG_LICENSE="GPL-2.0"
TERMUX_PKG_MAINTAINER="Henrik Grimler @Grimler91"
TERMUX_PKG_VERSION=20180414
TERMUX_PKG_REVISION=8
TERMUX_PKG_REVISION=9
TERMUX_PKG_SHA256=b6251e2edefb174ca402109d7f82df3cb98e45d367fada627a61de7ed2d4380d
# FIXME: update version format and SRCURL when texlive 2019 is released
TERMUX_PKG_SRCURL=https://github.com/TeX-Live/texlive-source/archive/texlive-2018.2.tar.gz
@ -168,7 +168,7 @@ termux_step_pre_configure() {
{} +
# These files are from upstream master:
cp "$TERMUX_PKG_BUILDER_DIR"/pdftoepdf-poppler0.72.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftoepdf.cc # commit 67290f7
cp "$TERMUX_PKG_BUILDER_DIR"/pdftoepdf-poppler0.75.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftoepdf.cc # commit 4dbbcd8
cp "$TERMUX_PKG_BUILDER_DIR"/pdftosrc-poppler0.72.0.cc "$TERMUX_PKG_SRCDIR"/texk/web2c/pdftexdir/pdftosrc.cc # commit 68f53cf
}

125
packages/texlive-bin/luatex-poppler-fixes.patch

@ -191,3 +191,128 @@ Luatex fixes for poppler 0.71
uout->pc = uobj->pc;
uout->pd = uobj->pd;
--- source/texk/web2c/luatexdir/lua/lepdflib.cc.orig 2019-03-22 11:02:34.966605737 +0000
+++ source/texk/web2c/luatexdir/lua/lepdflib.cc 2019-03-22 11:09:27.894599672 +0000
@@ -496,7 +496,7 @@
double numA = lua_tonumber(L,1);
double genA = lua_tonumber(L,2);
if ( ((numA)==(int)(numA)) && ((genA)==(int)(genA)) ){
- uout->d = new Object((int)(numA), (int)(genA));
+ uout->d = new Object({(int)(numA), (int)(genA)});
uout->atype = ALLOC_LEPDF;
uout->pc = 0;
uout->pd = NULL;
@@ -889,7 +889,7 @@
if (i > 0 && i <= len) {
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1);
+ *((Object *) uout->d) = ((Array *) uin->d)->getNF(i - 1).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
@@ -1190,7 +1190,7 @@
s = luaL_checkstring(L, 2);
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s);
+ *((Object *) uout->d) = ((Dict *) uin->d)->lookupNF(s).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
@@ -1263,7 +1263,7 @@
if (i > 0 && i <= len) {
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1);
+ *((Object *) uout->d) = ((Dict *) uin->d)->getValNF(i - 1).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
@@ -1653,7 +1653,7 @@
pdfdoc_changed_error(L);
num = luaL_checkint(L, 2);
gen = luaL_checkint(L, 3);
- *((Object *) uin->d) = Object(num, gen);
+ *((Object *) uin->d) = Object({num, gen});
return 0;
}
@@ -2011,7 +2011,7 @@
if (i > 0 && i <= len) {
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1);
+ *((Object *) uout->d) = ((Object *) uin->d)->arrayGetNF(i - 1).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
@@ -2104,7 +2104,7 @@
if (((Object *) uin->d)->isDict()) {
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s);
+ *((Object *) uout->d) = ((Object *) uin->d)->dictLookupNF(s).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
@@ -2169,7 +2169,7 @@
if (i > 0 && i <= len) {
uout = new_Object_userdata(L);
uout->d = new Object();
- *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1);
+ *((Object *) uout->d) = ((Object *) uin->d)->dictGetValNF(i - 1).copy();
uout->atype = ALLOC_LEPDF;
uout->pc = uin->pc;
uout->pd = uin->pd;
--- texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w.orig 2019-03-22 19:17:32.861362965 +0000
+++ texlive-source/texk/web2c/luatexdir/image/pdftoepdf.w 2019-03-22 19:20:22.906973305 +0000
@@ -412,7 +412,7 @@
Object obj1;
pdf_begin_array(pdf);
for (i = 0, l = array->getLength(); i < l; ++i) {
- obj1 = array->getNF(i);
+ obj1 = array->getNF(i).copy();
copyObject(pdf, pdf_doc, &obj1);
}
pdf_end_array(pdf);
@@ -425,7 +425,7 @@
pdf_begin_dict(pdf);
for (i = 0, l = dict->getLength(); i < l; ++i) {
copyName(pdf, dict->getKey(i));
- obj1 = dict->getValNF(i);
+ obj1 = dict->getValNF(i).copy();
copyObject(pdf, pdf_doc, &obj1);
}
pdf_end_dict(pdf);
@@ -788,12 +788,12 @@
Now all relevant parts of the Page dictionary are copied. Metadata validity
check is needed(as a stream it must be indirect).
*/
- obj1 = pageDict->lookupNF("Metadata");
+ obj1 = pageDict->lookupNF("Metadata").copy();
if (!obj1.isNull() && !obj1.isRef())
formatted_warning("pdf inclusion","/Metadata must be indirect object");
/* copy selected items in Page dictionary */
for (i = 0; pagedictkeys[i] != NULL; i++) {
- obj1 = pageDict->lookupNF(pagedictkeys[i]);
+ obj1 = pageDict->lookupNF(pagedictkeys[i]).copy();
if (!obj1.isNull()) {
pdf_add_name(pdf, pagedictkeys[i]);
/* preserves indirection */
@@ -806,13 +806,13 @@
PDF file, climbing up the tree until the Resources are found.
(This fixes a problem with Scribus 1.3.3.14.)
*/
- obj1 = pageDict->lookupNF("Resources");
+ obj1 = pageDict->lookupNF("Resources").copy();
if (obj1.isNull()) {
op1 = &pagesobj1;
op2 = &pagesobj2;
*op1 = pageDict->lookup("Parent");
while (op1->isDict()) {
- obj1 = op1->dictLookupNF("Resources");
+ obj1 = op1->dictLookupNF("Resources").copy();
if (!obj1.isNull()) {
pdf_add_name(pdf, "Resources");
copyObject(pdf, pdf_doc, &obj1);

22
packages/texlive-bin/pdftoepdf-poppler0.72.0.cc → packages/texlive-bin/pdftoepdf-poppler0.75.0.cc

@ -22,7 +22,7 @@ This is based on the patch texlive-poppler-0.59.patch <2017-09-19> at
https://git.archlinux.org/svntogit/packages.git/plain/texlive-bin/trunk
by Arch Linux. A little modifications are made to avoid a crash for
some kind of pdf images, such as figure_missing.pdf in gnuplot.
The poppler should be 0.72.0 or newer versions.
The poppler should be 0.75.0 or newer versions.
POPPLER_VERSION should be defined.
*/
@ -292,7 +292,7 @@ static void copyDictEntry(Object * obj, int i)
Object obj1;
copyName((char *)obj->dictGetKey(i));
pdf_puts(" ");
obj1 = obj->dictGetValNF(i);
obj1 = obj->dictGetValNF(i).copy();
copyObject(&obj1);
pdf_puts("\n");
}
@ -351,7 +351,7 @@ static void copyProcSet(Object * obj)
obj->getTypeName());
pdf_puts("/ProcSet [ ");
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) {
procset = obj->arrayGetNF(i);
procset = obj->arrayGetNF(i).copy();
if (!procset.isName())
pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>",
procset.getTypeName());
@ -406,7 +406,7 @@ static void copyFont(char *tag, Object * fontRef)
if (fontdict.isDict()) {
subtype = fontdict.dictLookup("Subtype");
basefont = fontdict.dictLookup("BaseFont");
fontdescRef = fontdict.dictLookupNF("FontDescriptor");
fontdescRef = fontdict.dictLookupNF("FontDescriptor").copy();
if (fontdescRef.isRef()) {
fontdesc = fontdescRef.fetch(xref);
}
@ -452,7 +452,7 @@ static void copyFontResources(Object * obj)
obj->getTypeName());
pdf_puts("/Font << ");
for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
fontRef = obj->dictGetValNF(i);
fontRef = obj->dictGetValNF(i).copy();
if (fontRef.isRef())
copyFont((char *)obj->dictGetKey(i), &fontRef);
else if (fontRef.isDict()) { // some programs generate pdf with embedded font object
@ -595,7 +595,7 @@ static void copyObject(Object * obj)
} else if (obj->isArray()) {
pdf_puts("[");
for (i = 0, l = obj->arrayGetLength(); i < l; ++i) {
obj1 = obj->arrayGetNF(i);
obj1 = obj->arrayGetNF(i).copy();
if (!obj1.isName())
pdf_puts(" ");
copyObject(&obj1);
@ -865,7 +865,7 @@ void write_epdf(void)
pdf_printf("/%s.PageNumber %i\n", pdfkeyprefix, (int) epdf_selected_page);
}
if ((suppress_ptex_info & MASK_SUPPRESS_PTEX_INFODICT) == 0) {
info = pdf_doc->doc->getDocInfoNF();
info = pdf_doc->doc->getDocInfoNF().copy();
if (info.isRef()) {
// the info dict must be indirect (PDF Ref p. 61)
pdf_printf("/%s.InfoDict ", pdfkeyprefix);
@ -921,13 +921,13 @@ void write_epdf(void)
pdf_puts(stripzeros(s));
// Metadata validity check (as a stream it must be indirect)
dictObj = pageDict->lookupNF("Metadata");
dictObj = pageDict->lookupNF("Metadata").copy();
if (!dictObj.isNull() && !dictObj.isRef())
pdftex_warn("PDF inclusion: /Metadata must be indirect object");
// copy selected items in Page dictionary except Resources & Group
for (i = 0; pageDictKeys[i] != NULL; i++) {
dictObj = pageDict->lookupNF(pageDictKeys[i]);
dictObj = pageDict->lookupNF(pageDictKeys[i]).copy();
if (!dictObj.isNull()) {
pdf_newline();
pdf_printf("/%s ", pageDictKeys[i]);
@ -936,7 +936,7 @@ void write_epdf(void)
}
// handle page group
dictObj = pageDict->lookupNF("Group");
dictObj = pageDict->lookupNF("Group").copy();
if (!dictObj.isNull()) {
if (pdfpagegroupval == 0) {
// another pdf with page group was included earlier on the
@ -978,7 +978,7 @@ The changes below seem to work fine.
l = dic1.getLength();
for (i = 0; i < l; i++) {
groupDict.dictAdd((const char *)copyString(dic1.getKey(i)),
dic1.getValNF(i));
dic1.getValNF(i).copy());
}
// end modification
pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval);
Loading…
Cancel
Save