pkgsrc-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: pkgsrc/print/web2c



Module Name:    pkgsrc
Committed By:   ryoon
Date:           Fri May 10 19:19:09 UTC 2019

Modified Files:
        pkgsrc/print/web2c: distinfo
        pkgsrc/print/web2c/patches: patch-pdftexdir_pdftoepdf-newpoppler.cc
            patch-pdftexdir_pdftosrc-newpoppler.cc

Log Message:
Fix build with print/poppler-0.76.1

Use a patch from upstream and mine.


To generate a diff of this commit:
cvs rdiff -u -r1.32 -r1.33 pkgsrc/print/web2c/distinfo
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc \
    pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/print/web2c/distinfo
diff -u pkgsrc/print/web2c/distinfo:1.32 pkgsrc/print/web2c/distinfo:1.33
--- pkgsrc/print/web2c/distinfo:1.32    Thu Feb 28 19:34:49 2019
+++ pkgsrc/print/web2c/distinfo Fri May 10 19:19:09 2019
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.32 2019/02/28 19:34:49 markd Exp $
+$NetBSD: distinfo,v 1.33 2019/05/10 19:19:09 ryoon Exp $
 
 SHA1 (texlive-20180414-source.tar.xz) = 81bdd9999b6ab860d1d3c388cf27062aba960255
 RMD160 (texlive-20180414-source.tar.xz) = 0ff63bbd7f8a0fb6417089f5d1ae1e4124a1dd95
@@ -7,7 +7,7 @@ Size (texlive-20180414-source.tar.xz) = 
 SHA1 (patch-Makefile.in) = 28e7ad00f3796b49f92c5cc3eb3c94bdf38b1364
 SHA1 (patch-am) = b7b81b1161a2117e756b25b80f9a676575267bdd
 SHA1 (patch-pdftexdir_pdftex-common.h) = 59f32828de5dd032307467d83e43f21382a39330
-SHA1 (patch-pdftexdir_pdftoepdf-newpoppler.cc) = 5e49877943211d068f7daff190351e13a1b059d3
-SHA1 (patch-pdftexdir_pdftosrc-newpoppler.cc) = 497c4d87ae6882e1488b9e440e011680e7a46f62
+SHA1 (patch-pdftexdir_pdftoepdf-newpoppler.cc) = aff81fbdeb0cfee1f52d98e53507a227ac899ba6
+SHA1 (patch-pdftexdir_pdftosrc-newpoppler.cc) = 91b94d9f77edd349c9b0bd1a5c20c190f1a3e5c1
 SHA1 (patch-pdftexdir_writeenc.c) = daf41fec97d3d3e46063d8cf4c559d96e1ec69bf
 SHA1 (patch-pdftexdir_writet1.c) = 7d00d5d5d3f884bc1f9946cb3fbcaa7f224df9de

Index: pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc
diff -u pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc:1.4 pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc:1.5
--- pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc:1.4      Thu Feb 28 19:34:50 2019
+++ pkgsrc/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc  Fri May 10 19:19:09 2019
@@ -1,7 +1,16 @@
-$NetBSD: patch-pdftexdir_pdftoepdf-newpoppler.cc,v 1.4 2019/02/28 19:34:50 markd Exp $
+$NetBSD: patch-pdftexdir_pdftoepdf-newpoppler.cc,v 1.5 2019/05/10 19:19:09 ryoon Exp $
 
 --- pdftexdir/pdftoepdf-newpoppler.cc.orig     2018-04-04 04:08:11.000000000 +0000
 +++ pdftexdir/pdftoepdf-newpoppler.cc
+@@ -22,7 +22,7 @@ This is based on the patch texlive-poppl
+ 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.59.0 or newer versions.
++The poppler should be 0.76.0 or newer versions.
+ POPPLER_VERSION should be defined.
+ */
+ 
 @@ -120,7 +120,7 @@ struct UsedEncoding {
  
  static InObj *inObjList;
@@ -11,33 +20,50 @@ $NetBSD: patch-pdftexdir_pdftoepdf-newpo
  
  // --------------------------------------------------------------------
  // Maintain list of open embedded PDF files
-@@ -275,7 +275,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++) {
-@@ -310,7 +310,7 @@ static void copyDict(Object * obj)
- static void copyFontDict(Object * obj, InObj * r)
+@@ -290,9 +290,9 @@ static void copyName(char *s)
+ static void copyDictEntry(Object * obj, int i)
  {
-     int i, l;
--    char *key;
-+    const char *key;
-     if (!obj->isDict())
-         pdftex_fail("PDF inclusion: invalid dict type <%s>",
-                     obj->getTypeName());
-@@ -382,7 +382,7 @@ static bool embeddableFont(Object * font
-     return false;
+     Object obj1;
+-    copyName(obj->dictGetKey(i));
++    copyName((char *)obj->dictGetKey(i));
+     pdf_puts(" ");
+-    obj1 = obj->dictGetValNF(i);
++    obj1 = obj->dictGetValNF(i).copy();
+     copyObject(&obj1);
+     pdf_puts("\n");
  }
- 
--static void copyFont(char *tag, Object * fontRef)
-+static void copyFont(const char *tag, Object * fontRef)
- {
-     Object fontdict, subtype, basefont, fontdescRef, fontdesc, charset,
-         stemV;
+@@ -317,7 +317,7 @@ static void copyFontDict(Object * obj, I
+     pdf_puts("<<\n");
+     assert(r->type == objFont); // FontDescriptor is in fd_tree
+     for (i = 0, l = obj->dictGetLength(); i < l; ++i) {
+-        key = obj->dictGetKey(i);
++        key = (char *)obj->dictGetKey(i);
+         if (strncmp("FontDescriptor", key, strlen("FontDescriptor")) == 0
+             || strncmp("BaseFont", key, strlen("BaseFont")) == 0
+             || strncmp("Encoding", key, strlen("Encoding")) == 0)
+@@ -351,11 +351,11 @@ 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());
+-        copyName(procset.getName());
++        copyName((char *)procset.getName());
+         pdf_puts(" ");
+     }
+     pdf_puts("]\n");
+@@ -406,7 +406,7 @@ static void copyFont(char *tag, Object *
+     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);
+         }
 @@ -418,7 +418,7 @@ static void copyFont(char *tag, Object *
          && fontdescRef.isRef()
          && fontdesc.isDict()
@@ -56,76 +82,82 @@ $NetBSD: patch-pdftexdir_pdftoepdf-newpo
          else
              embed_whole_font(fd);
          addFontDesc(fontdescRef.getRef(), fd);
-@@ -467,7 +467,7 @@ static void copyFontResources(Object * o
-     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),
- 
-@@ -554,8 +554,8 @@ static void copyObject(Object * obj)
-     Object obj1;
-     int i, l, c;
-     Ref ref;
--    char *p;
--    GString *s;
-+    const char *p;
-+    const GString *s;
-     if (obj->isBool()) {
-         pdf_printf("%s", obj->getBool()? "true" : "false");
-     } else if (obj->isInt()) {
-@@ -566,7 +566,7 @@ static void copyObject(Object * obj)
+@@ -452,11 +452,11 @@ static void copyFontResources(Object * o
+                     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(obj->dictGetKey(i), &fontRef);
++            copyFont((char *)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);
+         }
+@@ -565,8 +565,8 @@ static void copyObject(Object * obj)
+     } else if (obj->isNum()) {
          pdf_printf("%s", convertNumToPDF(obj->getNum()));
      } else if (obj->isString()) {
-         s = obj->getString();
+-        s = obj->getString();
 -        p = s->getCString();
-+        p = s->c_str();
++        s = (GooString *)obj->getString();
++        p = (char *)s->c_str();
          l = s->getLength();
          if (strlen(p) == (unsigned int) l) {
              pdf_puts("(");
-@@ -655,7 +655,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++) {
-@@ -685,20 +685,24 @@ static void writeEncodings()
+@@ -589,13 +589,13 @@ static void copyObject(Object * obj)
+             pdf_puts(">");
+         }
+     } else if (obj->isName()) {
+-        copyName(obj->getName());
++        copyName((char *)obj->getName());
+     } else if (obj->isNull()) {
+         pdf_puts("null");
+     } 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);
+@@ -664,12 +664,12 @@ static void writeEncodings()
+                     ("PDF inclusion: CID fonts are not supported"
+                      " (try to disable font replacement to fix this)");
+             }
+-            if ((s = ((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
++            if ((s = (char *)((Gfx8BitFont *) r->font)->getCharName(i)) != 0)
+                 glyphNames[i] = s;
+             else
+                 glyphNames[i] = notdef;
+         }
+-        epdf_write_enc(glyphNames, r->enc_objnum);
++        epdf_write_enc(const_cast<const char**>(glyphNames), r->enc_objnum);
+     }
+     for (r = encodingList; r != 0; r = n) {
+         n = r->next;
+@@ -683,7 +683,7 @@ static void writeEncodings()
+ }
+ 
  // get the pagebox according to the pagebox_spec
- static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
+-static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
++static const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
  {
-+    const PDFRectangle *ret;
-+
      if (pagebox_spec == pdfboxspecmedia)
--        return page->getMediaBox();
-+        ret = page->getMediaBox();
-     else if (pagebox_spec == pdfboxspeccrop)
--        return page->getCropBox();
-+        ret = page->getCropBox();
-     else if (pagebox_spec == pdfboxspecbleed)
--        return page->getBleedBox();
-+        ret = page->getBleedBox();
-     else if (pagebox_spec == pdfboxspectrim)
--        return page->getTrimBox();
-+        ret = page->getTrimBox();
-     else if (pagebox_spec == pdfboxspecart)
--        return page->getArtBox();
-+        ret = page->getArtBox();
-     else
-         pdftex_fail("PDF inclusion: unknown value of pagebox spec (%i)",
-                     (int) pagebox_spec);
--    return page->getMediaBox(); // to make the compiler happy
-+    // ret = page->getMediaBox(); // to make the compiler happy
-+
-+    return const_cast<PDFRectangle*>(ret);
- }
- 
- 
-@@ -724,8 +728,8 @@ read_pdf_info(char *image_name, char *pa
+         return page->getMediaBox();
+@@ -715,7 +715,7 @@ read_pdf_info(char *image_name, char *pa
+ {
+     PdfDocument *pdf_doc;
+     Page *page;
+-    PDFRectangle *pagebox;
++    const PDFRectangle *pagebox;
+ #ifdef POPPLER_VERSION
+     int pdf_major_version_found, pdf_minor_version_found;
+ #else
+@@ -724,8 +724,8 @@ read_pdf_info(char *image_name, char *pa
      // initialize
      if (!isInit) {
          globalParams = new GlobalParams();
@@ -136,21 +168,82 @@ $NetBSD: patch-pdftexdir_pdftoepdf-newpo
      }
      // open PDF file
      pdf_doc = find_add_document(image_name);
-@@ -822,7 +826,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;
-@@ -977,7 +981,7 @@ The changes below seem to work fine. 
+@@ -761,7 +761,7 @@ read_pdf_info(char *image_name, char *pa
+         if (link == 0 || !link->isOk())
+             pdftex_fail("PDF inclusion: invalid destination <%s>", page_name);
+         Ref ref = link->getPageRef();
+-        page_num = pdf_doc->doc->getCatalog()->findPage(ref.num, ref.gen);
++        page_num = pdf_doc->doc->getCatalog()->findPage(ref);
+         if (page_num == 0)
+             pdftex_fail("PDF inclusion: destination is not a page <%s>",
+                         page_name);
+@@ -849,7 +849,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");
+@@ -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
+@@ -977,8 +977,8 @@ The changes below seem to work fine. 
              }
              l = dic1.getLength();
              for (i = 0; i < l; i++) {
 -                groupDict.dictAdd(copyString(dic1.getKey(i)),
-+                groupDict.dictAdd(const_cast<const char *>(copyString(dic1.getKey(i))),
-                                   dic1.getValNF(i));
+-                                  dic1.getValNF(i));
++                groupDict.dictAdd((const char *)copyString(dic1.getKey(i)),
++                                  dic1.getValNF(i).copy());
              }
  // end modification
+             pdf_printf("/Group %ld 0 R\n", (long)pdfpagegroupval);
+@@ -1001,13 +1001,13 @@ The changes below seem to work fine. 
+         pdf_puts("/Resources <<\n");
+         for (i = 0, l = obj1->dictGetLength(); i < l; ++i) {
+             obj2 = obj1->dictGetVal(i);
+-            key = obj1->dictGetKey(i);
++            key = (char *)obj1->dictGetKey(i);
+             if (strcmp("Font", key) == 0)
+                 copyFontResources(&obj2);
+             else if (strcmp("ProcSet", key) == 0)
+                 copyProcSet(&obj2);
+             else
+-                copyOtherResources(&obj2, key);
++                copyOtherResources(&obj2, (char *)key);
+         }
+         pdf_puts(">>\n");
+     }
Index: pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc
diff -u pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc:1.4 pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc:1.5
--- pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc:1.4       Sun Feb 17 11:44:38 2019
+++ pkgsrc/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc   Fri May 10 19:19:09 2019
@@ -1,22 +1,22 @@
-$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.4 2019/02/17 11:44:38 tnn Exp $
+$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.5 2019/05/10 19:19:09 ryoon Exp $
 
 --- pdftexdir/pdftosrc-newpoppler.cc.orig      2017-10-17 21:52:13.000000000 +0000
 +++ pdftexdir/pdftosrc-newpoppler.cc
-@@ -68,7 +68,7 @@ int main(int argc, char *argv[])
-     Stream *s;
-     Object srcStream, srcName, catalogDict;
-     FILE *outfile;
--    char *outname;
-+    const char *outname;
-     int objnum = 0, objgen = 0;
-     bool extract_xref_table = false;
-     int c;
+@@ -20,7 +20,7 @@ with this program.  If not, see <http://
+ /*
+ 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. The poppler should be 0.59.0 or newer versions.
++by Arch Linux. The poppler should be 0.76.0 or newer versions.
+ POPPLER_VERSION should be defined.
+ */
+ 
 @@ -109,7 +109,7 @@ int main(int argc, char *argv[])
              fprintf(stderr, "No SourceName found\n");
              exit(1);
          }
 -        outname = srcName.getString()->getCString();
-+        outname = srcName.getString()->c_str();
++        outname = (char *)srcName.getString()->c_str();
          // We cannot free srcName, as objname shares its string.
          // srcName.free();
      } else if (objnum > 0) {
@@ -47,15 +47,15 @@ $NetBSD: patch-pdftexdir_pdftosrc-newpop
  
                  objStr = xref->fetch(e->offset, 0);
                  assert(objStr.isStream());
-@@ -173,9 +173,9 @@ int main(int argc, char *argv[])
+@@ -173,9 +173,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);
-+                str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);
-                 lexer = new Lexer(xref, str);
+-                lexer = new Lexer(xref, str);
 -                parser = new Parser(xref, lexer, gFalse);
-+                parser = new Parser(xref, lexer, false);
++                str = new EmbedStream(objStr.getStream(), Object(objNull), true, first);
++                parser = new Parser(xref, str, false);
                  for (n = 0; n < nObjects; ++n) {
                      obj1 = parser->getObj();
                      obj2 = parser->getObj();



Home | Main Index | Thread Index | Old Index