diff options
author | tnn <tnn@pkgsrc.org> | 2017-09-09 17:06:51 +0000 |
---|---|---|
committer | tnn <tnn@pkgsrc.org> | 2017-09-09 17:06:51 +0000 |
commit | 6c7958ff6656fbe0ec7fdae3a6fc0dd72259c086 (patch) | |
tree | 7bc357fd6c2dad44af995dc2b2a4048cccab189a /print/web2c | |
parent | bb7561ff3ef21029638ddba49f3a335d31954969 (diff) | |
download | pkgsrc-6c7958ff6656fbe0ec7fdae3a6fc0dd72259c086.tar.gz |
Switch to internal poppler due to reports of crashes from the last change.
Bump PKGREVISION.
Diffstat (limited to 'print/web2c')
-rw-r--r-- | print/web2c/Makefile | 18 | ||||
-rw-r--r-- | print/web2c/distinfo | 4 | ||||
-rw-r--r-- | print/web2c/patches/patch-pdftexdir_pdftoepdf.cc | 225 | ||||
-rw-r--r-- | print/web2c/patches/patch-pdftexdir_pdftosrc.cc | 102 |
4 files changed, 12 insertions, 337 deletions
diff --git a/print/web2c/Makefile b/print/web2c/Makefile index 1a0f06419ec..e589e0c491b 100644 --- a/print/web2c/Makefile +++ b/print/web2c/Makefile @@ -1,8 +1,8 @@ -# $NetBSD: Makefile,v 1.63 2017/09/06 16:49:47 wiz Exp $ +# $NetBSD: Makefile,v 1.64 2017/09/09 17:06:51 tnn Exp $ DISTNAME= texlive-20170524-source PKGNAME= web2c-2017 -PKGREVISION= 3 +PKGREVISION= 4 CATEGORIES= print MASTER_SITES= ftp://tug.org/historic/systems/texlive/2017/ EXTRACT_SUFX= .tar.xz @@ -15,6 +15,8 @@ DEPENDS+= kpathsea>=6.2.1:../../print/kpathsea DEPENDS+= ptexenc>=1.3.4:../../print/ptexenc EXTRACT_ELEMENTS= ${DISTNAME}/build-aux \ + ${DISTNAME}/libs/poppler \ + ${DISTNAME}/libs/xpdf \ ${DISTNAME}/texk/web2c GNU_CONFIGURE= yes @@ -45,15 +47,17 @@ CONFIGURE_ARGS+= --with-system-mpfr \ --with-mpfr-includes=${BUILDLINK_PREFIX.mpfr}/include \ --with-mpfr-libdir=${BUILDLINK_PREFIX.mpfr}/lib CONFIGURE_ARGS+= --with-system-pixman -CONFIGURE_ARGS+= --with-system-poppler +#CONFIGURE_ARGS+= --with-system-poppler +#CONFIGURE_ARGS+= --with-system-xpdf CONFIGURE_ARGS+= --with-system-ptexenc -CONFIGURE_ARGS+= --with-system-xpdf CONFIGURE_ARGS+= --with-system-zlib \ --with-zlib-includes=${BUILDLINK_PREFIX.zlib}/include \ --with-zlib-libdir=${BUILDLINK_PREFIX.zlib}/lib LIBTOOL_OVERRIDE= ../*/libtool */libtool -CONFIGURE_DIRS= ${WRKDIR}/${DISTNAME}/texk/web2c +CONFIGURE_DIRS= ${WRKDIR}/${DISTNAME}/texk/web2c +CONFIGURE_DIRS+= ${WRKDIR}/${DISTNAME}/libs/poppler +CONFIGURE_DIRS+= ${WRKDIR}/${DISTNAME}/libs/xpdf INSTALL_DIRS= ${WRKDIR}/${DISTNAME}/texk/web2c .include "../../devel/zlib/buildlink3.mk" @@ -61,8 +65,8 @@ INSTALL_DIRS= ${WRKDIR}/${DISTNAME}/texk/web2c .include "../../graphics/png/buildlink3.mk" .include "../../math/mpfr/buildlink3.mk" .include "../../print/kpathsea/buildlink3.mk" -.include "../../print/poppler/buildlink3.mk" -.include "../../print/poppler-includes/buildlink3.mk" +#.include "../../print/poppler/buildlink3.mk" +#.include "../../print/poppler-includes/buildlink3.mk" .include "../../print/ptexenc/buildlink3.mk" .include "../../x11/pixman/buildlink3.mk" .include "../../mk/bsd.pkg.mk" diff --git a/print/web2c/distinfo b/print/web2c/distinfo index 27dc1f8d0a4..1a16fd486d0 100644 --- a/print/web2c/distinfo +++ b/print/web2c/distinfo @@ -1,9 +1,7 @@ -$NetBSD: distinfo,v 1.22 2017/09/07 14:15:52 tnn Exp $ +$NetBSD: distinfo,v 1.23 2017/09/09 17:06:51 tnn Exp $ SHA1 (texlive-20170524-source.tar.xz) = 1c1383ddb1b871c6b8ce49a4ae3c1a33d454a7b6 RMD160 (texlive-20170524-source.tar.xz) = a8430c19fe1727cf308fe03e5838105260c0d71e SHA512 (texlive-20170524-source.tar.xz) = 18c18940992ab94ce22e22ccd4ad798253ea14ac2ab296a10ea5e9a8da9f33989f2e2641b42b564d1d5fb53bd371da3e68726b676d706b469016ad146cd19daa Size (texlive-20170524-source.tar.xz) = 63483372 bytes SHA1 (patch-am) = b7b81b1161a2117e756b25b80f9a676575267bdd -SHA1 (patch-pdftexdir_pdftoepdf.cc) = a9e138d9c286152150550af9f58279310039b114 -SHA1 (patch-pdftexdir_pdftosrc.cc) = 8eb487c63a6e31d0584f36ba411d97f7dfebaa82 diff --git a/print/web2c/patches/patch-pdftexdir_pdftoepdf.cc b/print/web2c/patches/patch-pdftexdir_pdftoepdf.cc deleted file mode 100644 index de62ea1cbc3..00000000000 --- a/print/web2c/patches/patch-pdftexdir_pdftoepdf.cc +++ /dev/null @@ -1,225 +0,0 @@ -$NetBSD: patch-pdftexdir_pdftoepdf.cc,v 1.1 2017/09/07 14:15:52 tnn Exp $ - -Try to adapt to new poppler-0.59 Object API. - ---- pdftexdir/pdftoepdf.cc.orig 2016-11-25 18:09:21.000000000 +0000 -+++ pdftexdir/pdftoepdf.cc -@@ -94,7 +94,6 @@ class PdfObject { - public: - PdfObject() { // nothing - } ~PdfObject() { -- iObject.free(); - } - Object *operator->() { - return &iObject; -@@ -217,10 +216,9 @@ static void delete_document(PdfDocument - - static void initDictFromDict(PdfObject & obj, Dict * dict) - { -- obj->initDict(xref); -+ obj.iObject = Object(objDict); - for (int i = 0, l = dict->getLength(); i < l; i++) { -- Object obj1; -- obj->dictAdd(copyString(dict->getKey(i)), dict->getValNF(i, &obj1)); -+ obj->dictAdd(copyString(dict->getKey(i)), dict->getValNF(i)); - } - } - -@@ -323,7 +321,7 @@ static void copyDictEntry(Object * obj, - PdfObject obj1; - copyName(obj->dictGetKey(i)); - pdf_puts(" "); -- obj->dictGetValNF(i, &obj1); -+ obj1.iObject = obj->dictGetValNF(i); - copyObject(&obj1); - pdf_puts("\n"); - } -@@ -382,7 +380,7 @@ static void copyProcSet(Object * obj) - obj->getTypeName()); - pdf_puts("/ProcSet [ "); - for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { -- obj->arrayGetNF(i, &procset); -+ procset.iObject = obj->arrayGetNF(i); - if (!procset->isName()) - pdftex_fail("PDF inclusion: invalid ProcSet entry type <%s>", - procset->getTypeName()); -@@ -413,25 +411,25 @@ static void copyFont(char *tag, Object * - } - // Only handle included Type1 (and Type1C) fonts; anything else will be copied. - // Type1C fonts are replaced by Type1 fonts, if REPLACE_TYPE1C is true. -- if (!fixedinclusioncopyfont && fontRef->fetch(xref, &fontdict)->isDict() -- && fontdict->dictLookup("Subtype", &subtype)->isName() -+ if (!fixedinclusioncopyfont && (fontdict.iObject = fontRef->fetch(xref), fontdict->isDict()) -+ && (subtype.iObject = fontdict->dictLookup("Subtype"), subtype->isName()) - && !strcmp(subtype->getName(), "Type1") -- && fontdict->dictLookup("BaseFont", &basefont)->isName() -- && fontdict->dictLookupNF("FontDescriptor", &fontdescRef)->isRef() -- && fontdescRef->fetch(xref, &fontdesc)->isDict() -- && (fontdesc->dictLookup("FontFile", &fontfile)->isStream() -+ && (basefont.iObject = fontdict->dictLookup("BaseFont"), basefont->isName()) -+ && (fontdescRef.iObject = fontdict->dictLookupNF("FontDescriptor"), fontdescRef->isRef()) -+ && (fontdesc.iObject = fontdescRef->fetch(xref), fontdesc->isDict()) -+ && ((fontfile.iObject = fontdesc->dictLookup("FontFile"), fontfile->isStream()) - || (REPLACE_TYPE1C -- && fontdesc->dictLookup("FontFile3", &fontfile)->isStream() -- && fontfile->streamGetDict()->lookup("Subtype", -- &ffsubtype)->isName() -+ && (fontfile.iObject = fontdesc->dictLookup("FontFile3"), fontfile->isStream()) -+ && (ffsubtype.iObject = fontfile->streamGetDict()->lookup("Subtype"), -+ ffsubtype->isName()) - && !strcmp(ffsubtype->getName(), "Type1C"))) - && (fontmap = lookup_fontmap(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. -- fontdesc->dictLookup("StemV", &stemV); -+ stemV.iObject = fontdesc->dictLookup("StemV"); - fd = epdf_create_fontdescriptor(fontmap, zround(stemV->getNum())); -- if (fontdesc->dictLookup("CharSet", &charset) && -+ if ((charset.iObject = fontdesc->dictLookup("CharSet"), !charset->isNull()) && - charset->isString() && is_subsetable(fontmap)) - epdf_mark_glyphs(fd, charset->getString()->getCString()); - else -@@ -458,7 +456,7 @@ static void copyFontResources(Object * o - obj->getTypeName()); - pdf_puts("/Font << "); - for (i = 0, l = obj->dictGetLength(); i < l; ++i) { -- obj->dictGetValNF(i, &fontRef); -+ fontRef.iObject = obj->dictGetValNF(i); - if (fontRef->isRef()) - copyFont(obj->dictGetKey(i), &fontRef); - else if (fontRef->isDict()) { // some programs generate pdf with embedded font object -@@ -601,7 +599,7 @@ static void copyObject(Object * obj) - } else if (obj->isArray()) { - pdf_puts("["); - for (i = 0, l = obj->arrayGetLength(); i < l; ++i) { -- obj->arrayGetNF(i, &obj1); -+ obj1.iObject = obj->arrayGetNF(i); - if (!obj1->isName()) - pdf_puts(" "); - copyObject(&obj1); -@@ -640,7 +638,7 @@ static void writeRefs() - if (!r->written) { - Object obj1; - r->written = 1; -- xref->fetch(r->ref.num, r->ref.gen, &obj1); -+ obj1 = xref->fetch(r->ref.num, r->ref.gen); - if (r->type == objFont) { - assert(!obj1.isStream()); - pdfbeginobj(r->num, 2); // \pdfobjcompresslevel = 2 is for this -@@ -656,7 +654,7 @@ static void writeRefs() - pdf_puts("\n"); - pdfendobj(); - } -- obj1.free(); -+ obj1.setToNull(); - } - } - } -@@ -867,7 +865,7 @@ void write_epdf(void) - encodingList = 0; - page = pdf_doc->doc->getCatalog()->getPage(epdf_selected_page); - pageRef = pdf_doc->doc->getCatalog()->getPageRef(epdf_selected_page); -- xref->fetch(pageRef->num, pageRef->gen, &pageObj); -+ pageObj.iObject = xref->fetch(pageRef->num, pageRef->gen); - pageDict = pageObj->getDict(); - rotate = page->getRotate(); - PDFRectangle *pagebox; -@@ -886,7 +884,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) { -- pdf_doc->doc->getDocInfoNF(&info); -+ info = pdf_doc->doc->getDocInfoNF(); - if (info.isRef()) { - // the info dict must be indirect (PDF Ref p. 61) - pdf_printf("/%s.InfoDict ", pdfkeyprefix); -@@ -942,13 +940,13 @@ void write_epdf(void) - pdf_puts(stripzeros(s)); - - // Metadata validity check (as a stream it must be indirect) -- pageDict->lookupNF("Metadata", &dictObj); -+ dictObj.iObject = pageDict->lookupNF("Metadata"); - 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++) { -- pageDict->lookupNF(pageDictKeys[i], &dictObj); -+ dictObj.iObject = pageDict->lookupNF(pageDictKeys[i]); - if (!dictObj->isNull()) { - pdf_newline(); - pdf_printf("/%s ", pageDictKeys[i]); -@@ -957,7 +955,7 @@ void write_epdf(void) - } - - // handle page group -- pageDict->lookupNF("Group", &dictObj); -+ dictObj.iObject = pageDict->lookupNF("Group"); - if (!dictObj->isNull()) { - if (pdfpagegroupval == 0) { - // another pdf with page group was included earlier on the -@@ -972,7 +970,7 @@ void write_epdf(void) - copyObject(&dictObj); - } else { - // write Group dict as a separate object, since the Page dict also refers to it -- pageDict->lookup("Group", &dictObj); -+ dictObj.iObject = pageDict->lookup("Group"); - if (!dictObj->isDict()) - pdftex_fail("PDF inclusion: /Group dict missing"); - writeSepGroup = true; -@@ -996,7 +994,7 @@ void write_epdf(void) - pdf_newline(); - pdf_puts("/Resources <<\n"); - for (i = 0, l = obj1->dictGetLength(); i < l; ++i) { -- obj1->dictGetVal(i, &obj2); -+ obj2.iObject = obj1->dictGetVal(i); - key = obj1->dictGetKey(i); - if (strcmp("Font", key) == 0) - copyFontResources(&obj2); -@@ -1009,7 +1007,7 @@ void write_epdf(void) - } - - // write the page contents -- page->getContents(&contents); -+ contents.iObject = page->getContents(); - if (contents->isStream()) { - - // Variant A: get stream and recompress under control -@@ -1021,21 +1019,21 @@ void write_epdf(void) - - // Variant B: copy stream without recompressing - // -- contents->streamGetDict()->lookup("F", &obj1); -+ obj1.iObject = contents->streamGetDict()->lookup("F"); - if (!obj1->isNull()) { - pdftex_fail("PDF inclusion: Unsupported external stream"); - } -- contents->streamGetDict()->lookup("Length", &obj1); -+ obj1.iObject = contents->streamGetDict()->lookup("Length"); - assert(!obj1->isNull()); - pdf_puts("/Length "); - copyObject(&obj1); - pdf_puts("\n"); -- contents->streamGetDict()->lookup("Filter", &obj1); -+ obj1.iObject = contents->streamGetDict()->lookup("Filter"); - if (!obj1->isNull()) { - pdf_puts("/Filter "); - copyObject(&obj1); - pdf_puts("\n"); -- contents->streamGetDict()->lookup("DecodeParms", &obj1); -+ obj1.iObject = contents->streamGetDict()->lookup("DecodeParms"); - if (!obj1->isNull()) { - pdf_puts("/DecodeParms "); - copyObject(&obj1); -@@ -1048,9 +1046,7 @@ void write_epdf(void) - } else if (contents->isArray()) { - pdfbeginstream(); - for (i = 0, l = contents->arrayGetLength(); i < l; ++i) { -- Object contentsobj; -- copyStream((contents->arrayGet(i, &contentsobj))->getStream()); -- contentsobj.free(); -+ copyStream((contents->arrayGet(i)).getStream()); - if (i < l - 1) - pdf_newline(); // add a newline after each stream except the last - } diff --git a/print/web2c/patches/patch-pdftexdir_pdftosrc.cc b/print/web2c/patches/patch-pdftexdir_pdftosrc.cc deleted file mode 100644 index 0f82c342ab3..00000000000 --- a/print/web2c/patches/patch-pdftexdir_pdftosrc.cc +++ /dev/null @@ -1,102 +0,0 @@ -$NetBSD: patch-pdftexdir_pdftosrc.cc,v 1.1 2017/09/07 14:15:52 tnn Exp $ - -Try to adapt to new poppler-0.59 Object API. - ---- pdftexdir/pdftosrc.cc.orig 2016-11-25 18:09:21.000000000 +0000 -+++ pdftexdir/pdftosrc.cc -@@ -86,22 +86,22 @@ int main(int argc, char *argv[]) - objgen = atoi(argv[3]); - } - xref = doc->getXRef(); -- catalogDict.initNull(); -- xref->getCatalog(&catalogDict); -+ catalogDict.setToNull(); -+ catalogDict = xref->getCatalog(); - if (!catalogDict.isDict("Catalog")) { - fprintf(stderr, "No Catalog found\n"); - exit(1); - } -- srcStream.initNull(); -+ srcStream.setToNull(); - if (objnum == 0) { -- catalogDict.dictLookup("SourceObject", &srcStream); -+ srcStream = catalogDict.dictLookup("SourceObject"); - static char const_SourceFile[] = "SourceFile"; - if (!srcStream.isStream(const_SourceFile)) { - fprintf(stderr, "No SourceObject found\n"); - exit(1); - } -- srcName.initNull(); -- srcStream.getStream()->getDict()->lookup("SourceName", &srcName); -+ srcName.setToNull(); -+ srcName = srcStream.getStream()->getDict()->lookup("SourceName"); - if (!srcName.isString()) { - fprintf(stderr, "No SourceName found\n"); - exit(1); -@@ -110,7 +110,7 @@ int main(int argc, char *argv[]) - // We cannot free srcName, as objname shares its string. - // srcName.free(); - } else if (objnum > 0) { -- xref->fetch(objnum, objgen, &srcStream); -+ srcStream = xref->fetch(objnum, objgen); - if (!srcStream.isStream()) { - fprintf(stderr, "Not a Stream object\n"); - exit(1); -@@ -159,29 +159,27 @@ int main(int argc, char *argv[]) - int localOffset = 0; - Guint firstOffset; - -- assert(xref->fetch(e->offset, 0, &objStr)->isStream()); -- nObjects = objStr.streamGetDict()->lookup("N", &obj1)->getInt(); -- obj1.free(); -- first = objStr.streamGetDict()->lookup("First", &obj1)->getInt(); -- obj1.free(); -+ assert(xref->fetch(e->offset, 0).isStream()); -+ nObjects = objStr.streamGetDict()->lookup("N").getInt(); -+ first = objStr.streamGetDict()->lookup("First").getInt(); - firstOffset = objStr.getStream()->getBaseStream()->getStart() + first; - - // parse the header: object numbers and offsets - objStr.streamReset(); -- obj1.initNull(); -- str = new EmbedStream(objStr.getStream(), &obj1, gTrue, first); -+ obj1.setToNull(); -+ str = new EmbedStream(objStr.getStream(), Object(objNull), gTrue, first); - parser = new Parser(xref, new Lexer(xref, str), gFalse); - for (n = 0; n < nObjects; ++n) { -- parser->getObj(&obj1); -- parser->getObj(&obj2); -+ obj1 = parser->getObj(); -+ obj2 = parser->getObj(); - if (n == e->gen) - localOffset = obj2.getInt(); -- obj1.free(); -- obj2.free(); -+ obj1.setToNull(); -+ obj2.setToNull(); - } - while (str->getChar() != EOF) ; - delete parser; -- objStr.free(); -+ objStr.setToNull(); - - fprintf(outfile, "%.10lu 00000 n\n", - (long unsigned)(firstOffset + localOffset)); -@@ -192,7 +190,7 @@ int main(int argc, char *argv[]) - s->reset(); - while ((c = s->getChar()) != EOF) - fputc(c, outfile); -- srcStream.free(); -+ srcStream.setToNull(); - } - if (objnum == 0) - fprintf(stderr, "Source file extracted to %s\n", outname); -@@ -201,7 +199,7 @@ int main(int argc, char *argv[]) - else - fprintf(stderr, "Cross-reference table extracted to %s\n", outname); - fclose(outfile); -- catalogDict.free(); -+ catalogDict.setToNull(); - delete doc; - delete globalParams; - } |