diff options
author | ryoon <ryoon@pkgsrc.org> | 2018-12-04 13:00:41 +0000 |
---|---|---|
committer | ryoon <ryoon@pkgsrc.org> | 2018-12-04 13:00:41 +0000 |
commit | 1301a1c309e2cd449288c78f9aa65e5fde49fe3c (patch) | |
tree | 20f34e94d754e62b91c673d51c9806d98c998879 /print/web2c/patches | |
parent | e67b9cdd71a02d43226ea50a89e717f59be85ab2 (diff) | |
download | pkgsrc-1301a1c309e2cd449288c78f9aa65e5fde49fe3c.tar.gz |
FIx build with poppler-0.71
Diffstat (limited to 'print/web2c/patches')
4 files changed, 145 insertions, 6 deletions
diff --git a/print/web2c/patches/patch-pdftexdir_pdftex-common.h b/print/web2c/patches/patch-pdftexdir_pdftex-common.h new file mode 100644 index 00000000000..8da5d218588 --- /dev/null +++ b/print/web2c/patches/patch-pdftexdir_pdftex-common.h @@ -0,0 +1,13 @@ +$NetBSD: patch-pdftexdir_pdftex-common.h,v 1.1 2018/12/04 13:01:44 ryoon Exp $ + +--- pdftexdir/pdftex-common.h.orig 2016-11-25 18:24:37.000000000 +0000 ++++ 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/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc b/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc index 1a76ac2bd1b..f7107ae9b7a 100644 --- a/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc +++ b/print/web2c/patches/patch-pdftexdir_pdftoepdf-newpoppler.cc @@ -1,9 +1,16 @@ -$NetBSD: patch-pdftexdir_pdftoepdf-newpoppler.cc,v 1.1 2018/05/13 13:01:02 markd Exp $ - -Build with poppler 0.64 +$NetBSD: patch-pdftexdir_pdftoepdf-newpoppler.cc,v 1.2 2018/12/04 13:01:44 ryoon Exp $ --- pdftexdir/pdftoepdf-newpoppler.cc.orig 2018-04-04 04:08:11.000000000 +0000 +++ pdftexdir/pdftoepdf-newpoppler.cc +@@ -120,7 +120,7 @@ struct UsedEncoding { + + static InObj *inObjList; + static UsedEncoding *encodingList; +-static GBool isInit = gFalse; ++static bool isInit = false; + + // -------------------------------------------------------------------- + // Maintain list of open embedded PDF files @@ -275,7 +275,7 @@ static int getNewObjectNumber(Ref ref) static void copyObject(Object *); @@ -13,6 +20,24 @@ Build with poppler 0.64 { pdf_puts("/"); for (; *s != 0; s++) { +@@ -310,7 +310,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()); +@@ -382,7 +382,7 @@ static bool embeddableFont(Object * font + 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; @@ -418,7 +418,7 @@ static void copyFont(char *tag, Object * && fontdescRef.isRef() && fontdesc.isDict() @@ -31,6 +56,15 @@ Build with poppler 0.64 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; @@ -42,3 +76,72 @@ Build with poppler 0.64 if (obj->isBool()) { pdf_printf("%s", obj->getBool()? "true" : "false"); } else if (obj->isInt()) { +@@ -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() + // get the pagebox according to the pagebox_spec + static 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 + // 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); +@@ -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. + } + 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)); + } + // end modification diff --git a/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc b/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc index 3b026f7c4c6..ee012b12305 100644 --- a/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc +++ b/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc @@ -1,6 +1,4 @@ -$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.1 2018/05/13 13:01:02 markd Exp $ - -Build with poppler 0.64 +$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.2 2018/12/04 13:01:44 ryoon Exp $ --- pdftexdir/pdftosrc-newpoppler.cc.orig 2017-10-17 21:52:13.000000000 +0000 +++ pdftexdir/pdftosrc-newpoppler.cc @@ -13,3 +11,15 @@ Build with poppler 0.64 int objnum = 0, objgen = 0; bool extract_xref_table = false; int c; +@@ -173,9 +173,9 @@ 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); +- parser = new Parser(xref, lexer, gFalse); ++ parser = new Parser(xref, lexer, false); + for (n = 0; n < nObjects; ++n) { + obj1 = parser->getObj(); + obj2 = parser->getObj(); diff --git a/print/web2c/patches/patch-pdftexdir_writeenc.c b/print/web2c/patches/patch-pdftexdir_writeenc.c new file mode 100644 index 00000000000..f80374b9500 --- /dev/null +++ b/print/web2c/patches/patch-pdftexdir_writeenc.c @@ -0,0 +1,13 @@ +$NetBSD: patch-pdftexdir_writeenc.c,v 1.1 2018/12/04 13:01:44 ryoon Exp $ + +--- pdftexdir/writeenc.c.orig 2016-11-25 18:24:37.000000000 +0000 ++++ 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); |