summaryrefslogtreecommitdiff
path: root/print
diff options
context:
space:
mode:
authorleot <leot@pkgsrc.org>2017-12-18 15:06:33 +0000
committerleot <leot@pkgsrc.org>2017-12-18 15:06:33 +0000
commit008943c144c13be999d2a7a906a21b91f6c68bc5 (patch)
treec37c3671064dc34908f4e8d49e8604b97f655493 /print
parent3d606b256667e92d604842f26beaa9e6c2553ff3 (diff)
downloadpkgsrc-008943c144c13be999d2a7a906a21b91f6c68bc5.tar.gz
mupdf: Update print/mupdf to 1.12.0
pkgsrc changes: - Add support for the `opengl' option via graphics/glut and remove the `glfw' option to follow upstream changes. Adjust options.mk and buildlink3.mk accordingly. - Add patches/patch-platform_gl_gl-app.h to not force freeglut GLUT implementation to every non-APPLE platforms (glut also works!) and adjust the glut.h include. - Add a commented out lcms2 bl3 inclusion entry, lcms2>=2.9 is needed (due "lcms2art.h" et al. inclusion, so disable it for now) - Explain the OPJ_STATIC comment in patches/patch-source_fitz_load-jpx.c a bit more in depth... ...this will hopefully save some time to debug opj_* undefined symbols when trying to link libmupdf and accidently omitting the patches/patch-source_fitz_load-jpx.c hunk (for extra debugging stories fun, if OPJ_STATIC is defined some opj_* symbols are defined while others are not defined, making the debugging of that problem more naughty!). - Inject HAVE_{CURL,GLUT} variables via MAKE_ENV in options.mk to avoid depending on www/curl and graphics/glut (yes, that's a bit kludgy but unfortunately mupdf doesn't have a configure and so there isn't a more sensible way to do it). This is needed to avoid building mupdf-gl for native X.org where the glut.pc pkg-config file is available at build time. Also adjust patches/patch-ab accordingly. - Remove patches/patch-CVE*, they are no longer needed (all applied in 1.12.0) - Bump BUILDLINK_API_DEPENDS.mupdf to 1.12.0 (there were several API changes from 1.11 to 1.12.0) and remove the now redundant and no longer needed BUILDLINK_ABI_DEPENDS.mupdf. Changes: List of changes in MuPDF 1.12.0 * Color management: * LCMS2 library for color management. * CMYK rendering with overprint simulation. * Spot color rendering. * Transparency rendering fixes. * Structured text output improvements: * Reworked structured text API. * Faster text searching. * Highlight and copy text by selecting lines instead of by area. * New semantic XHTML output format. * New layout preserving HTML output format. * Features and improvements: * Improved non-AA rendering with new scan converter. * Improved LARGEFILE support. * Improved TIFF support. * Improved documentation. * PCLm output. * PSD output. * New "mutool trace" tool. * New "mutool sign" tool (work in progress). * Text redaction (work in progress). * Lots of bug fixes.
Diffstat (limited to 'print')
-rw-r--r--print/mupdf/Makefile11
-rw-r--r--print/mupdf/PLIST51
-rw-r--r--print/mupdf/buildlink3.mk9
-rw-r--r--print/mupdf/distinfo27
-rw-r--r--print/mupdf/files/mupdf.pc2
-rw-r--r--print/mupdf/options.mk19
-rw-r--r--print/mupdf/patches/patch-CVE-2017-1468520
-rw-r--r--print/mupdf/patches/patch-CVE-2017-1468619
-rw-r--r--print/mupdf/patches/patch-CVE-2017-14687101
-rw-r--r--print/mupdf/patches/patch-CVE-2017-1536939
-rw-r--r--print/mupdf/patches/patch-CVE-2017-1558718
-rw-r--r--print/mupdf/patches/patch-Makethird20
-rw-r--r--print/mupdf/patches/patch-ab87
-rw-r--r--print/mupdf/patches/patch-ac221
-rw-r--r--print/mupdf/patches/patch-platform_gl_gl-app.h20
-rw-r--r--print/mupdf/patches/patch-source_fitz_load-jpx.c13
-rw-r--r--print/mupdf/patches/patch-thirdparty_mujs_Makefile6
17 files changed, 272 insertions, 411 deletions
diff --git a/print/mupdf/Makefile b/print/mupdf/Makefile
index b99f830a223..daf785bcc4a 100644
--- a/print/mupdf/Makefile
+++ b/print/mupdf/Makefile
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.54 2017/10/25 11:00:03 leot Exp $
+# $NetBSD: Makefile,v 1.55 2017/12/18 15:06:33 leot Exp $
-DISTNAME= mupdf-1.11-source
+DISTNAME= mupdf-1.12.0-source
PKGNAME= ${DISTNAME:S/-source//}
-PKGREVISION= 5
CATEGORIES= print
MASTER_SITES= https://mupdf.com/downloads/archive/
@@ -34,10 +33,11 @@ CFLAGS.SunOS+= -D_XOPEN_SOURCE=600
post-extract:
${RM} -fr \
${WRKSRC}/thirdparty/curl \
+ ${WRKSRC}/thirdparty/freeglut \
${WRKSRC}/thirdparty/freetype \
- ${WRKSRC}/thirdparty/glfw \
${WRKSRC}/thirdparty/harfbuzz \
${WRKSRC}/thirdparty/jbig2dec \
+ ${WRKSRC}/thirdparty/lcms2 \
${WRKSRC}/thirdparty/libjpeg \
${WRKSRC}/thirdparty/openjpeg \
${WRKSRC}/thirdparty/zlib
@@ -54,6 +54,9 @@ post-install:
.include "../../graphics/jbig2dec/buildlink3.mk"
.include "../../mk/jpeg.buildlink3.mk"
.include "../../mk/pthread.buildlink3.mk"
+# XXX: Needs lcms2-2.9 that ATM is not in pkgsrc.
+#BUILDLINK_API_DEPENDS.lcms2+= lcms2>=2.9
+#.include "../../graphics/lcms2/buildlink3.mk"
.include "../../graphics/openjpeg/buildlink3.mk"
.include "../../graphics/png/buildlink3.mk"
.include "../../x11/libXext/buildlink3.mk"
diff --git a/print/mupdf/PLIST b/print/mupdf/PLIST
index a1792f0a872..c3f44b71c6c 100644
--- a/print/mupdf/PLIST
+++ b/print/mupdf/PLIST
@@ -1,7 +1,8 @@
-@comment $NetBSD: PLIST,v 1.14 2017/04/12 13:03:08 leot Exp $
+@comment $NetBSD: PLIST,v 1.15 2017/12/18 15:06:33 leot Exp $
+bin/mjsgen
bin/mujstest
bin/mupdf
-${PLIST.glfw}bin/mupdf-gl
+${PLIST.opengl}bin/mupdf-gl
bin/muraster
bin/mutool
include/mupdf/fitz.h
@@ -11,7 +12,9 @@ include/mupdf/fitz/band-writer.h
include/mupdf/fitz/bidi.h
include/mupdf/fitz/bitmap.h
include/mupdf/fitz/buffer.h
+include/mupdf/fitz/color-management.h
include/mupdf/fitz/colorspace.h
+include/mupdf/fitz/compress.h
include/mupdf/fitz/compressed-buffer.h
include/mupdf/fitz/config.h
include/mupdf/fitz/context.h
@@ -21,7 +24,6 @@ include/mupdf/fitz/display-list.h
include/mupdf/fitz/document.h
include/mupdf/fitz/filter.h
include/mupdf/fitz/font.h
-include/mupdf/fitz/function.h
include/mupdf/fitz/geometry.h
include/mupdf/fitz/getopt.h
include/mupdf/fitz/glyph-cache.h
@@ -31,9 +33,11 @@ include/mupdf/fitz/image.h
include/mupdf/fitz/link.h
include/mupdf/fitz/outline.h
include/mupdf/fitz/output-pcl.h
+include/mupdf/fitz/output-pclm.h
include/mupdf/fitz/output-png.h
include/mupdf/fitz/output-pnm.h
include/mupdf/fitz/output-ps.h
+include/mupdf/fitz/output-psd.h
include/mupdf/fitz/output-pwg.h
include/mupdf/fitz/output-svg.h
include/mupdf/fitz/output-tga.h
@@ -52,12 +56,10 @@ include/mupdf/fitz/text.h
include/mupdf/fitz/track-usage.h
include/mupdf/fitz/transition.h
include/mupdf/fitz/tree.h
-include/mupdf/fitz/ucdn.h
include/mupdf/fitz/util.h
include/mupdf/fitz/version.h
include/mupdf/fitz/writer.h
include/mupdf/fitz/xml.h
-include/mupdf/html.h
include/mupdf/memento.h
include/mupdf/pdf-tools.h
include/mupdf/pdf.h
@@ -80,7 +82,7 @@ include/mupdf/pdf/parse.h
include/mupdf/pdf/resource.h
include/mupdf/pdf/widget.h
include/mupdf/pdf/xref.h
-include/mupdf/svg.h
+include/mupdf/ucdn.h
lib/libmupdf.la
lib/libmupdfthird.la
lib/libmuthreads.la
@@ -90,9 +92,34 @@ man/man1/mutool.1
share/doc/mupdf/CHANGES
share/doc/mupdf/COPYING
share/doc/mupdf/README
-share/doc/mupdf/naming.txt
-share/doc/mupdf/overview.txt
-share/doc/mupdf/progressive.txt
-share/doc/mupdf/refcount.txt
-share/doc/mupdf/thirdparty.txt
-share/doc/mupdf/types.txt
+share/doc/mupdf/android-sdk.html
+share/doc/mupdf/artifex-logo.png
+share/doc/mupdf/building.html
+share/doc/mupdf/coding-overview.html
+share/doc/mupdf/coding-progressive.html
+share/doc/mupdf/coding-style.html
+share/doc/mupdf/examples/create-thumbnail.js
+share/doc/mupdf/examples/draw-device.js
+share/doc/mupdf/examples/draw-document.js
+share/doc/mupdf/examples/example.c
+share/doc/mupdf/examples/jpx-to-pdf.js
+share/doc/mupdf/examples/multi-threaded.c
+share/doc/mupdf/examples/pdf-create-lowlevel.js
+share/doc/mupdf/examples/pdf-create.js
+share/doc/mupdf/examples/pdf-merge.js
+share/doc/mupdf/examples/trace-device.js
+share/doc/mupdf/index.html
+share/doc/mupdf/manual-mupdf-gl.html
+share/doc/mupdf/manual-mutool-clean.html
+share/doc/mupdf/manual-mutool-convert.html
+share/doc/mupdf/manual-mutool-create.html
+share/doc/mupdf/manual-mutool-draw.html
+share/doc/mupdf/manual-mutool-extract.html
+share/doc/mupdf/manual-mutool-merge.html
+share/doc/mupdf/manual-mutool-portfolio.html
+share/doc/mupdf/manual-mutool-run.html
+share/doc/mupdf/manual-mutool-show.html
+share/doc/mupdf/manual-mutool-trace.html
+share/doc/mupdf/style.css
+share/doc/mupdf/template.html
+share/doc/mupdf/thirdparty.html
diff --git a/print/mupdf/buildlink3.mk b/print/mupdf/buildlink3.mk
index 26d59898824..a696de73c1f 100644
--- a/print/mupdf/buildlink3.mk
+++ b/print/mupdf/buildlink3.mk
@@ -1,12 +1,11 @@
-# $NetBSD: buildlink3.mk,v 1.20 2017/08/24 20:03:00 adam Exp $
+# $NetBSD: buildlink3.mk,v 1.21 2017/12/18 15:06:33 leot Exp $
BUILDLINK_TREE+= mupdf
.if !defined(MUPDF_BUILDLINK3_MK)
MUPDF_BUILDLINK3_MK:=
-BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.11
-BUILDLINK_ABI_DEPENDS.mupdf?= mupdf>=1.11nb3
+BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.12.0
BUILDLINK_PKGSRCDIR.mupdf?= ../../print/mupdf
pkgbase := mupdf
@@ -16,9 +15,9 @@ pkgbase := mupdf
.include "../../www/curl/buildlink3.mk"
.endif
-.if !empty(PKG_BUILD_OPTIONS.mupdf:Mglfw)
+.if !empty(PKG_BUILD_OPTIONS.mupdf:Mopengl)
.include "../../graphics/MesaLib/buildlink3.mk"
-.include "../../graphics/glfw/buildlink3.mk"
+.include "../../graphics/glut/buildlink3.mk"
.endif
.include "../../devel/zlib/buildlink3.mk"
diff --git a/print/mupdf/distinfo b/print/mupdf/distinfo
index 10f4b506f9f..a9d912ba51f 100644
--- a/print/mupdf/distinfo
+++ b/print/mupdf/distinfo
@@ -1,18 +1,13 @@
-$NetBSD: distinfo,v 1.38 2017/10/25 11:00:03 leot Exp $
+$NetBSD: distinfo,v 1.39 2017/12/18 15:06:33 leot Exp $
-SHA1 (mupdf-1.11-source.tar.gz) = f782d36aaa896319207e81953e5a622201477b5b
-RMD160 (mupdf-1.11-source.tar.gz) = 573307473a1ac81aca4519b0e57a7111aae7803f
-SHA512 (mupdf-1.11-source.tar.gz) = 501670f540e298a8126806ebbd9db8b29866f663b7bbf26c9ade1933e42f0c00ad410b9d93f3ddbfb3e45c38722869095de28d832fe3fb3703c55cc9a01dbf63
-Size (mupdf-1.11-source.tar.gz) = 40156070 bytes
-SHA1 (patch-CVE-2017-14685) = c84be44c21ca29e0d0a455e0d7efe9a38ac46fb5
-SHA1 (patch-CVE-2017-14686) = b573adc7baa25a2f8b2068b1833f4cc17f38f3eb
-SHA1 (patch-CVE-2017-14687) = 651efafea77050216645ded2e2d3592970713b74
-SHA1 (patch-CVE-2017-15369) = 37bc5e52c67591b04640c03f5a227c278a26aa11
-SHA1 (patch-CVE-2017-15587) = 3bdafc7647148b0b29d37804a14306ea4458a529
-SHA1 (patch-Makethird) = a4d1bb3c8d509a84803c9b60521fd9b6b17b9717
-SHA1 (patch-ab) = a18b1e5b82454bdf06e23185e619b7f8c7a24290
-SHA1 (patch-ac) = c2decf6eae4c6343636439c7d7f6621826fc4e3c
+SHA1 (mupdf-1.12.0-source.tar.gz) = 0daee66600023de2bda2f1928a97a8515c17d2d2
+RMD160 (mupdf-1.12.0-source.tar.gz) = 9d36991f260c55c28ffc7f3b1d2acee84f735407
+SHA512 (mupdf-1.12.0-source.tar.gz) = 11ae620e55e9ebd5844abd7decacc0dafc90dd1f4907ba6ed12f5c725d3920187fc730a7fc33979bf3ff9451da7dbb51f34480a878083e2064f3455555f47d96
+Size (mupdf-1.12.0-source.tar.gz) = 51508917 bytes
+SHA1 (patch-Makethird) = 77820f7344e00140a9792b5a6a3ddb1afa01b7bb
+SHA1 (patch-ab) = 0aafa5815fc0907e3ddcc8f0e7c83510a82669d8
+SHA1 (patch-ac) = 799efd894505fd960953905e61022411e8adf1ef
SHA1 (patch-ae) = c6b113818b32cb4470e8549c00a16e0b2f364ede
-SHA1 (patch-scripts_hexdump.c) = 65a029086f429a1f8568066a712c1d8e0106c867
-SHA1 (patch-source_fitz_load-jpx.c) = 57f22296a519d9e0ab9247fd5e742e2390a63fd5
-SHA1 (patch-thirdparty_mujs_Makefile) = cd6a20d56020ae5028f95e24e75f5e4a62127f9f
+SHA1 (patch-platform_gl_gl-app.h) = 6e5e547df27ecb2b82cadd71489d2eb9138c1ce2
+SHA1 (patch-source_fitz_load-jpx.c) = 18b47e3b478183c8e85a6ad1e6cabbbf48cf9f6b
+SHA1 (patch-thirdparty_mujs_Makefile) = 713946f25ae1ea44878b19b9430324e3d9f98990
diff --git a/print/mupdf/files/mupdf.pc b/print/mupdf/files/mupdf.pc
index 80d03bc1df4..f5661112eab 100644
--- a/print/mupdf/files/mupdf.pc
+++ b/print/mupdf/files/mupdf.pc
@@ -5,6 +5,6 @@ includedir=${prefix}/include
Name: mupdf
Description: library for PDF files
-Version: 1.11
+Version: 1.12.0
Libs: -Wl,-R${libdir} -L${libdir} -lmupdf -lmupdfthird -lmuthreads
Cflags: -I${includedir}
diff --git a/print/mupdf/options.mk b/print/mupdf/options.mk
index fce0fd513c4..aee17a80a98 100644
--- a/print/mupdf/options.mk
+++ b/print/mupdf/options.mk
@@ -1,25 +1,28 @@
-# $NetBSD: options.mk,v 1.5 2017/04/12 13:03:08 leot Exp $
+# $NetBSD: options.mk,v 1.6 2017/12/18 15:06:33 leot Exp $
PKG_OPTIONS_VAR= PKG_OPTIONS.mupdf
-PKG_SUPPORTED_OPTIONS= curl glfw
+PKG_SUPPORTED_OPTIONS= curl opengl
.include "../../mk/bsd.options.mk"
-PLIST_VARS+= glfw
+PLIST_VARS+= opengl
#
# curl support
#
.if !empty(PKG_OPTIONS:Mcurl)
.include "../../www/curl/buildlink3.mk"
+.else
+MAKE_ENV+= HAVE_CURL=no
.endif
#
-# glfw support
+# glut support
#
-.if !empty(PKG_OPTIONS:Mglfw)
-PLIST.glfw= yes
+.if !empty(PKG_OPTIONS:Mopengl)
+PLIST.opengl= yes
.include "../../graphics/MesaLib/buildlink3.mk"
-BUILDLINK_API_DEPENDS.glfw+= glfw>=3.2.1
-.include "../../graphics/glfw/buildlink3.mk"
+.include "../../graphics/glut/buildlink3.mk"
+.else
+MAKE_ENV+= HAVE_GLUT=no
.endif
diff --git a/print/mupdf/patches/patch-CVE-2017-14685 b/print/mupdf/patches/patch-CVE-2017-14685
deleted file mode 100644
index eb9154635d2..00000000000
--- a/print/mupdf/patches/patch-CVE-2017-14685
+++ /dev/null
@@ -1,20 +0,0 @@
-$NetBSD: patch-CVE-2017-14685,v 1.1 2017/10/25 11:00:03 leot Exp $
-
-Fix 698539: Don't use xps font if it could not be loaded.
-(AKA CVE-2017-14685)
-
-xps_load_links_in_glyphs did not cope with font loading failures.
-
-From upstream commit ab1a420613dec93c686acbee2c165274e922f82a
-
---- source/xps/xps-link.c.orig
-+++ source/xps/xps-link.c
-@@ -91,6 +91,8 @@ xps_load_links_in_glyphs(fz_context *ctx, xps_document *doc, const fz_matrix *ct
- bidi_level = atoi(bidi_level_att);
-
- font = xps_lookup_font(ctx, doc, base_uri, font_uri_att, style_att);
-+ if (!font)
-+ return;
- text = xps_parse_glyphs_imp(ctx, doc, &local_ctm, font, fz_atof(font_size_att),
- fz_atof(origin_x_att), fz_atof(origin_y_att),
- is_sideways, bidi_level, indices_att, unicode_att);
diff --git a/print/mupdf/patches/patch-CVE-2017-14686 b/print/mupdf/patches/patch-CVE-2017-14686
deleted file mode 100644
index b0023929b19..00000000000
--- a/print/mupdf/patches/patch-CVE-2017-14686
+++ /dev/null
@@ -1,19 +0,0 @@
-$NetBSD: patch-CVE-2017-14686,v 1.1 2017/10/25 11:00:03 leot Exp $
-
-Fix bug 698540: Check name, comment and meta size field signs.
-(AKA CVE-2017-14686)
-
-From upstream commit 0f0fbc07d9be31f5e83ec5328d7311fdfd8328b1
-
---- source/fitz/unzip.c.orig
-+++ source/fitz/unzip.c
-@@ -141,6 +141,9 @@ static void read_zip_dir_imp(fz_context *ctx, fz_zip_archive *zip, int start_off
- (void) fz_read_int32_le(ctx, file); /* ext file atts */
- offset = fz_read_int32_le(ctx, file);
-
-+ if (namesize < 0 || metasize < 0 || commentsize < 0)
-+ fz_throw(ctx, FZ_ERROR_GENERIC, "invalid size in zip entry");
-+
- name = fz_malloc(ctx, namesize + 1);
- n = fz_read(ctx, file, (unsigned char*)name, namesize);
- if (n < (size_t)namesize)
diff --git a/print/mupdf/patches/patch-CVE-2017-14687 b/print/mupdf/patches/patch-CVE-2017-14687
deleted file mode 100644
index f562ac2da3e..00000000000
--- a/print/mupdf/patches/patch-CVE-2017-14687
+++ /dev/null
@@ -1,101 +0,0 @@
-$NetBSD: patch-CVE-2017-14687,v 1.1 2017/10/25 11:00:03 leot Exp $
-
-Fix 698558: Handle non-tags in tag name comparisons.
-(AKA CVE-2017-14687)
-
-Use fz_xml_is_tag instead of fz_xml_tag && !strcmp idiom.
-
-From upstream commit 2b16dbd8f73269cb15ca61ece75cf8d2d196ed28
-
---- source/html/css-apply.c.orig
-+++ source/html/css-apply.c
-@@ -328,7 +328,7 @@ match_selector(fz_css_selector *sel, fz_xml *node)
-
- if (sel->name)
- {
-- if (strcmp(sel->name, fz_xml_tag(node)))
-+ if (!fz_xml_is_tag(node, sel->name))
- return 0;
- }
-
---- source/svg/svg-run.c.orig
-+++ source/svg/svg-run.c
-@@ -1044,7 +1044,7 @@ svg_run_use(fz_context *ctx, fz_device *dev, svg_document *doc, fz_xml *root, co
- fz_xml *linked = fz_tree_lookup(ctx, doc->idmap, xlink_href_att + 1);
- if (linked)
- {
-- if (!strcmp(fz_xml_tag(linked), "symbol"))
-+ if (fz_xml_is_tag(linked, "symbol"))
- svg_run_use_symbol(ctx, dev, doc, root, linked, &local_state);
- else
- svg_run_element(ctx, dev, doc, linked, &local_state);
---- source/xps/xps-common.c.orig
-+++ source/xps/xps-common.c
-@@ -47,7 +47,7 @@ xps_parse_brush(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, const
- else if (fz_xml_is_tag(node, "RadialGradientBrush"))
- xps_parse_radial_gradient_brush(ctx, doc, ctm, area, base_uri, dict, node);
- else
-- fz_warn(ctx, "unknown brush tag: %s", fz_xml_tag(node));
-+ fz_warn(ctx, "unknown brush tag");
- }
-
- void
-@@ -85,7 +85,7 @@ xps_begin_opacity(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, cons
- if (opacity_att)
- opacity = fz_atof(opacity_att);
-
-- if (opacity_mask_tag && !strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush"))
-+ if (fz_xml_is_tag(opacity_mask_tag, "SolidColorBrush"))
- {
- char *scb_opacity_att = fz_xml_att(opacity_mask_tag, "Opacity");
- char *scb_color_att = fz_xml_att(opacity_mask_tag, "Color");
-@@ -129,7 +129,7 @@ xps_end_opacity(fz_context *ctx, xps_document *doc, char *base_uri, xps_resource
-
- if (opacity_mask_tag)
- {
-- if (strcmp(fz_xml_tag(opacity_mask_tag), "SolidColorBrush"))
-+ if (!fz_xml_is_tag(opacity_mask_tag, "SolidColorBrush"))
- fz_pop_clip(ctx, dev);
- }
- }
---- source/xps/xps-glyphs.c.orig
-+++ source/xps/xps-glyphs.c
-@@ -592,7 +592,7 @@ xps_parse_glyphs(fz_context *ctx, xps_document *doc, const fz_matrix *ctm,
-
- /* If it's a solid color brush fill/stroke do a simple fill */
-
-- if (fill_tag && !strcmp(fz_xml_tag(fill_tag), "SolidColorBrush"))
-+ if (fz_xml_is_tag(fill_tag, "SolidColorBrush"))
- {
- fill_opacity_att = fz_xml_att(fill_tag, "Opacity");
- fill_att = fz_xml_att(fill_tag, "Color");
---- source/xps/xps-path.c.orig
-+++ source/xps/xps-path.c
-@@ -879,14 +879,14 @@ xps_parse_path(fz_context *ctx, xps_document *doc, const fz_matrix *ctm, char *b
- if (!data_att && !data_tag)
- return;
-
-- if (fill_tag && !strcmp(fz_xml_tag(fill_tag), "SolidColorBrush"))
-+ if (fz_xml_is_tag(fill_tag, "SolidColorBrush"))
- {
- fill_opacity_att = fz_xml_att(fill_tag, "Opacity");
- fill_att = fz_xml_att(fill_tag, "Color");
- fill_tag = NULL;
- }
-
-- if (stroke_tag && !strcmp(fz_xml_tag(stroke_tag), "SolidColorBrush"))
-+ if (fz_xml_is_tag(stroke_tag, "SolidColorBrush"))
- {
- stroke_opacity_att = fz_xml_att(stroke_tag, "Opacity");
- stroke_att = fz_xml_att(stroke_tag, "Color");
---- source/xps/xps-resource.c.orig
-+++ source/xps/xps-resource.c
-@@ -84,7 +84,7 @@ xps_parse_remote_resource_dictionary(fz_context *ctx, xps_document *doc, char *b
- if (!xml)
- return NULL;
-
-- if (strcmp(fz_xml_tag(xml), "ResourceDictionary"))
-+ if (!fz_xml_is_tag(xml, "ResourceDictionary"))
- {
- fz_drop_xml(ctx, xml);
- fz_throw(ctx, FZ_ERROR_GENERIC, "expected ResourceDictionary element");
diff --git a/print/mupdf/patches/patch-CVE-2017-15369 b/print/mupdf/patches/patch-CVE-2017-15369
deleted file mode 100644
index 6096098abfd..00000000000
--- a/print/mupdf/patches/patch-CVE-2017-15369
+++ /dev/null
@@ -1,39 +0,0 @@
-$NetBSD: patch-CVE-2017-15369,v 1.1 2017/10/25 11:00:03 leot Exp $
-
-Bug 698592: Mark variable fz_var(), avoiding optimization.
-(AKA CVE-2017-15369)
-
-The change in 2707fa9e8e6d17d794330e719dec1b08161fb045
-in build_filter_chain() allows for the variable chain
-to reside in a register, which means that the bug is
-likely to only be visible if built under optimization.
-
-First the chain variable is transferred to chain2, then
-set to NULL, then when an exception occurs in build_filter()
-the filter chain will be freed by build_filter(). Next
-the expectation is that execution proceeds to fz_catch()
-where fz_drop_stream() would be called with chain == NULL.
-
-However due to the chain variable residing in a register,
-its value is not NULL as expected, but was reset to its
-original value upon the exception (since they use setjmp()),
-hence fz_drop_stream() is called with a non-NULL value.
-
-Marking the chain variable with fz_var() prevents the
-compiler from allowing the chain variable to reside in
-a register and hence its value will remain NULL and
-never be reset.
-
-From upstream commit c2663e51238ec8256da7fc61ad580db891d9fe9a
-
---- source/pdf/pdf-stream.c.orig
-+++ source/pdf/pdf-stream.c
-@@ -246,6 +246,8 @@ build_filter_chain(fz_context *ctx, fz_stream *chain, pdf_document *doc, pdf_obj
- pdf_obj *p;
- int i, n;
-
-+ fz_var(chain);
-+
- fz_try(ctx)
- {
- n = pdf_array_len(ctx, fs);
diff --git a/print/mupdf/patches/patch-CVE-2017-15587 b/print/mupdf/patches/patch-CVE-2017-15587
deleted file mode 100644
index 2242c7ed7f7..00000000000
--- a/print/mupdf/patches/patch-CVE-2017-15587
+++ /dev/null
@@ -1,18 +0,0 @@
-$NetBSD: patch-CVE-2017-15587,v 1.1 2017/10/25 11:00:03 leot Exp $
-
-Check for integer overflow when validating new style xref Index.
-(AKA CVE-2017-15587)
-
-From upstream commit 82df2631d7d0446b206ea6b434ea609b6c28b0e8
-
---- source/pdf/pdf-xref.c.orig
-+++ source/pdf/pdf-xref.c
-@@ -924,7 +924,7 @@ pdf_read_new_xref_section(fz_context *ctx, pdf_document *doc, fz_stream *stm, fz
- pdf_xref_entry *table;
- int i, n;
-
-- if (i0 < 0 || i1 < 0)
-+ if (i0 < 0 || i1 < 0 || (i0+i1) < 0)
- fz_throw(ctx, FZ_ERROR_GENERIC, "negative xref stream entry index");
- //if (i0 + i1 > pdf_xref_len(ctx, doc))
- // fz_throw(ctx, FZ_ERROR_GENERIC, "xref stream has too many entries");
diff --git a/print/mupdf/patches/patch-Makethird b/print/mupdf/patches/patch-Makethird
index 8cc007fff9f..a4a6503a6b4 100644
--- a/print/mupdf/patches/patch-Makethird
+++ b/print/mupdf/patches/patch-Makethird
@@ -1,10 +1,12 @@
-$NetBSD: patch-Makethird,v 1.7 2017/04/12 13:03:08 leot Exp $
+$NetBSD: patch-Makethird,v 1.8 2017/12/18 15:06:34 leot Exp $
-o mujs building support with libtool
+- mujs building support with libtool
+- Avoid the internal lcms2 version provided and honors SYS_LCMS2_{CFLAGS,LIBS}.
+ These are handled in patches/patch-ab.
---- Makethird.orig 2017-03-31 14:23:45.000000000 +0000
+--- Makethird.orig 2017-11-23 11:42:45.000000000 +0000
+++ Makethird
-@@ -26,13 +26,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" "
+@@ -27,13 +27,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" "
MUJS_OUT := $(OUT)/thirdparty/mujs
MUJS_SRC := one.c
@@ -21,3 +23,13 @@ o mujs building support with libtool
$(CC_CMD)
MUJS_CFLAGS := -I$(MUJS_DIR)
+@@ -575,7 +575,8 @@ $(LCMS2_OUT)/%.o: $(LCMS2_DIR)/src/%.c |
+
+ LCMS2_CFLAGS := -I$(LCMS2_DIR)/include
+ else
+-LCMS2_CFLAGS := -DNO_ICC
++LCMS2_CFLAGS := $(SYS_LCMS2_CFLAGS)
++LCMS2_LIBS := $(SYS_LCMS2_LIBS)
+ endif
+
+ # --- cURL ---
diff --git a/print/mupdf/patches/patch-ab b/print/mupdf/patches/patch-ab
index ae6c049801c..f62119e795f 100644
--- a/print/mupdf/patches/patch-ab
+++ b/print/mupdf/patches/patch-ab
@@ -1,12 +1,17 @@
-$NetBSD: patch-ab,v 1.15 2017/05/19 18:00:38 fhajny Exp $
+$NetBSD: patch-ab,v 1.16 2017/12/18 15:06:34 leot Exp $
-o Handle the various operating systems in the same way avoiding hardcoding
-o Properly recognize glfw support
+- Handle the various operating systems in the same way avoiding hardcoding
+- Avoid internal version of freeglut and try to pick it up via pkg-config and
+ set SYS_GLUT_{CFLAGS,LIBS} accordingly.
+- Avoid internal version of lcms2 and try to pick it up via pkg-config and
+ set SYS_LCMS2_{CFLAGS,LIBS} accordingly.
+ If no lcms2 is available just pass `-DNO_ICC' to disable it via
+ SYS_LCMS2_CFLAGS.
---- Makerules.orig 2017-04-05 11:02:21.000000000 +0000
+--- Makerules.orig 2017-11-23 11:42:45.000000000 +0000
+++ Makerules
-@@ -64,54 +64,6 @@ ifeq "$(largefile)" "yes"
- CFLAGS += -DFZ_LARGEFILE
+@@ -62,41 +62,10 @@ else
+ $(error unknown build setting: '$(build)')
endif
-# Windows (MINGW) build doesn't use system libraries.
@@ -24,35 +29,14 @@ o Properly recognize glfw support
-
-HAVE_X11 ?= no
-
--HAVE_PTHREAD := yes
--SYS_PTHREAD_CFLAGS :=
--SYS_PTHREAD_LIBS := -lpthread
+-HAVE_GLUT ?= yes
+-SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+-SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
-
--# Mac OS X deprecated libcrypto, so the default is to not include it.
--HAVE_LIBCRYTO := no
--SYS_LIBCRYPTO_CFLAGS :=
--SYS_LIBCRYPTO_LIBS :=
--ifeq "$(HAVE_LIBCRYPTO)" "yes"
--SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO
--SYS_LIBCRYPTO_LIBS := -lcrypto
--endif
--
--SYS_CURL_DEPS := -lpthread
--
--SYS_X11_CFLAGS := -I/usr/X11R6/include
--SYS_X11_LIBS := -L/usr/X11R6/lib -lX11 -lXext
--
--SYS_FREETYPE_CFLAGS := $(shell freetype-config --cflags)
--SYS_FREETYPE_LIBS := $(shell freetype-config --libs)
--SYS_OPENJPEG_LIBS := -lopenjpeg
--SYS_JBIG2DEC_LIBS := -ljbig2dec
--SYS_LIBJPEG_LIBS := -ljpeg
--SYS_ZLIB_LIBS := -lz
--
--CC := xcrun cc
--AR := xcrun ar
--LD := xcrun ld
--RANLIB_CMD := xcrun ranlib $@
+-CC = xcrun cc
+-AR = xcrun ar
+-LD = xcrun ld
+-RANLIB_CMD = xcrun ranlib $@
-
-# Linux uses pkg-config for system libraries.
-else ifeq "$(OS)" "Linux"
@@ -60,7 +44,15 @@ o Properly recognize glfw support
HAVE_PTHREAD := yes
SYS_PTHREAD_CFLAGS :=
SYS_PTHREAD_LIBS := -lpthread
-@@ -132,7 +84,6 @@ SYS_CURL_CFLAGS += $(shell pkg-config --
+
+-HAVE_GLUT := yes
+-SYS_GLUT_CFLAGS :=
+-SYS_GLUT_LIBS := -lglut -lGL
+-
+ ifeq "$(shell pkg-config --exists 'libcrypto <= 1.0.1t' && echo yes)" "yes"
+ HAVE_LIBCRYPTO := yes
+ SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
+@@ -113,7 +82,6 @@ SYS_CURL_CFLAGS += $(shell pkg-config --
SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
endif
endif
@@ -68,22 +60,31 @@ o Properly recognize glfw support
ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
HAVE_X11 := yes
-@@ -140,6 +91,14 @@ SYS_X11_CFLAGS := $(shell pkg-config --c
+@@ -121,6 +89,12 @@ SYS_X11_CFLAGS := $(shell pkg-config --c
SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
endif
-+ifeq "$(shell pkg-config --exists glfw3 && pkg-config --exists gl && echo yes)" "yes"
-+HAVE_GLFW := yes
-+SYS_GLFW_CFLAGS := $(shell pkg-config --cflags glfw3)
-+SYS_GLFW_CFLAGS += $(shell pkg-config --cflags gl)
-+SYS_GLFW_LIBS := $(shell pkg-config --libs glfw3)
-+SYS_GLFW_LIBS += $(shell pkg-config --libs gl)
++ifeq "$(shell pkg-config --exists glut && pkg-config --exists gl && echo yes)" "yes"
++HAVE_GLUT ?= yes
++SYS_GLUT_CFLAGS := $(shell pkg-config --cflags glut)
++SYS_GLUT_LIBS := $(shell pkg-config --libs glut)
+endif
+
ifeq "$(shell pkg-config --exists harfbuzz && echo yes)" "yes"
SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz)
SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz)
-@@ -159,8 +118,6 @@ SYS_JBIG2DEC_LIBS := -ljbig2dec
+@@ -136,12 +110,17 @@ SYS_OPENJPEG_CFLAGS := $(shell pkg-confi
+ SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
+ endif
+
++ifeq "$(shell pkg-config --exists lcms2 && echo yes)" "yes"
++SYS_LCMS2_CFLAGS := $(shell pkg-config --cflags lcms2)
++SYS_LCMS2_LIBS := $(shell pkg-config --libs lcms2)
++else
++SYS_LCMS2_CFLAGS := -DNO_ICC
++endif
++
+ SYS_JBIG2DEC_LIBS := -ljbig2dec
SYS_LIBJPEG_LIBS := -ljpeg
SYS_ZLIB_LIBS := -lz
diff --git a/print/mupdf/patches/patch-ac b/print/mupdf/patches/patch-ac
index 51ae7871306..a56d1eaf272 100644
--- a/print/mupdf/patches/patch-ac
+++ b/print/mupdf/patches/patch-ac
@@ -1,49 +1,32 @@
-$NetBSD: patch-ac,v 1.17 2017/07/16 08:29:53 leot Exp $
+$NetBSD: patch-ac,v 1.18 2017/12/18 15:06:34 leot Exp $
-o libtool support
-o Install target cleanup
-o Also install muthreads library (needed by various tools)
-o Do not force `-O0' flag when building
-o Get rid of unused VERSION variable and `version:' target (otherwise `git' can
+- libtool support
+- Install target cleanup
+- Also install muthreads library (needed by various tools)
+- Do not force `-O0' flag when building
+- Get rid of unused VERSION variable and `version:' target (otherwise `git' can
be invoked during the building phase)
-o Install only one "mupdf" binary, prefer the featureful one and always
- install it as "mupdf"
+- Install only one `mupdf' binary, prefer the featureful one and always
+ install it as `mupdf'.
---- Makefile.orig 2017-04-05 11:02:21.000000000 +0000
+--- Makefile.orig 2017-11-23 11:42:45.000000000 +0000
+++ Makefile
-@@ -57,65 +57,51 @@ ALL_DIR += $(OUT)/platform/gl
-
- # --- Commands ---
-
--ifneq "$(verbose)" "yes"
--QUIET_AR = @ echo ' ' ' ' AR $@ ;
--QUIET_CC = @ echo ' ' ' ' CC $@ ;
--QUIET_CXX = @ echo ' ' ' ' CXX $@ ;
--QUIET_GEN = @ echo ' ' ' ' GEN $@ ;
--QUIET_LINK = @ echo ' ' ' ' LINK $@ ;
--QUIET_MKDIR = @ echo ' ' ' ' MKDIR $@ ;
--QUIET_RM = @ echo ' ' ' ' RM $@ ;
--QUIET_TAGS = @ echo ' ' ' ' TAGS $@ ;
--QUIET_WINDRES = @ echo ' ' ' ' WINDRES $@ ;
--endif
--
+@@ -71,10 +71,10 @@ QUIET_TAGS = @ echo ' ' ' ' TAGS $@ ;
+ QUIET_WINDRES = @ echo ' ' ' ' WINDRES $@ ;
+ endif
+
-CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<
-CXX_CMD = $(QUIET_CXX) $(CXX) $(CFLAGS) -o $@ -c $<
-AR_CMD = $(QUIET_AR) $(AR) cr $@ $^
-LINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
--MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@
--RM_CMD = $(QUIET_RM) rm -f $@
--TAGS_CMD = $(QUIET_TAGS) ctags $^
--WINDRES_CMD = $(QUIET_WINDRES) $(WINDRES) $< $@
-+CC_CMD = ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -o $@ -c $<
-+CXX_CMD = ${LIBTOOL} --mode=compile $(CXX) $(CFLAGS) -o $@ -c $<
-+AR_CMD = ${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $@ -version-info 0:0:0 -rpath ${PREFIX}/lib $^
-+LINK_CMD = ${LIBTOOL} --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
-+MKDIR_CMD = mkdir -p $@
-+RM_CMD = rm -f $@
-
- # --- Rules ---
-
++CC_CMD = $(QUIET_CC) ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -o $@ -c $<
++CXX_CMD = $(QUIET_CXX) ${LIBTOOL} --mode=compile $(CXX) $(CFLAGS) -o $@ -c $<
++AR_CMD = $(QUIET_AR) ${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $@ -version-info 0:0:0 -rpath ${PREFIX}/lib $^
++LINK_CMD = $(QUIET_LINK) ${LIBTOOL} --mode=link $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
+ MKDIR_CMD = $(QUIET_MKDIR) mkdir -p $@
+ RM_CMD = $(QUIET_RM) rm -f $@
+ TAGS_CMD = $(QUIET_TAGS) ctags $^
+@@ -85,42 +85,42 @@ WINDRES_CMD = $(QUIET_WINDRES) $(WINDRES
$(ALL_DIR) $(OUT) generated :
$(MKDIR_CMD)
@@ -57,17 +40,13 @@ o Install only one "mupdf" binary, prefer the featureful one and always
+$(OUT)/%.exe: $(OUT)/%.lo | $(ALL_DIR)
$(LINK_CMD)
--$(OUT)/%.o : %.c | $(ALL_DIR)
-+$(OUT)/%.lo : %.c | $(ALL_DIR)
- $(CC_CMD)
-
--$(OUT)/%.o : %.cpp | $(ALL_DIR)
-+$(OUT)/%.lo : %.cpp | $(ALL_DIR)
- $(CXX_CMD)
-
-$(OUT)/source/helpers/%.o : source/helpers/%.c | $(ALL_DIR)
+$(OUT)/source/helpers/%.lo : source/helpers/%.c | $(ALL_DIR)
- $(CC_CMD) $(PTHREAD_CFLAGS) -DHAVE_PTHREAD
+ $(CC_CMD) $(THREADING_CFLAGS)
+
+-$(OUT)/source/tools/%.o : source/tools/%.c | $(ALL_DIR)
++$(OUT)/source/tools/%.lo : source/tools/%.c | $(ALL_DIR)
+ $(CC_CMD) $(THREADING_CFLAGS)
-$(OUT)/generated/%.o : generated/%.c | $(ALL_DIR)
- $(CC_CMD) -O0
@@ -88,14 +67,22 @@ o Install only one "mupdf" binary, prefer the featureful one and always
-$(OUT)/platform/gl/%.o : platform/gl/%.c | $(ALL_DIR)
+$(OUT)/platform/gl/%.lo : platform/gl/%.c | $(ALL_DIR)
- $(CC_CMD) $(GLFW_CFLAGS)
+ $(CC_CMD) $(GLUT_CFLAGS)
+
+-$(OUT)/%.o : %.c | $(ALL_DIR)
++$(OUT)/%.lo : %.c | $(ALL_DIR)
+ $(CC_CMD)
+
+-$(OUT)/%.o : %.cpp | $(ALL_DIR)
++$(OUT)/%.lo : %.cpp | $(ALL_DIR)
+ $(CXX_CMD)
-.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules
+.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules
# --- File lists ---
-@@ -141,14 +127,14 @@ SVG_SRC_HDR := $(wildcard source/svg/*.h
+@@ -144,14 +144,14 @@ SVG_SRC_HDR := $(wildcard source/svg/*.h
HTML_SRC_HDR := $(wildcard source/html/*.h)
GPRF_SRC_HDR := $(wildcard source/gprf/*.h)
@@ -118,7 +105,7 @@ o Install only one "mupdf" binary, prefer the featureful one and always
$(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
$(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
-@@ -172,7 +158,7 @@ ifneq "$(CROSSCOMPILE)" "yes"
+@@ -177,7 +177,7 @@ ifneq "$(CROSSCOMPILE)" "yes"
$(NAME_GEN) : $(NAMEDUMP_EXE)
endif
@@ -127,7 +114,7 @@ o Install only one "mupdf" binary, prefer the featureful one and always
generate: $(NAME_GEN)
-@@ -194,7 +180,7 @@ FONT_GEN_SIL := $(subst resources/fonts/
+@@ -199,7 +199,7 @@ FONT_GEN_SIL := $(subst resources/fonts/
FONT_BIN := $(FONT_BIN_DROID) $(FONT_BIN_NOTO) $(FONT_BIN_HAN) $(FONT_BIN_URW) $(FONT_BIN_SIL)
FONT_GEN := $(FONT_GEN_DROID) $(FONT_GEN_NOTO) $(FONT_GEN_HAN) $(FONT_GEN_URW) $(FONT_GEN_SIL)
@@ -135,42 +122,44 @@ o Install only one "mupdf" binary, prefer the featureful one and always
+FONT_OBJ := $(FONT_GEN:%.c=$(OUT)/%.lo)
generated/%.c : resources/fonts/droid/%.ttf $(HEXDUMP_EXE) | generated
- $(QUIET_GEN) $(HEXDUMP_EXE) $@ $<
-@@ -244,7 +230,7 @@ ifneq "$(CROSSCOMPILE)" "yes"
- $(CMAP_GEN) : $(CMAPDUMP_EXE)
- endif
+ $(QUIET_GEN) $(HEXDUMP_EXE) -s $@ $<
+@@ -229,7 +229,7 @@ generate: $(FONT_GEN)
+
+ ICC_BIN := resources/icc/gray.icc resources/icc/rgb.icc resources/icc/cmyk.icc resources/icc/lab.icc
+ ICC_GEN := generated/icc-profiles.c
+-ICC_OBJ := $(ICC_GEN:%.c=$(OUT)/%.o)
++ICC_OBJ := $(ICC_GEN:%.c=$(OUT)/%.lo)
+
+ $(ICC_OBJ) : $(ICC_GEN)
+ $(ICC_GEN) : $(ICC_BIN) | generated
+@@ -255,7 +255,7 @@ CMAP_GEN := \
+ generated/pdf-cmap-extra.c \
+ generated/pdf-cmap-utf8.c \
+ generated/pdf-cmap-utf32.c
+-CMAP_OBJ := $(CMAP_GEN:%.c=$(OUT)/%.o)
++CMAP_OBJ := $(CMAP_GEN:%.c=$(OUT)/%.lo)
+
+ generated/pdf-cmap-cjk.c : $(CMAP_CJK_SRC) | generated
+ $(QUIET_GEN) $(CMAPDUMP_EXE) $@ $(CMAP_CJK_SRC)
+@@ -274,7 +274,7 @@ endif
+
+ generate: $(CMAP_GEN)
-$(OUT)/scripts/cmapdump.o : \
+$(OUT)/scripts/cmapdump.lo : \
$(NAME_GEN) \
include/mupdf/pdf/cmap.h \
source/fitz/context.c \
-@@ -264,7 +250,7 @@ $(OUT)/scripts/cmapdump.o : \
- source/pdf/pdf-cmap.c \
- source/pdf/pdf-cmap-parse.c \
+@@ -297,7 +297,7 @@ $(OUT)/scripts/cmapdump.o : \
--$(OUT)/source/pdf/pdf-cmap-table.o : $(CMAP_GEN)
-+$(OUT)/source/pdf/pdf-cmap-table.lo : $(CMAP_GEN)
+ JAVASCRIPT_SRC := source/pdf/pdf-js-util.js
+ JAVASCRIPT_GEN := generated/pdf-js-util.c
+-JAVASCRIPT_OBJ := $(JAVASCRIPT_GEN:%.c=$(OUT)/%.o)
++JAVASCRIPT_OBJ := $(JAVASCRIPT_GEN:%.c=$(OUT)/%.lo)
- generate: $(CMAP_GEN)
-
-@@ -279,7 +265,7 @@ ifneq "$(CROSSCOMPILE)" "yes"
- $(ADOBECA_GEN) : $(HEXDUMP_EXE)
- endif
-
--$(OUT)/source/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)
-+$(OUT)/source/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN)
-
- generate: $(ADOBECA_GEN)
-
-@@ -294,15 +280,15 @@ ifneq "$(CROSSCOMPILE)" "yes"
- $(JAVASCRIPT_GEN) : $(HEXDUMP_EXE)
- endif
-
--$(OUT)/source/pdf/pdf-js.o : $(JAVASCRIPT_GEN)
-+$(OUT)/source/pdf/pdf-js.lo : $(JAVASCRIPT_GEN)
-
- generate: $(JAVASCRIPT_GEN)
+ $(JAVASCRIPT_GEN) : $(JAVASCRIPT_SRC) | generated
+ $(QUIET_GEN) $(HEXDUMP_EXE) -0 $@ $(JAVASCRIPT_SRC)
+@@ -312,9 +312,9 @@ generate: $(JAVASCRIPT_GEN)
# --- Library ---
@@ -181,9 +170,9 @@ o Install only one "mupdf" binary, prefer the featureful one and always
+THIRD_LIB = $(OUT)/libmupdfthird.la
+THREAD_LIB = $(OUT)/libmuthreads.la
- MUPDF_OBJ := $(FITZ_OBJ) $(FONT_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(SVG_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ)
- THIRD_OBJ := $(FREETYPE_OBJ) $(HARFBUZZ_OBJ) $(JBIG2DEC_OBJ) $(LIBJPEG_OBJ) $(JPEGXR_OBJ) $(LURATECH_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
-@@ -312,46 +298,46 @@ $(MUPDF_LIB) : $(MUPDF_OBJ)
+ MUPDF_OBJ := \
+ $(FITZ_OBJ) \
+@@ -347,46 +347,46 @@ $(MUPDF_LIB) : $(MUPDF_OBJ)
$(THIRD_LIB) : $(THIRD_OBJ)
$(THREAD_LIB) : $(THREAD_OBJ)
@@ -193,20 +182,20 @@ o Install only one "mupdf" binary, prefer the featureful one and always
# --- Tools and Apps ---
MUTOOL_EXE := $(OUT)/mutool
- MUTOOL_SRC := source/tools/mutool.c source/tools/muconvert.c source/tools/mudraw.c source/tools/murun.c
- MUTOOL_SRC += $(wildcard source/tools/pdf*.c)
+ MUTOOL_SRC := source/tools/mutool.c source/tools/muconvert.c source/tools/mudraw.c source/tools/murun.c source/tools/mutrace.c
+ MUTOOL_SRC += $(sort $(wildcard source/tools/pdf*.c))
-MUTOOL_OBJ := $(MUTOOL_SRC:%.c=$(OUT)/%.o)
+MUTOOL_OBJ := $(MUTOOL_SRC:%.c=$(OUT)/%.lo)
$(MUTOOL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUTOOL_EXE) : $(MUTOOL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
- $(LINK_CMD) $(PTHREAD_LIBS)
+ $(LINK_CMD) $(THREADING_LIBS)
MURASTER_EXE := $(OUT)/muraster
-MURASTER_OBJ := $(OUT)/source/tools/muraster.o
+MURASTER_OBJ := $(OUT)/source/tools/muraster.lo
$(MURASTER_OBJ) : $(FITZ_HDR)
$(MURASTER_EXE) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
- $(LINK_CMD) $(PTHREAD_LIBS)
+ $(LINK_CMD) $(THREADING_LIBS)
MJSGEN_EXE := $(OUT)/mjsgen
-MJSGEN_OBJ := $(OUT)/source/tools/mjsgen.o
@@ -239,18 +228,18 @@ o Install only one "mupdf" binary, prefer the featureful one and always
$(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB)
$(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
-@@ -359,8 +345,8 @@ endif
+@@ -394,8 +394,8 @@ endif
endif
- ifeq "$(HAVE_GLFW)" "yes"
--MUVIEW_GLFW_EXE := $(OUT)/mupdf-gl
--MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o)
-+MUVIEW_GLFW_EXE := $(OUT)/platform/gl/mupdf-gl
-+MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.lo gl-input.lo gl-main.lo)
- $(MUVIEW_GLFW_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h
- $(MUVIEW_GLFW_EXE) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB)
- $(LINK_CMD) $(GLFW_LIBS)
-@@ -368,7 +354,7 @@ endif
+ ifeq "$(HAVE_GLUT)" "yes"
+-MUVIEW_GLUT_EXE := $(OUT)/mupdf-gl
+-MUVIEW_GLUT_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o)
++MUVIEW_GLUT_EXE := $(OUT)/platform/gl/mupdf-gl
++MUVIEW_GLUT_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.lo gl-input.lo gl-main.lo)
+ $(MUVIEW_GLUT_OBJ) : $(FITZ_HDR) $(PDF_HDR) platform/gl/gl-app.h
+ $(MUVIEW_GLUT_EXE) : $(MUVIEW_GLUT_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLUT_LIB)
+ $(LINK_CMD) $(GLUT_LIB) $(GLUT_LIBS)
+@@ -403,7 +403,7 @@ endif
ifeq "$(HAVE_WIN32)" "yes"
MUVIEW_WIN32_EXE := $(OUT)/mupdf
@@ -259,8 +248,8 @@ o Install only one "mupdf" binary, prefer the featureful one and always
$(MUVIEW_WIN32_OBJ) : $(FITZ_HDR) $(PDF_HDR)
$(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
$(LINK_CMD) $(WIN32_LIBS)
-@@ -377,11 +363,20 @@ endif
- MUVIEW_EXE := $(MUVIEW_X11_EXE) $(MUVIEW_WIN32_EXE) $(MUVIEW_GLFW_EXE)
+@@ -412,11 +412,20 @@ endif
+ MUVIEW_EXE := $(MUVIEW_X11_EXE) $(MUVIEW_WIN32_EXE) $(MUVIEW_GLUT_EXE)
MUVIEW_CURL_EXE := $(MUVIEW_X11_CURL_EXE) $(MUVIEW_WIN32_CURL_EXE)
-INSTALL_APPS := $(MUTOOL_EXE) $(MUVIEW_EXE)
@@ -268,21 +257,21 @@ o Install only one "mupdf" binary, prefer the featureful one and always
INSTALL_APPS += $(MURASTER_EXE)
-INSTALL_APPS += $(MUVIEW_CURL_EXE)
INSTALL_APPS += $(MUJSTEST_EXE)
-
+ INSTALL_APPS += $(MJSGEN_EXE)
++
+ifeq "$(HAVE_CURL)" "yes"
+INSTALL_APPS += $(MUVIEW_CURL_EXE)
+else ifeq "$(HAVE_X11)" "yes"
+INSTALL_APPS += $(MUVIEW_EXE)
+endif
+
-+ifeq "$(HAVE_GLFW)" "yes"
-+INSTALL_APPS += $(MUVIEW_GLFW_EXE)
++ifeq "$(HAVE_GLUT)" "yes"
++INSTALL_APPS += $(MUVIEW_GLUT_EXE)
+endif
-+
+
# --- Examples ---
- examples: $(OUT)/example $(OUT)/multi-threaded
-@@ -393,10 +388,10 @@ $(OUT)/multi-threaded: docs/multi-thread
+@@ -429,10 +438,10 @@ $(OUT)/multi-threaded: docs/examples/mul
# --- Update version string header ---
@@ -297,7 +286,7 @@ o Install only one "mupdf" binary, prefer the featureful one and always
# --- Format man pages ---
-@@ -423,24 +418,26 @@ libs: $(INSTALL_LIBS)
+@@ -459,27 +468,29 @@ libs: $(INSTALL_LIBS)
apps: $(INSTALL_APPS)
install: libs apps
@@ -313,6 +302,15 @@ o Install only one "mupdf" binary, prefer the featureful one and always
-
- install -d $(DESTDIR)$(bindir)
- install $(INSTALL_APPS) $(DESTDIR)$(bindir)
+-
+- install -d $(DESTDIR)$(mandir)/man1
+- install docs/man/*.1 $(DESTDIR)$(mandir)/man1
+-
+- install -d $(DESTDIR)$(docdir)
+- install -d $(DESTDIR)$(docdir)/examples
+- install README COPYING CHANGES $(DESTDIR)$(docdir)
+- install docs/*.html docs/*.css docs/*.png $(DESTDIR)$(docdir)
+- install docs/examples/* $(DESTDIR)$(docdir)/examples
+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(incdir) $(DESTDIR)$(incdir)/mupdf $(DESTDIR)$(incdir)/mupdf/fitz $(DESTDIR)$(incdir)/mupdf/pdf
+ ${BSD_INSTALL_DATA} include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
+ ${BSD_INSTALL_DATA} include/mupdf/fitz/*.h $(DESTDIR)$(incdir)/mupdf/fitz
@@ -327,16 +325,15 @@ o Install only one "mupdf" binary, prefer the featureful one and always
+ for f in $(INSTALL_APPS); do \
+ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} $$f $(DESTDIR)$(bindir); \
+ done
-
-- install -d $(DESTDIR)$(mandir)/man1
-- install docs/man/*.1 $(DESTDIR)$(mandir)/man1
++
+ ${BSD_INSTALL_MAN_DIR} $(DESTDIR)$(mandir)/man1
+ ${BSD_INSTALL_MAN} docs/man/*.1 $(DESTDIR)$(mandir)/man1
-
-- install -d $(DESTDIR)$(docdir)
-- install README COPYING CHANGES docs/*.txt $(DESTDIR)$(docdir)
++
+ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)
-+ ${BSD_INSTALL_DATA} README COPYING CHANGES docs/*.txt $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA_DIR} $(DESTDIR)$(docdir)/examples
++ ${BSD_INSTALL_DATA} README COPYING CHANGES $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} docs/*.html docs/*.css docs/*.png $(DESTDIR)$(docdir)
++ ${BSD_INSTALL_DATA} docs/examples/* $(DESTDIR)$(docdir)/examples
tarball:
bash scripts/archive.sh
diff --git a/print/mupdf/patches/patch-platform_gl_gl-app.h b/print/mupdf/patches/patch-platform_gl_gl-app.h
new file mode 100644
index 00000000000..de3c37f4e97
--- /dev/null
+++ b/print/mupdf/patches/patch-platform_gl_gl-app.h
@@ -0,0 +1,20 @@
+$NetBSD: patch-platform_gl_gl-app.h,v 1.1 2017/12/18 15:06:34 leot Exp $
+
+- Do not force freeglut GLUT implementation to every non-APPLE platforms.
+- Adjust the glut.h include.
+
+--- platform/gl/gl-app.h.orig 2017-11-23 11:42:45.000000000 +0000
++++ platform/gl/gl-app.h
+@@ -7,11 +7,7 @@ int win_open_file(char *buf, int len);
+ #include "mupdf/fitz.h"
+ #include "mupdf/ucdn.h"
+
+-#ifndef __APPLE__
+-#include <GL/freeglut.h>
+-#else
+-#include <GLUT/glut.h>
+-#endif
++#include <GL/glut.h>
+
+ extern fz_context *ctx;
+
diff --git a/print/mupdf/patches/patch-source_fitz_load-jpx.c b/print/mupdf/patches/patch-source_fitz_load-jpx.c
index 072703d269a..949707ceac5 100644
--- a/print/mupdf/patches/patch-source_fitz_load-jpx.c
+++ b/print/mupdf/patches/patch-source_fitz_load-jpx.c
@@ -1,6 +1,7 @@
-$NetBSD: patch-source_fitz_load-jpx.c,v 1.6 2017/10/19 20:32:07 leot Exp $
+$NetBSD: patch-source_fitz_load-jpx.c,v 1.7 2017/12/18 15:06:34 leot Exp $
-- Restrict OPJ_STATIC to Windows (avoid linking errors due to hidden symbols)
+- Restrict OPJ_STATIC to Windows.
+ This avoid linking errors due to opj_* hidden symbols when linking libmupdf.
- MuPDF does some locking around its allocation calls; it overrides openjpeg's
allocators to do this locking too. However mupdf tries to manually align things
@@ -15,9 +16,9 @@ $NetBSD: patch-source_fitz_load-jpx.c,v 1.6 2017/10/19 20:32:07 leot Exp $
From OpenBSD ports textproc/mupdf/patch-source_fitz_load-jpx_c,v 1.5.
---- source/fitz/load-jpx.c.orig 2017-04-05 11:02:21.000000000 +0000
+--- source/fitz/load-jpx.c.orig 2017-11-23 11:42:45.000000000 +0000
+++ source/fitz/load-jpx.c
-@@ -444,7 +444,9 @@ fz_load_jpx_info(fz_context *ctx, unsign
+@@ -445,7 +445,9 @@ fz_load_jpx_info(fz_context *ctx, const
#else /* HAVE_LURATECH */
@@ -25,9 +26,9 @@ $NetBSD: patch-source_fitz_load-jpx.c,v 1.6 2017/10/19 20:32:07 leot Exp $
#define OPJ_STATIC
+#endif
#define OPJ_HAVE_INTTYPES_H
- #if !defined(_WIN32) && !defined(_WIN64)
+ #if !defined(_MSC_VER) || _MSC_VER >= 1600
#define OPJ_HAVE_STDINT_H
-@@ -554,30 +556,14 @@ void opj_free(void *ptr)
+@@ -555,30 +557,14 @@ void opj_free(void *ptr)
void * opj_aligned_malloc(size_t size)
{
diff --git a/print/mupdf/patches/patch-thirdparty_mujs_Makefile b/print/mupdf/patches/patch-thirdparty_mujs_Makefile
index 6092fd76d4e..12f4ebaf3ee 100644
--- a/print/mupdf/patches/patch-thirdparty_mujs_Makefile
+++ b/print/mupdf/patches/patch-thirdparty_mujs_Makefile
@@ -1,7 +1,7 @@
-$NetBSD: patch-thirdparty_mujs_Makefile,v 1.2 2017/04/12 13:03:08 leot Exp $
+$NetBSD: patch-thirdparty_mujs_Makefile,v 1.3 2017/12/18 15:06:34 leot Exp $
-o Add libtool support lo mujs.
-o Avoid to set (unused) VERSION variable.
+- Add libtool support to mujs.
+- Avoid to set (unused) VERSION variable.
--- thirdparty/mujs/Makefile.orig 2017-03-29 13:56:39.000000000 +0000
+++ thirdparty/mujs/Makefile