pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/print/web2c web2c: Fix build with poppler-0.84.0
details: https://anonhg.NetBSD.org/pkgsrc/rev/dad613d1d9a6
branches: trunk
changeset: 421029:dad613d1d9a6
user: ryoon <ryoon%pkgsrc.org@localhost>
date: Sat Jan 11 00:31:05 2020 +0000
description:
web2c: Fix build with poppler-0.84.0
diffstat:
print/web2c/Makefile | 6 +-
print/web2c/distinfo | 7 +-
print/web2c/patches/patch-pdftexdir_pdftoepdf-poppler0.75.0.cc | 161 +++------
print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc | 60 ++-
print/web2c/patches/patch-pdftexdir_utils.c | 14 +
5 files changed, 127 insertions(+), 121 deletions(-)
diffs (truncated from 339 to 300 lines):
diff -r 4e9ec0a896a3 -r dad613d1d9a6 print/web2c/Makefile
--- a/print/web2c/Makefile Fri Jan 10 23:28:56 2020 +0000
+++ b/print/web2c/Makefile Sat Jan 11 00:31:05 2020 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.90 2019/11/07 12:38:08 wiz Exp $
+# $NetBSD: Makefile,v 1.91 2020/01/11 00:31:05 ryoon Exp $
PKGREVISION= 3
.include "../../print/texlive/Makefile.common"
@@ -14,7 +14,7 @@
EXTRACT_ELEMENTS+= ${DISTNAME}/texk/web2c
-USE_LANGUAGES= c c++11
+USE_LANGUAGES= c c++14
USE_TOOLS+= gmake lex yacc
GNU_CONFIGURE_STRICT= no # texk/web2c/web2c doesn't know the options
PKGCONFIG_OVERRIDE= synctexdir/synctex.pc.in
@@ -22,6 +22,8 @@
INFO_FILES= yes
WRKSRC= ${WRKDIR}/${DISTNAME}/texk/web2c
+#CXXFLAGS+= -fpermissive
+
CONFIGURE_ARGS+= --disable-luatex
CONFIGURE_ARGS+= --disable-luatex53
CONFIGURE_ARGS+= --disable-luajittex
diff -r 4e9ec0a896a3 -r dad613d1d9a6 print/web2c/distinfo
--- a/print/web2c/distinfo Fri Jan 10 23:28:56 2020 +0000
+++ b/print/web2c/distinfo Sat Jan 11 00:31:05 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.34 2019/05/14 13:23:10 adam Exp $
+$NetBSD: distinfo,v 1.35 2020/01/11 00:31:05 ryoon Exp $
SHA1 (texlive-20190410-source.tar.xz) = d700878d3e19b6ad1313791dd5cef4bf0acfd675
RMD160 (texlive-20190410-source.tar.xz) = a0cbe56b19b1f3d064315c37f8b5a4b04f82678b
@@ -7,6 +7,7 @@
SHA1 (patch-Makefile.in) = ec3cc8f935d7365c90aabcd68be431eb706d970e
SHA1 (patch-man_Makefile.in) = 8d0cbcd73f113135ea400c0491a4c0cbd0b07c73
SHA1 (patch-pdftexdir_pdftex-common.h) = 0f82056b5431c0a4718ab8609967f2ec9aeca3a9
-SHA1 (patch-pdftexdir_pdftoepdf-poppler0.75.0.cc) = fed92e4cc1fa8086eb70dd44726371e1df64f79f
-SHA1 (patch-pdftexdir_pdftosrc-newpoppler.cc) = ce79bc0fc98756493adb1b57724ccb7f7b2821aa
+SHA1 (patch-pdftexdir_pdftoepdf-poppler0.75.0.cc) = ac5c44afe5eacd6e7b955ba7acb335f10249d0c3
+SHA1 (patch-pdftexdir_pdftosrc-newpoppler.cc) = ff18cc9bcb0dc665f7981bf06fba753e67117269
+SHA1 (patch-pdftexdir_utils.c) = 989dc2fe8097d4d31ee2ba03885f00da0f1ab39b
SHA1 (patch-pdftexdir_writeenc.c) = d2dfedf140c2c2c9143bc701291c09d3a8d3f3a4
diff -r 4e9ec0a896a3 -r dad613d1d9a6 print/web2c/patches/patch-pdftexdir_pdftoepdf-poppler0.75.0.cc
--- a/print/web2c/patches/patch-pdftexdir_pdftoepdf-poppler0.75.0.cc Fri Jan 10 23:28:56 2020 +0000
+++ b/print/web2c/patches/patch-pdftexdir_pdftoepdf-poppler0.75.0.cc Sat Jan 11 00:31:05 2020 +0000
@@ -1,97 +1,65 @@
-$NetBSD: patch-pdftexdir_pdftoepdf-poppler0.75.0.cc,v 1.1 2019/05/14 13:23:10 adam Exp $
-
-Fix building.
+$NetBSD: patch-pdftexdir_pdftoepdf-poppler0.75.0.cc,v 1.2 2020/01/11 00:31:05 ryoon Exp $
--- pdftexdir/pdftoepdf-poppler0.75.0.cc.orig 2019-03-21 06:38:16.000000000 +0000
+++ pdftexdir/pdftoepdf-poppler0.75.0.cc
-@@ -275,7 +275,7 @@ static int getNewObjectNumber(Ref ref)
-
- static void copyObject(Object *);
+@@ -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.75.0 or newer versions.
++The poppler should be 0.83.0 or newer versions.
+ POPPLER_VERSION should be defined.
+ */
--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)
- {
- 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;
-@@ -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),
+@@ -669,7 +669,7 @@ static void writeEncodings()
+ 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;
+@@ -710,7 +710,7 @@ static const PDFRectangle *get_pagebox(P
-@@ -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()) {
-@@ -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 const PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
+ int
+ read_pdf_info(char *image_name, char *page_name, int page_num,
+- int pagebox_spec, int minor_pdf_version_wanted,
++ int pagebox_spec, /* int major_pdf_version_wanted, */ int minor_pdf_version_wanted,
+ int pdf_inclusion_errorlevel)
{
-+ 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);
- }
-
-
-@@ -761,7 +765,7 @@ read_pdf_info(char *image_name, char *pa
+ PdfDocument *pdf_doc;
+@@ -723,7 +723,7 @@ read_pdf_info(char *image_name, char *pa
+ #endif
+ // initialize
+ if (!isInit) {
+- globalParams = new GlobalParams();
++ globalParams = std::make_unique<GlobalParams>();
+ globalParams->setErrQuiet(false);
+ isInit = true;
+ }
+@@ -738,16 +738,16 @@ read_pdf_info(char *image_name, char *pa
+ #ifdef POPPLER_VERSION
+ pdf_major_version_found = pdf_doc->doc->getPDFMajorVersion();
+ pdf_minor_version_found = pdf_doc->doc->getPDFMinorVersion();
+- if ((pdf_major_version_found > 1)
++ if ((pdf_major_version_found > /* major_pdf_version_wanted */ 1)
+ || (pdf_minor_version_found > minor_pdf_version_wanted)) {
+ const char *msg =
+- "PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed";
++ "PDF inclusion: found PDF version <%d.%d>, but at most version <%d.%d> allowed";
+ if (pdf_inclusion_errorlevel > 0) {
+- pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
++ pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found, /* major_pdf_version_wanted, */ minor_pdf_version_wanted);
+ } else if (pdf_inclusion_errorlevel < 0) {
+ ; /* do nothing */
+ } else { /* = 0, give warning */
+- pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, minor_pdf_version_wanted);
++ pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found, /* major_pdf_version_wanted, */ minor_pdf_version_wanted);
+ }
+ }
+ #else
+@@ -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();
@@ -100,12 +68,11 @@
if (page_num == 0)
pdftex_fail("PDF inclusion: destination is not a page <%s>",
page_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;
+@@ -1107,7 +1107,5 @@ void epdf_check_mem()
+ n = p->next;
+ delete_document(p);
+ }
+- // see above for globalParams
+- delete globalParams;
+ }
+ }
diff -r 4e9ec0a896a3 -r dad613d1d9a6 print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc
--- a/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc Fri Jan 10 23:28:56 2020 +0000
+++ b/print/web2c/patches/patch-pdftexdir_pdftosrc-newpoppler.cc Sat Jan 11 00:31:05 2020 +0000
@@ -1,19 +1,40 @@
-$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.6 2019/05/14 13:23:10 adam Exp $
+$NetBSD: patch-pdftexdir_pdftosrc-newpoppler.cc,v 1.7 2020/01/11 00:31:05 ryoon Exp $
Fix building.
--- pdftexdir/pdftosrc-newpoppler.cc.orig 2018-12-06 23:31:33.000000000 +0000
+++ pdftexdir/pdftosrc-newpoppler.cc
-@@ -69,7 +69,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;
-@@ -110,7 +110,7 @@ int main(int argc, char *argv[])
+@@ -20,8 +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.
+-It is tested upto the poppler 0.70.1.
++by Arch Linux. The poppler should be 0.83.0 or newer versions.
+ POPPLER_VERSION should be defined.
+ */
+
+@@ -80,7 +79,7 @@ int main(int argc, char *argv[])
+ exit(1);
+ }
+ fileName = new GString(argv[1]);
+- globalParams = new GlobalParams();
++ globalParams = std::make_unique<GlobalParams>();
+ doc = new PDFDoc(fileName);
+ if (!doc->isOk()) {
+ fprintf(stderr, "Invalid PDF file\n");
+@@ -100,8 +99,8 @@ int main(int argc, char *argv[])
+ srcStream = Object(objNull);
+ if (objnum == 0) {
+ srcStream = catalogDict.dictLookup("SourceObject");
+- static char const_SourceFile[] = "SourceFile";
+- if (!srcStream.isStream(const_SourceFile)) {
++ static const char *const_SourceFile = "SourceFile";
++ if (!srcStream.isDict(const_SourceFile)) {
+ fprintf(stderr, "No SourceObject found\n");
+ exit(1);
+ }
+@@ -110,7 +109,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "No SourceName found\n");
exit(1);
}
@@ -22,7 +43,7 @@
// We cannot free srcName, as objname shares its string.
// srcName.free();
} else if (objnum > 0) {
-@@ -119,7 +119,7 @@ int main(int argc, char *argv[])
+@@ -119,7 +118,7 @@ int main(int argc, char *argv[])
fprintf(stderr, "Not a Stream object\n");
exit(1);
}
@@ -31,7 +52,7 @@
if ((p = strrchr(buf, '.')) == 0)
p = strchr(buf, 0);
if (objgen == 0)
-@@ -129,7 +129,7 @@ int main(int argc, char *argv[])
+@@ -129,7 +128,7 @@ int main(int argc, char *argv[])
outname = buf;
} else { // objnum < 0 means we are extracting the XRef table
extract_xref_table = true;
@@ -40,12 +61,7 @@
if ((p = strrchr(buf, '.')) == 0)
p = strchr(buf, 0);
Home |
Main Index |
Thread Index |
Old Index