pkgsrc-Changes archive

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

CVS commit: pkgsrc/print/mupdf



Module Name:    pkgsrc
Committed By:   leot
Date:           Thu Oct  4 19:02:33 UTC 2018

Modified Files:
        pkgsrc/print/mupdf: Makefile PLIST buildlink3.mk distinfo
        pkgsrc/print/mupdf/files: mupdf.pc
        pkgsrc/print/mupdf/patches: patch-Makethird patch-ab patch-ac
            patch-platform_gl_gl-app.h patch-platform_gl_gl-main.c
            patch-source_fitz_load-jpx.c patch-thirdparty_mujs_Makefile

Log Message:
mupdf: Update print/mupdf to 1.14.0

pkgsrc changes:
 - Pass USE_SYSTEM_LIBS=yes via MAKE_ENV in order to honor system (pkgsrc)
   packages {C,LD}FLAGS
 - Rewrite the logic to disable lcms2 in patch-ab and inject -DNO_ICC
   directly via CFLAGS

Changes:
MuPDF 1.14.0
------------
* New features:
    * Added "Source Han Serif" CJK fallback font.
    * Added more scripts to the Noto fallback fonts.
    * Multi-page PNM support.
    * "mutool show" now supports a path syntax for selecting objects to show.

* Build system simplifications:
    * Auto-generated CMap, ICC, and JS source files are checked in to git.
    * Embedded CMap resources are now generated by a python script.
    * Embedded font resources are linked directly if using GNU ld or windows.
    * Namegen tool replaced by use of C macros.
    * Simplified Makefile.

* Annotation editing:
    * New annotation editing mode in mupdf-gl.
    * Can create, edit, and delete most annotation types.
    * Can create appearance streams for most annotation types.
    * Can create appearance streams for Tx form fields.
    * Can create appearance streams for Ch form fields.

* Form filling in mupdf-gl:
    * Can click buttons, checkboxes, and radioboxes.
    * Can fill out text fields using dialog box.
    * Can select choice options using dialog box.
    * Can verify and sign digital signatures.

* Improved UI for mupdf-gl:
    * Password dialog.
    * Error dialog.
    * Open/save file dialog.
    * Snap selection to words or lines by holding control or control+shift.
    * Save and restore current location, bookmarks, and navigation history.

* Bug fixes:
    * Improved CJK character fallback handling in EPUB.

* API changes:
    * Pass rectangle and matrix structs by value.
    * Replaced PDF_NAME_Xxx macros with PDF_NAME(Xxx).
    * Added PDF_TRUE, PDF_FALSE, and PDF_NULL constant pdf_obj* macros.
    * Added helper functions: pdf_dict_get_int, etc.
    * Removed 'doc' argument in pdf_new_int, etc.
    * Quads instead of rects when highlighting and searching text.
    * mutool run: Pass arguments to script in scriptArgs global.


To generate a diff of this commit:
cvs rdiff -u -r1.61 -r1.62 pkgsrc/print/mupdf/Makefile
cvs rdiff -u -r1.16 -r1.17 pkgsrc/print/mupdf/PLIST
cvs rdiff -u -r1.25 -r1.26 pkgsrc/print/mupdf/buildlink3.mk
cvs rdiff -u -r1.40 -r1.41 pkgsrc/print/mupdf/distinfo
cvs rdiff -u -r1.14 -r1.15 pkgsrc/print/mupdf/files/mupdf.pc
cvs rdiff -u -r1.8 -r1.9 pkgsrc/print/mupdf/patches/patch-Makethird \
    pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c
cvs rdiff -u -r1.17 -r1.18 pkgsrc/print/mupdf/patches/patch-ab
cvs rdiff -u -r1.19 -r1.20 pkgsrc/print/mupdf/patches/patch-ac
cvs rdiff -u -r1.1 -r1.2 \
    pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h \
    pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c
cvs rdiff -u -r1.4 -r1.5 \
    pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile

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

Modified files:

Index: pkgsrc/print/mupdf/Makefile
diff -u pkgsrc/print/mupdf/Makefile:1.61 pkgsrc/print/mupdf/Makefile:1.62
--- pkgsrc/print/mupdf/Makefile:1.61    Thu Aug 16 18:54:31 2018
+++ pkgsrc/print/mupdf/Makefile Thu Oct  4 19:02:33 2018
@@ -1,8 +1,7 @@
-# $NetBSD: Makefile,v 1.61 2018/08/16 18:54:31 adam Exp $
+# $NetBSD: Makefile,v 1.62 2018/10/04 19:02:33 leot Exp $
 
-DISTNAME=      mupdf-1.13.0-source
+DISTNAME=      mupdf-1.14.0-source
 PKGNAME=       ${DISTNAME:S/-source//}
-PKGREVISION=   1
 CATEGORIES=    print
 MASTER_SITES=  https://mupdf.com/downloads/archive/
 
@@ -23,6 +22,7 @@ MAKE_FLAGS+=          LDFLAGS=${LDFLAGS:Q}
 MAKE_FLAGS+=           XCFLAGS=${CFLAGS:Q}
 MAKE_FLAGS+=           build=release
 MAKE_ENV+=             HAVE_LIBCRYPTO=no       # Needs openssl-1.1.0
+MAKE_ENV+=             USE_SYSTEM_LIBS=yes
 
 CFLAGS+=       -DJBIG_NO_MEMENTO
 CFLAGS.SunOS+= -D_XOPEN_SOURCE=600

Index: pkgsrc/print/mupdf/PLIST
diff -u pkgsrc/print/mupdf/PLIST:1.16 pkgsrc/print/mupdf/PLIST:1.17
--- pkgsrc/print/mupdf/PLIST:1.16       Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/PLIST    Thu Oct  4 19:02:33 2018
@@ -1,4 +1,4 @@
-@comment $NetBSD: PLIST,v 1.16 2018/05/06 13:19:10 leot Exp $
+@comment $NetBSD: PLIST,v 1.17 2018/10/04 19:02:33 leot Exp $
 bin/mjsgen
 bin/mujstest
 bin/mupdf
@@ -64,7 +64,6 @@ include/mupdf/memento.h
 include/mupdf/pdf-tools.h
 include/mupdf/pdf.h
 include/mupdf/pdf/annot.h
-include/mupdf/pdf/appearance.h
 include/mupdf/pdf/clean.h
 include/mupdf/pdf/cmap.h
 include/mupdf/pdf/crypt.h
@@ -83,10 +82,10 @@ include/mupdf/pdf/resource.h
 include/mupdf/pdf/widget.h
 include/mupdf/pdf/xref.h
 include/mupdf/ucdn.h
+lib/libmupdf-pkcs7.la
+lib/libmupdf-third.la
+lib/libmupdf-threads.la
 lib/libmupdf.la
-lib/libmupdfthird.la
-lib/libmupkcs7.la
-lib/libmuthreads.la
 lib/pkgconfig/mupdf.pc
 man/man1/mupdf.1
 man/man1/mutool.1
@@ -99,10 +98,12 @@ 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/bbox-device.js
 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/fix-s22pdf.js
 share/doc/mupdf/examples/jpx-to-pdf.js
 share/doc/mupdf/examples/multi-threaded.c
 share/doc/mupdf/examples/pdf-create-lowlevel.js

Index: pkgsrc/print/mupdf/buildlink3.mk
diff -u pkgsrc/print/mupdf/buildlink3.mk:1.25 pkgsrc/print/mupdf/buildlink3.mk:1.26
--- pkgsrc/print/mupdf/buildlink3.mk:1.25       Thu Aug 16 18:54:31 2018
+++ pkgsrc/print/mupdf/buildlink3.mk    Thu Oct  4 19:02:33 2018
@@ -1,12 +1,11 @@
-# $NetBSD: buildlink3.mk,v 1.25 2018/08/16 18:54:31 adam Exp $
+# $NetBSD: buildlink3.mk,v 1.26 2018/10/04 19:02:33 leot Exp $
 
 BUILDLINK_TREE+=       mupdf
 
 .if !defined(MUPDF_BUILDLINK3_MK)
 MUPDF_BUILDLINK3_MK:=
 
-BUILDLINK_API_DEPENDS.mupdf+=  mupdf>=1.13.0
-BUILDLINK_ABI_DEPENDS.mupdf?=  mupdf>=1.13.0nb1
+BUILDLINK_API_DEPENDS.mupdf+=  mupdf>=1.14.0
 BUILDLINK_PKGSRCDIR.mupdf?=    ../../print/mupdf
 
 pkgbase := mupdf

Index: pkgsrc/print/mupdf/distinfo
diff -u pkgsrc/print/mupdf/distinfo:1.40 pkgsrc/print/mupdf/distinfo:1.41
--- pkgsrc/print/mupdf/distinfo:1.40    Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/distinfo Thu Oct  4 19:02:33 2018
@@ -1,14 +1,14 @@
-$NetBSD: distinfo,v 1.40 2018/05/06 13:19:10 leot Exp $
+$NetBSD: distinfo,v 1.41 2018/10/04 19:02:33 leot Exp $
 
-SHA1 (mupdf-1.13.0-source.tar.gz) = d4fe867dbdef2e1a465e66cbbd1efb4b1285ef48
-RMD160 (mupdf-1.13.0-source.tar.gz) = 078e972c2f41a34308a52af24ac5ddbf41471342
-SHA512 (mupdf-1.13.0-source.tar.gz) = d7fca7292e612959893a728d35964cf7b4e607385bdd72e81b8ca1de6ab642f999b734afbbf32d75400cd29b7e178ec360e65c91d7b1e1a53c2a04ff0adbd707
-Size (mupdf-1.13.0-source.tar.gz) = 51425034 bytes
-SHA1 (patch-Makethird) = 77820f7344e00140a9792b5a6a3ddb1afa01b7bb
-SHA1 (patch-ab) = 5ca9de36a7f38cdcf0578cded98cdd54bed78ab5
-SHA1 (patch-ac) = 0c140ee7f0a86bc300c91845da0bd3bf5f0b7c14
+SHA1 (mupdf-1.14.0-source.tar.gz) = 289023cd4d10cc42177cd5ee3f20a936f35c84a4
+RMD160 (mupdf-1.14.0-source.tar.gz) = 5b0d14594da547dd80332b96dad93477b6a5d096
+SHA512 (mupdf-1.14.0-source.tar.gz) = 9a8c5d7ce8336fd2cc2d49574a9f3909900e77a734e804380c17a30df1b10bb9c35d781f43dd70b423bf3c607575ef5a901bb70c1b6ce703fe27e03818fc2a62
+Size (mupdf-1.14.0-source.tar.gz) = 55652044 bytes
+SHA1 (patch-Makethird) = 33b7ccf235e971c44e159a687cecc033155957ba
+SHA1 (patch-ab) = 5ef190923d648165cdf29174f1521bd069c7e6f9
+SHA1 (patch-ac) = 4f685e425bff4d257ca3bce3d2b536d5cea1e8aa
 SHA1 (patch-ae) = c6b113818b32cb4470e8549c00a16e0b2f364ede
-SHA1 (patch-platform_gl_gl-app.h) = 6e5e547df27ecb2b82cadd71489d2eb9138c1ce2
-SHA1 (patch-platform_gl_gl-main.c) = 526c3e8c1c548490ef97f59e491b237f803f250e
-SHA1 (patch-source_fitz_load-jpx.c) = b507c1ebab027167af363c9f0f64d8690ea75ff3
-SHA1 (patch-thirdparty_mujs_Makefile) = d3e163bcc4e3d2509401b87e5da8eddb35394dc9
+SHA1 (patch-platform_gl_gl-app.h) = f8682b54821a560b2ba1082bcf215eeefb549644
+SHA1 (patch-platform_gl_gl-main.c) = edff1aa77c4d6af59b2eca442340606a0bae9970
+SHA1 (patch-source_fitz_load-jpx.c) = 161d21bca13bb57db37807aec844c85dc5b34157
+SHA1 (patch-thirdparty_mujs_Makefile) = fc7cbbbeb2a59c4322e2ed46e12cf3dddfd21d28

Index: pkgsrc/print/mupdf/files/mupdf.pc
diff -u pkgsrc/print/mupdf/files/mupdf.pc:1.14 pkgsrc/print/mupdf/files/mupdf.pc:1.15
--- pkgsrc/print/mupdf/files/mupdf.pc:1.14      Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/files/mupdf.pc   Thu Oct  4 19:02:33 2018
@@ -6,5 +6,5 @@ includedir=${prefix}/include
 Name: mupdf
 Description: library for PDF files
 Version: @VERSION@
-Libs: -Wl,-R${libdir} -L${libdir} -lmupdf -lmupdfthird -lmuthreads -lmupkcs7
+Libs: -Wl,-R${libdir} -L${libdir} -lmupdf -lmupdf-third -lmupdf-threads -lmupdf-pkcs7
 Cflags: -I${includedir}

Index: pkgsrc/print/mupdf/patches/patch-Makethird
diff -u pkgsrc/print/mupdf/patches/patch-Makethird:1.8 pkgsrc/print/mupdf/patches/patch-Makethird:1.9
--- pkgsrc/print/mupdf/patches/patch-Makethird:1.8      Mon Dec 18 15:06:34 2017
+++ pkgsrc/print/mupdf/patches/patch-Makethird  Thu Oct  4 19:02:33 2018
@@ -1,35 +1,17 @@
-$NetBSD: patch-Makethird,v 1.8 2017/12/18 15:06:34 leot Exp $
+$NetBSD: patch-Makethird,v 1.9 2018/10/04 19:02:33 leot Exp $
 
 - 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-11-23 11:42:45.000000000 +0000
+--- Makethird.orig     2018-09-25 12:39:17.000000000 +0000
 +++ Makethird
-@@ -27,13 +27,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" "
- MUJS_OUT := $(OUT)/thirdparty/mujs
- MUJS_SRC := one.c
+@@ -229,7 +229,7 @@ else
+ THIRD_SRC += thirdparty/mujs/one.c
+ THIRD_CFLAGS += -Ithirdparty/mujs
  
--MUJS_OBJ := $(addprefix $(MUJS_OUT)/, $(MUJS_SRC:%.c=%.o))
-+MUJS_OBJ := $(addprefix $(MUJS_OUT)/, $(MUJS_SRC:%.c=%.lo))
- 
--$(MUJS_OUT)/one.o: $(wildcard $(MUJS_DIR)/js*.c $(MUJS_DIR)/utf*.c $(MUJS_DIR)/regex.c $(MUJS_DIR)/*.h)
-+$(MUJS_OUT)/one.lo: $(wildcard $(MUJS_DIR)/js*.c $(MUJS_DIR)/utf*.c $(MUJS_DIR)/regex.c $(MUJS_DIR)/*.h)
- 
- $(MUJS_OUT):
-       $(MKDIR_CMD)
--$(MUJS_OUT)/%.o: $(MUJS_DIR)/%.c | $(MUJS_OUT)
-+$(MUJS_OUT)/%.lo: $(MUJS_DIR)/%.c | $(MUJS_OUT)
+-$(OUT)/thirdparty/mujs/%.o: thirdparty/mujs/%.c
++$(OUT)/thirdparty/mujs/%.lo: thirdparty/mujs/%.c
        $(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 ---
Index: pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c
diff -u pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c:1.8 pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c:1.9
--- pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c:1.8 Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c     Thu Oct  4 19:02:33 2018
@@ -1,4 +1,4 @@
-$NetBSD: patch-source_fitz_load-jpx.c,v 1.8 2018/05/06 13:19:10 leot Exp $
+$NetBSD: patch-source_fitz_load-jpx.c,v 1.9 2018/10/04 19:02:33 leot Exp $
 
 - 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
@@ -13,28 +13,31 @@ $NetBSD: patch-source_fitz_load-jpx.c,v 
 
   From OpenBSD ports textproc/mupdf/patch-source_fitz_load-jpx_c,v 1.5.
 
---- source/fitz/load-jpx.c.orig        2018-04-12 13:14:06.000000000 +0000
+--- source/fitz/load-jpx.c.orig        2018-09-25 12:39:17.000000000 +0000
 +++ source/fitz/load-jpx.c
-@@ -548,30 +548,14 @@ void opj_free(void *ptr)
+@@ -577,19 +577,7 @@ void opj_free(void *ptr)
  
- void * opj_aligned_malloc(size_t size)
+ static void * opj_aligned_malloc_n(size_t alignment, size_t size)
  {
 -      uint8_t *ptr;
 -      int off;
- 
+-
 -      if (size == 0)
 -              return NULL;
 -
--      size += 16 + sizeof(uint8_t);
+-      size += alignment + sizeof(uint8_t);
 -      ptr = opj_malloc(size);
 -      if (ptr == NULL)
 -              return NULL;
--      off = 16-(((int)(intptr_t)ptr) & 15);
+-      off = alignment-(((int)(intptr_t)ptr) & (alignment - 1));
 -      ptr[off-1] = off;
 -      return ptr + off;
 +      return opj_malloc(size);
  }
  
+ void * opj_aligned_malloc(size_t size)
+@@ -604,13 +592,7 @@ void * opj_aligned_32_malloc(size_t size
+ 
  void opj_aligned_free(void* ptr_)
  {
 -      uint8_t *ptr = (uint8_t *)ptr_;
@@ -44,7 +47,6 @@ $NetBSD: patch-source_fitz_load-jpx.c,v 
 -
 -      off = ptr[-1];
 -      opj_free((void *)(((unsigned char *)ptr) - off));
-+      
 +      opj_free(ptr_);
  }
  

Index: pkgsrc/print/mupdf/patches/patch-ab
diff -u pkgsrc/print/mupdf/patches/patch-ab:1.17 pkgsrc/print/mupdf/patches/patch-ab:1.18
--- pkgsrc/print/mupdf/patches/patch-ab:1.17    Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/patches/patch-ab Thu Oct  4 19:02:33 2018
@@ -1,92 +1,145 @@
-$NetBSD: patch-ab,v 1.17 2018/05/06 13:19:10 leot Exp $
+$NetBSD: patch-ab,v 1.18 2018/10/04 19:02:33 leot Exp $
 
 - Handle the various operating systems in the same way avoiding hardcoding
+- Avoid to use objcopy by setting HAVE_OBJCOPY to no (if `yes', and with
+  `USE_TOOLS+= objcopy' the objcopy-ing fails as follow:
+    OBJCOPY build/release/resources/fonts/urw/Dingbats.cff.o
+    build/release/resources/fonts/urw/Dingbats.cff.o:1: warning: NUL character seen; rest of line ignored
+    build/release/resources/fonts/urw/Dingbats.cff.o:1: *** missing separator.  Stop.
+  (also for other fonts)).  This needs to be investigated further.
 - 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.
+  CFLAGS.
 
---- Makerules.orig     2018-04-12 13:14:06.000000000 +0000
+--- Makerules.orig     2018-09-25 12:39:17.000000000 +0000
 +++ Makerules
-@@ -65,38 +65,10 @@ else
- $(error unknown build setting: '$(build)')
- endif
- 
--# Windows (MINGW) build doesn't use system libraries.
--ifeq "$(OS)" "MINGW"
--
--WINDRES := windres
--HAVE_X11 ?= no
--HAVE_WIN32 := yes
--
--# Mac OS X doesn't have pkg-config so we hard code paths.
--else ifeq "$(OS)" "MACOS"
--
--HAVE_X11 ?= no
--
--HAVE_GLUT ?= yes
--SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
--SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
--
--CC = xcrun cc
--AR = xcrun ar
--LD = xcrun ld
--RANLIB_CMD = xcrun ranlib $@
--
--# Linux uses pkg-config for system libraries.
--else ifeq "$(OS)" "Linux"
+@@ -6,17 +6,6 @@ OS := $(OS:MSYS%=MINGW)
+ OS := $(OS:Windows_NT=MINGW)
+ OS := $(OS:Darwin=MACOS)
+ 
+-ifeq ($(findstring -fembed-bitcode,$(XCFLAGS)),)
+-  # clang does not support these in combination with -fembed-bitcode
+-  CFLAGS += -ffunction-sections -fdata-sections
+-endif
 -
- HAVE_PTHREAD := yes
- SYS_PTHREAD_CFLAGS :=
- SYS_PTHREAD_LIBS := -lpthread
- 
--HAVE_GLUT := yes
--SYS_GLUT_CFLAGS :=
--SYS_GLUT_LIBS := -lglut -lGL
+-ifeq ($(OS),MACOS)
+-  LDREMOVEUNREACH := -Wl,-dead_strip
+-else
+-  LDREMOVEUNREACH := -Wl,--gc-sections
+-endif
 -
- ifeq "$(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)" "yes"
- HAVE_LIBCRYPTO := yes
- SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO $(shell pkg-config --cflags libcrypto)
-@@ -113,7 +85,6 @@ SYS_CURL_CFLAGS += $(shell pkg-config --
- SYS_CURL_DEPS += $(shell pkg-config --libs openssl)
- endif
- endif
--SYS_CURL_DEPS += -lpthread -lrt
+ SANITIZE_FLAGS += -fsanitize=address
+ SANITIZE_FLAGS += -fsanitize=leak
  
- ifeq "$(shell pkg-config --exists x11 xext && echo yes)" "yes"
- HAVE_X11 := yes
-@@ -121,6 +92,12 @@ SYS_X11_CFLAGS := $(shell pkg-config --c
- SYS_X11_LIBS := $(shell pkg-config --libs x11 xext)
- endif
+@@ -72,77 +61,63 @@ SYS_MUJS_LIBS := -lmujs
+ SYS_OPENJPEG_LIBS := -lopenjp2
+ SYS_ZLIB_LIBS := -lz
+ 
+-ifeq ($(OS),MINGW)
+-  WINDRES := windres
+-  HAVE_WIN32 := yes
+-
+-else ifeq ($(OS),MACOS)
+-  HAVE_GLUT := yes
+-  SYS_GLUT_CFLAGS := -Wno-deprecated-declarations
+-  SYS_GLUT_LIBS := -framework GLUT -framework OpenGL
+-  CC = xcrun cc
+-  AR = xcrun ar
+-  LD = xcrun ld
+-  RANLIB = xcrun ranlib
++HAVE_OBJCOPY := no
+ 
+-else ifeq ($(OS),Linux)
+-  HAVE_OBJCOPY := yes
+-
+-  ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
++ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
+       SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
+       SYS_FREETYPE_LIBS := $(shell pkg-config --libs freetype2)
+-  endif
+-  ifeq ($(shell pkg-config --exists harfbuzz && echo yes),yes)
++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)
+-  endif
+-  ifeq ($(shell pkg-config --exists lcms2 && echo yes),yes)
++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)
+-  endif
+-  ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
++else
++      CFLAGS += -DNO_ICC
++endif
++ifeq ($(shell pkg-config --exists libjpeg && echo yes),yes)
+       SYS_LIBJPEG_CFLAGS := $(shell pkg-config --cflags libjpeg)
+       SYS_LIBJPEG_LIBS := $(shell pkg-config --libs libjpeg)
+-  endif
+-  ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
++endif
++ifeq ($(shell pkg-config --exists libopenjp2 && echo yes),yes)
+       SYS_OPENJPEG_CFLAGS := $(shell pkg-config --cflags libopenjp2)
+       SYS_OPENJPEG_LIBS := $(shell pkg-config --libs libopenjp2)
+-  endif
+-  ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
++endif
++ifeq ($(shell pkg-config --exists zlib && echo yes),yes)
+       SYS_ZLIB_CFLAGS := $(shell pkg-config --cflags zlib)
+       SYS_ZLIB_LIBS := $(shell pkg-config --libs zlib)
+-  endif
++endif
+ 
+-  HAVE_CURL := $(shell pkg-config --exists libcurl && echo yes)
+-  ifeq ($(HAVE_CURL),yes)
++HAVE_CURL := $(shell pkg-config --exists libcurl && echo yes)
++ifeq ($(HAVE_CURL),yes)
+       SYS_CURL_CFLAGS := $(shell pkg-config --cflags libcurl)
+       SYS_CURL_LIBS := $(shell pkg-config --libs libcurl)
+-  endif
++endif
  
+-  HAVE_GLUT := yes
+-  ifeq ($(HAVE_GLUT),yes)
+-      SYS_GLUT_CFLAGS :=
+-      SYS_GLUT_LIBS := -lglut -lGL
+-  endif
 +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)
-@@ -136,12 +113,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
+-  HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
+-  ifeq ($(HAVE_X11),yes)
++HAVE_X11 := $(shell pkg-config --exists x11 xext && echo yes)
++ifeq ($(HAVE_X11),yes)
+       X11_CFLAGS := $(shell pkg-config --cflags x11 xext)
+       X11_LIBS := $(shell pkg-config --libs x11 xext)
+-  endif
 +endif
-+
- SYS_JBIG2DEC_LIBS := -ljbig2dec
- SYS_LIBJPEG_LIBS := -ljpeg
- SYS_ZLIB_LIBS := -lz
  
--endif
+-  HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
+-  ifeq ($(HAVE_LIBCRYPTO),yes)
++HAVE_LIBCRYPTO := $(shell pkg-config --exists 'libcrypto >= 1.1.0' && echo yes)
++ifeq ($(HAVE_LIBCRYPTO),yes)
+       LIBCRYPTO_CFLAGS := $(shell pkg-config --cflags libcrypto) -DHAVE_LIBCRYPTO
+       LIBCRYPTO_LIBS := $(shell pkg-config --libs libcrypto)
+-  endif
++endif
+ 
+-  HAVE_PTHREAD := yes
+-  ifeq ($(HAVE_PTHREAD),yes)
++HAVE_PTHREAD := yes
++ifeq ($(HAVE_PTHREAD),yes)
+       PTHREAD_CFLAGS :=
+       PTHREAD_LIBS := -lpthread
+-  endif
 -
- # The following section is an example of how to simply do cross-compilation
- # using these Makefiles. It builds for a beagleboard running ARM linux,
- # compiling on windows with the CodeSourcery G++ compilers.
+ endif
+ 
+ # The following section has various cross compilation configurations.

Index: pkgsrc/print/mupdf/patches/patch-ac
diff -u pkgsrc/print/mupdf/patches/patch-ac:1.19 pkgsrc/print/mupdf/patches/patch-ac:1.20
--- pkgsrc/print/mupdf/patches/patch-ac:1.19    Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/patches/patch-ac Thu Oct  4 19:02:33 2018
@@ -1,4 +1,4 @@
-$NetBSD: patch-ac,v 1.19 2018/05/06 13:19:10 leot Exp $
+$NetBSD: patch-ac,v 1.20 2018/10/04 19:02:33 leot Exp $
 
 - libtool support 
 - Install target cleanup
@@ -10,280 +10,276 @@ $NetBSD: patch-ac,v 1.19 2018/05/06 13:1
   install it as `mupdf'.
 - Install all EXTRA_APPS (muraster, mujstest, mjsgen)
 
---- Makefile.orig      2018-04-12 13:14:06.000000000 +0000
+--- Makefile.orig      2018-09-25 12:39:17.000000000 +0000
 +++ Makefile
-@@ -72,10 +72,10 @@ QUIET_TAGS = @ echo ' ' ' ' TAGS $@ ;
- QUIET_WINDRES = @ echo ' ' ' ' WINDRES $@ ;
+@@ -51,68 +51,68 @@ ifneq ($(verbose),yes)
  endif
  
--CC_CMD = $(QUIET_CC) $(CC) $(CFLAGS) -o $@ -c $<
--CXX_CMD = $(QUIET_CXX) $(CXX) $(filter-out -Wdeclaration-after-statement,$(CFLAGS)) -o $@ -c $<
--AR_CMD = $(QUIET_AR) $(AR) cr $@ $^
--LINK_CMD = $(QUIET_LINK) $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
-+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 $@
+ MKTGTDIR = mkdir -p $(dir $@)
+-CC_CMD = $(QUIET_CC) $(MKTGTDIR) ; $(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
+-CXX_CMD = $(QUIET_CXX) $(MKTGTDIR) ; $(CXX) $(CFLAGS) -MMD -MP -o $@ -c $<
+-AR_CMD = $(QUIET_AR) $(MKTGTDIR) ; $(AR) cr $@ $^
++CC_CMD = $(QUIET_CC) $(MKTGTDIR) ; ${LIBTOOL} --mode=compile $(CC) $(CFLAGS) -MMD -MP -o $@ -c $<
++CXX_CMD = $(QUIET_CXX) $(MKTGTDIR) ; ${LIBTOOL} --mode=compile $(CXX) $(CFLAGS) -MMD -MP -o $@ -c $<
++AR_CMD = $(QUIET_AR) $(MKTGTDIR) ; ${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $@ -version-info 0:0:0 -rpath ${PREFIX}/lib $^
+ ifdef RANLIB
+   RANLIB_CMD = $(QUIET_RANLIB) $(RANLIB) $@
+ endif
+-LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
++LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; ${LIBTOOL} --mode=link $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
  TAGS_CMD = $(QUIET_TAGS) ctags $^
-@@ -86,45 +86,45 @@ WINDRES_CMD = $(QUIET_WINDRES) $(WINDRES
- $(ALL_DIR) $(OUT) generated :
-       $(MKDIR_CMD)
+ WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
+ OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -o $@ $<
+ 
+ # --- Rules ---
  
 -$(OUT)/%.a :
 +$(OUT)/%.la :
-       $(RM_CMD)
        $(AR_CMD)
        $(RANLIB_CMD)
  
--$(OUT)/%.exe: $(OUT)/%.o | $(ALL_DIR)
-+$(OUT)/%.exe: $(OUT)/%.lo | $(ALL_DIR)
+ $(OUT)/%.exe: %.c
        $(LINK_CMD)
  
--$(OUT)/source/helpers/mu-threads/%.o : source/helpers/mu-threads/%.c | $(ALL_DIR)
-+$(OUT)/source/helpers/mu-threads/%.lo : source/helpers/mu-threads/%.c | $(ALL_DIR)
+-$(OUT)/source/helpers/mu-threads/%.o : source/helpers/mu-threads/%.c
++$(OUT)/source/helpers/mu-threads/%.lo : source/helpers/mu-threads/%.c
        $(CC_CMD) $(THREADING_CFLAGS)
  
--$(OUT)/source/helpers/pkcs7/%.o : source/helpers/pkcs7/%.c | $(ALL_DIR)
-+$(OUT)/source/helpers/pkcs7/%.lo : source/helpers/pkcs7/%.c | $(ALL_DIR)
-       $(CC_CMD)
- 
--$(OUT)/source/tools/%.o : source/tools/%.c | $(ALL_DIR)
-+$(OUT)/source/tools/%.lo : source/tools/%.c | $(ALL_DIR)
-       $(CC_CMD) $(THREADING_CFLAGS)
+-$(OUT)/source/helpers/pkcs7/%.o : source/helpers/pkcs7/%.c
++$(OUT)/source/helpers/pkcs7/%.lo : source/helpers/pkcs7/%.c
+       $(CC_CMD) $(LIBCRYPTO_CFLAGS)
+ 
+-$(OUT)/source/tools/%.o : source/tools/%.c
++$(OUT)/source/tools/%.lo : source/tools/%.c
+       $(CC_CMD) -Wall $(THIRD_CFLAGS) $(THREADING_CFLAGS)
  
--$(OUT)/generated/%.o : generated/%.c | $(ALL_DIR)
+-$(OUT)/generated/%.o : generated/%.c
 -      $(CC_CMD) -O0
-+$(OUT)/generated/%.lo : generated/%.c | $(ALL_DIR)
++$(OUT)/generated/%.lo : generated/%.c
 +      $(CC_CMD)
  
--$(OUT)/platform/x11/%.o : platform/x11/%.c | $(ALL_DIR)
-+$(OUT)/platform/x11/%.lo : platform/x11/%.c | $(ALL_DIR)
-       $(CC_CMD) $(X11_CFLAGS)
+-$(OUT)/platform/x11/%.o : platform/x11/%.c
++$(OUT)/platform/x11/%.lo : platform/x11/%.c
+       $(CC_CMD) -Wall $(X11_CFLAGS)
+ 
+-$(OUT)/platform/x11/curl/%.o : platform/x11/%.c
++$(OUT)/platform/x11/curl/%.lo : platform/x11/%.c
+       $(CC_CMD) -Wall $(X11_CFLAGS) $(CURL_CFLAGS) -DHAVE_CURL
+ 
+-$(OUT)/platform/gl/%.o : platform/gl/%.c
++$(OUT)/platform/gl/%.lo : platform/gl/%.c
+       $(CC_CMD) -Wall $(THIRD_CFLAGS) $(GLUT_CFLAGS)
+ 
+ ifeq ($(HAVE_OBJCOPY),yes)
+-  $(OUT)/source/fitz/noto.o : source/fitz/noto.c
++  $(OUT)/source/fitz/noto.lo : source/fitz/noto.c
+       $(CC_CMD) -Wall -Wdeclaration-after-statement -DHAVE_OBJCOPY $(THIRD_CFLAGS)
+ endif
  
--$(OUT)/platform/x11/%.o: platform/x11/%.rc | $(ALL_DIR)
-+$(OUT)/platform/x11/%.lo: platform/x11/%.rc | $(ALL_DIR)
-       $(WINDRES_CMD)
+-$(OUT)/source/%.o : source/%.c
++$(OUT)/source/%.lo : source/%.c
+       $(CC_CMD) -Wall -Wdeclaration-after-statement $(THIRD_CFLAGS)
+ 
+-$(OUT)/platform/%.o : platform/%.c
++$(OUT)/platform/%.lo : platform/%.c
+       $(CC_CMD) -Wall
  
--$(OUT)/platform/x11/curl/%.o : platform/x11/%.c | $(ALL_DIR)
-+$(OUT)/platform/x11/curl/%.lo : platform/x11/%.c | $(ALL_DIR)
-       $(CC_CMD) $(X11_CFLAGS) $(CURL_CFLAGS) -DHAVE_CURL
- 
--$(OUT)/platform/gl/%.o : platform/gl/%.c | $(ALL_DIR)
-+$(OUT)/platform/gl/%.lo : platform/gl/%.c | $(ALL_DIR)
-       $(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)
+-$(OUT)/%.o: %.rc
++$(OUT)/%.lo: %.rc
+       $(WINDRES_CMD)
  
 -.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules
 +.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules
+ .PRECIOUS : $(OUT)/%.exe # Keep intermediates from chained rules
  
  # --- File lists ---
  
-@@ -153,16 +153,16 @@ SVG_SRC_HDR := $(wildcard source/svg/*.h
- HTML_SRC_HDR := $(wildcard source/html/*.h)
- GPRF_SRC_HDR := $(wildcard source/gprf/*.h)
- 
--FITZ_OBJ := $(FITZ_SRC:%.c=$(OUT)/%.o)
--PDF_OBJ := $(PDF_SRC:%.c=$(OUT)/%.o)
--XPS_OBJ := $(XPS_SRC:%.c=$(OUT)/%.o)
--SVG_OBJ := $(SVG_SRC:%.c=$(OUT)/%.o)
--CBZ_OBJ := $(CBZ_SRC:%.c=$(OUT)/%.o)
--HTML_OBJ := $(HTML_SRC:%.c=$(OUT)/%.o)
--GPRF_OBJ := $(GPRF_SRC:%.c=$(OUT)/%.o)
+-THIRD_OBJ := $(THIRD_SRC:%.c=$(OUT)/%.o)
+-THIRD_OBJ := $(THIRD_OBJ:%.cc=$(OUT)/%.o)
++THIRD_OBJ := $(THIRD_SRC:%.c=$(OUT)/%.lo)
++THIRD_OBJ := $(THIRD_OBJ:%.cc=$(OUT)/%.lo)
+ 
+ MUPDF_SRC := $(sort $(wildcard source/fitz/*.c))
+ MUPDF_SRC += $(sort $(wildcard source/pdf/*.c))
+@@ -122,14 +122,14 @@ MUPDF_SRC += $(sort $(wildcard source/ht
+ MUPDF_SRC += $(sort $(wildcard source/cbz/*.c))
+ MUPDF_SRC += $(sort $(wildcard source/gprf/*.c))
+ 
+-MUPDF_OBJ := $(MUPDF_SRC:%.c=$(OUT)/%.o)
++MUPDF_OBJ := $(MUPDF_SRC:%.c=$(OUT)/%.lo)
+ 
+ THREAD_SRC := source/helpers/mu-threads/mu-threads.c
 -THREAD_OBJ := $(THREAD_SRC:%.c=$(OUT)/%.o)
--PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
--SIGNATURE_OBJ := $(OUT)/platform/x11/pdfapp.o $(OUT)/source/tools/pdfsign.o
-+FITZ_OBJ := $(FITZ_SRC:%.c=$(OUT)/%.lo)
-+PDF_OBJ := $(PDF_SRC:%.c=$(OUT)/%.lo)
-+XPS_OBJ := $(XPS_SRC:%.c=$(OUT)/%.lo)
-+SVG_OBJ := $(SVG_SRC:%.c=$(OUT)/%.lo)
-+CBZ_OBJ := $(CBZ_SRC:%.c=$(OUT)/%.lo)
-+HTML_OBJ := $(HTML_SRC:%.c=$(OUT)/%.lo)
-+GPRF_OBJ := $(GPRF_SRC:%.c=$(OUT)/%.lo)
 +THREAD_OBJ := $(THREAD_SRC:%.c=$(OUT)/%.lo)
-+PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.lo)
-+SIGNATURE_OBJ := $(OUT)/platform/x11/pdfapp.lo $(OUT)/source/tools/pdfsign.lo
  
- $(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
- $(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
-@@ -190,7 +190,7 @@ ifneq "$(CROSSCOMPILE)" "yes"
- $(NAME_GEN) : $(NAMEDUMP_EXE)
- endif
- 
--$(OUT)/source/pdf/pdf-object.o : source/pdf/pdf-name-table.h
-+$(OUT)/source/pdf/pdf-object.lo : source/pdf/pdf-name-table.h
+ PKCS7_SRC := source/helpers/pkcs7/pkcs7-check.c
+ PKCS7_SRC += source/helpers/pkcs7/pkcs7-openssl.c
+-PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.o)
++PKCS7_OBJ := $(PKCS7_SRC:%.c=$(OUT)/%.lo)
  
- generate: $(NAME_GEN)
+ # --- Generated embedded font files ---
  
-@@ -212,7 +212,7 @@ FONT_GEN_SIL := $(subst resources/fonts/
+@@ -156,7 +156,7 @@ ifeq ($(HAVE_OBJCOPY),yes)
+   $(OUT)/%.ttf.o : %.ttf ; $(OBJCOPY_CMD)
+   $(OUT)/%.ttc.o : %.ttc ; $(OBJCOPY_CMD)
+ else
+-  MUPDF_OBJ += $(FONT_GEN:%.c=$(OUT)/%.o)
++  MUPDF_OBJ += $(FONT_GEN:%.c=$(OUT)/%.lo)
+ endif
  
- 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)
--FONT_OBJ := $(FONT_GEN:%.c=$(OUT)/%.o)
-+FONT_OBJ := $(FONT_GEN:%.c=$(OUT)/%.lo)
- 
- generated/%.c : resources/fonts/droid/%.ttf $(HEXDUMP_EXE) | generated
-       $(QUIET_GEN) $(HEXDUMP_EXE) -s $@ $<
-@@ -242,7 +242,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
-@@ -268,7 +268,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)
-@@ -287,7 +287,7 @@ endif
- 
- generate: $(CMAP_GEN)
- 
--$(OUT)/scripts/cmapdump.o : \
-+$(OUT)/scripts/cmapdump.lo : \
-       $(NAME_GEN) \
-       include/mupdf/pdf/cmap.h \
-       source/fitz/context.c \
-@@ -310,7 +310,7 @@ $(OUT)/scripts/cmapdump.o : \
- 
- 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)
- 
- $(JAVASCRIPT_GEN) : $(JAVASCRIPT_SRC) | generated
-       $(QUIET_GEN) $(HEXDUMP_EXE) -0 $@ $(JAVASCRIPT_SRC)
-@@ -325,10 +325,10 @@ generate: $(JAVASCRIPT_GEN)
+ generate: $(FONT_GEN)
+@@ -190,17 +190,17 @@ generate: source/pdf/js/util.js.h
  
  # --- Library ---
  
 -MUPDF_LIB = $(OUT)/libmupdf.a
--THIRD_LIB = $(OUT)/libmupdfthird.a
--THREAD_LIB = $(OUT)/libmuthreads.a
--PKCS7_LIB = $(OUT)/libmupkcs7.a
+-THIRD_LIB = $(OUT)/libmupdf-third.a
+-THREAD_LIB = $(OUT)/libmupdf-threads.a
+-PKCS7_LIB = $(OUT)/libmupdf-pkcs7.a
 +MUPDF_LIB = $(OUT)/libmupdf.la
-+THIRD_LIB = $(OUT)/libmupdfthird.la
-+THREAD_LIB = $(OUT)/libmuthreads.la
-+PKCS7_LIB = $(OUT)/libmupkcs7.la
- 
- MUPDF_OBJ := \
-       $(FITZ_OBJ) \
-@@ -360,46 +360,46 @@ $(THIRD_LIB) : $(THIRD_OBJ)
++THIRD_LIB = $(OUT)/libmupdf-third.la
++THREAD_LIB = $(OUT)/libmupdf-threads.la
++PKCS7_LIB = $(OUT)/libmupdf-pkcs7.la
+ 
+ $(MUPDF_LIB) : $(MUPDF_OBJ)
+ $(THIRD_LIB) : $(THIRD_OBJ)
  $(THREAD_LIB) : $(THREAD_OBJ)
  $(PKCS7_LIB) : $(PKCS7_OBJ)
  
 -INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB)
 +INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) $(PKCS7_LIB)
  
- # --- Tools and Apps ---
+ # --- Main tools and viewers ---
  
- MUTOOL_EXE := $(OUT)/mutool
- MUTOOL_SRC := source/tools/mutool.c source/tools/muconvert.c source/tools/mudraw.c source/tools/murun.c source/tools/mutrace.c
+@@ -211,7 +211,7 @@ MUTOOL_SRC += source/tools/murun.c
+ MUTOOL_SRC += source/tools/mutrace.c
+ MUTOOL_SRC += source/tools/cmapdump.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) $(PKCS7_LIB)
-       $(LINK_CMD) $(THREADING_LIBS)
+ MUTOOL_EXE := $(OUT)/mutool
+ $(MUTOOL_EXE) : $(MUTOOL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(THREAD_LIB)
+       $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS) $(LIBCRYPTO_LIBS)
+@@ -219,28 +219,27 @@ INSTALL_APPS += $(MUTOOL_EXE)
+ 
+ ifeq ($(HAVE_GLUT),yes)
+   MUVIEW_GLUT_SRC += $(sort $(wildcard platform/gl/*.c))
+-  MUVIEW_GLUT_OBJ := $(MUVIEW_GLUT_SRC:%.c=$(OUT)/%.o)
+-  MUVIEW_GLUT_EXE := $(OUT)/mupdf-gl
++  MUVIEW_GLUT_OBJ := $(MUVIEW_GLUT_SRC:%.c=$(OUT)/%.lo)
++  MUVIEW_GLUT_EXE := $(OUT)/platform/gl/mupdf-gl
+   $(MUVIEW_GLUT_EXE) : $(MUVIEW_GLUT_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(GLUT_LIB)
+       $(LINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS) $(WIN32_LDFLAGS) $(GLUT_LIBS)
+   INSTALL_APPS += $(MUVIEW_GLUT_EXE)
+ endif
+ 
+ ifeq ($(HAVE_X11),yes)
+-  MUVIEW_X11_EXE := $(OUT)/mupdf-x11
+-  MUVIEW_X11_OBJ += $(OUT)/platform/x11/pdfapp.o
+-  MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_main.o
+-  MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_image.o
++  MUVIEW_X11_EXE := $(OUT)/platform/x11/mupdf
++  MUVIEW_X11_OBJ += $(OUT)/platform/x11/pdfapp.lo
++  MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_main.lo
++  MUVIEW_X11_OBJ += $(OUT)/platform/x11/x11_image.lo
+   $(MUVIEW_X11_EXE) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
+       $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(LIBCRYPTO_LIBS)
+-  INSTALL_APPS += $(MUVIEW_X11_EXE)
+ endif
+ 
+ ifeq ($(HAVE_WIN32),yes)
+   MUVIEW_WIN32_EXE := $(OUT)/mupdf-w32
+-  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/pdfapp.o
+-  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_main.o
+-  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_res.o
++  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/pdfapp.lo
++  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_main.lo
++  MUVIEW_WIN32_OBJ += $(OUT)/platform/x11/win_res.lo
+   $(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
+       $(LINK_CMD) $(THIRD_LIBS) $(WIN32_LDFLAGS) $(WIN32_LIBS) $(LIBCRYPTO_LIBS)
+   INSTALL_APPS += $(MUVIEW_WIN32_EXE)
+@@ -248,19 +247,19 @@ endif
+ 
+ # --- Extra tools and viewers ---
  
- MURASTER_EXE := $(OUT)/muraster
 -MURASTER_OBJ := $(OUT)/source/tools/muraster.o
 +MURASTER_OBJ := $(OUT)/source/tools/muraster.lo
- $(MURASTER_OBJ) : $(FITZ_HDR)
+ MURASTER_EXE := $(OUT)/muraster
  $(MURASTER_EXE) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB)
-       $(LINK_CMD) $(THREADING_LIBS)
+       $(LINK_CMD) $(THIRD_LIBS) $(THREADING_LIBS)
+ EXTRA_APPS += $(MURASTER_EXE)
  
- MJSGEN_EXE := $(OUT)/mjsgen
 -MJSGEN_OBJ := $(OUT)/source/tools/mjsgen.o
 +MJSGEN_OBJ := $(OUT)/source/tools/mjsgen.lo
- $(MJSGEN_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+ MJSGEN_EXE := $(OUT)/mjsgen
  $(MJSGEN_EXE) : $(MJSGEN_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
-       $(LINK_CMD)
+       $(LINK_CMD) $(THIRD_LIBS)
+ EXTRA_APPS += $(MJSGEN_EXE)
  
- MUJSTEST_EXE := $(OUT)/mujstest
 -MUJSTEST_OBJ := $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o)
 +MUJSTEST_OBJ := $(addprefix $(OUT)/platform/x11/, jstest_main.lo pdfapp.lo)
- $(MUJSTEST_OBJ) : $(FITZ_HDR) $(PDF_HDR)
+ MUJSTEST_EXE := $(OUT)/mujstest
  $(MUJSTEST_EXE) : $(MUJSTEST_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
-       $(LINK_CMD)
+       $(LINK_CMD) $(THIRD_LIBS) $(LIBCRYPTO_LIBS)
+@@ -268,33 +267,38 @@ EXTRA_APPS += $(MUJSTEST_EXE)
  
- ifeq "$(HAVE_X11)" "yes"
--MUVIEW_X11_EXE := $(OUT)/mupdf-x11
--MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
-+MUVIEW_X11_EXE := $(OUT)/platform/x11/mupdf
-+MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.lo x11_image.lo pdfapp.lo)
- $(MUVIEW_X11_OBJ) : $(FITZ_HDR) $(PDF_HDR)
- $(MUVIEW_X11_EXE) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
-       $(LINK_CMD) $(X11_LIBS)
- 
- ifeq "$(HAVE_CURL)" "yes"
--MUVIEW_X11_CURL_EXE := $(OUT)/mupdf-x11-curl
--MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o)
-+MUVIEW_X11_CURL_EXE := $(OUT)/platform/x11/curl/mupdf
-+MUVIEW_X11_CURL_OBJ := $(addprefix $(OUT)/platform/x11/curl/, x11_main.lo x11_image.lo pdfapp.lo curl_stream.lo)
- $(MUVIEW_X11_CURL_OBJ) : $(FITZ_HDR) $(PDF_HDR)
- $(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB) $(PKCS7_LIB)
-       $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
-@@ -407,8 +407,8 @@ endif
+ ifeq ($(HAVE_X11),yes)
+ ifeq ($(HAVE_CURL),yes)
+-  MUVIEW_X11_CURL_EXE := $(OUT)/mupdf-x11-curl
+-  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/pdfapp.o
+-  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/x11_main.o
+-  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/x11_image.o
+-  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/curl_stream.o
++  MUVIEW_X11_CURL_EXE := $(OUT)/platform/x11/curl/mupdf
++  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/pdfapp.lo
++  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/x11_main.lo
++  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/x11_image.lo
++  MUVIEW_X11_CURL_OBJ += $(OUT)/platform/x11/curl/curl_stream.lo
+   $(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB) $(CURL_LIB)
+       $(LINK_CMD) $(THIRD_LIBS) $(X11_LIBS) $(CURL_LIBS) $(LIBCRYPTO_LIBS)
+-  EXTRA_APPS += $(MUVIEW_X11_CURL_EXE)
+ endif
  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)
-@@ -416,7 +416,7 @@ endif
- 
- ifeq "$(HAVE_WIN32)" "yes"
- MUVIEW_WIN32_EXE := $(OUT)/mupdf
--MUVIEW_WIN32_OBJ := $(addprefix $(OUT)/platform/x11/, win_main.o pdfapp.o win_res.o)
-+MUVIEW_WIN32_OBJ := $(addprefix $(OUT)/platform/x11/, win_main.lo pdfapp.lo win_res.lo)
- $(MUVIEW_WIN32_OBJ) : $(FITZ_HDR) $(PDF_HDR)
- $(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(PKCS7_LIB)
-       $(LINK_CMD) $(WIN32_LIBS)
-@@ -425,11 +425,21 @@ 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)
-+INSTALL_APPS := $(MUTOOL_EXE)
- EXTRA_APPS += $(MURASTER_EXE)
--EXTRA_APPS += $(MUVIEW_CURL_EXE)
- EXTRA_APPS += $(MUJSTEST_EXE)
- EXTRA_APPS += $(MJSGEN_EXE)
-+INSTALL_APPS += $(EXTRA_APPS)
-+ 
 +ifeq "$(HAVE_CURL)" "yes"
-+INSTALL_APPS += $(MUVIEW_CURL_EXE)
++INSTALL_APPS += $(MUVIEW_X11_CURL_EXE)
 +else ifeq "$(HAVE_X11)" "yes"
-+INSTALL_APPS += $(MUVIEW_EXE)
++INSTALL_APPS += $(MUVIEW_X11_EXE)
 +endif
 +
-+ifeq "$(HAVE_GLUT)" "yes"
-+INSTALL_APPS += $(MUVIEW_GLUT_EXE)
-+endif
+ # --- Generated dependencies ---
+ 
+--include $(MUPDF_OBJ:%.o=%.d)
+--include $(PKCS7_OBJ:%.o=%.d)
+--include $(THREAD_OBJ:%.o=%.d)
+--include $(THIRD_OBJ:%.o=%.d)
+--include $(GLUT_OBJ:%.o=%.d)
+--include $(CURL_OBJ:%.o=%.d)
+-
+--include $(MUTOOL_OBJ:%.o=%.d)
+--include $(MUVIEW_GLUT_OBJ:%.o=%.d)
+--include $(MUVIEW_X11_OBJ:%.o=%.d)
+--include $(MUVIEW_WIN32_OBJ:%.o=%.d)
++-include $(MUPDF_OBJ:%.lo=%.d)
++-include $(PKCS7_OBJ:%.lo=%.d)
++-include $(THREAD_OBJ:%.lo=%.d)
++-include $(THIRD_OBJ:%.lo=%.d)
++-include $(GLUT_OBJ:%.lo=%.d)
++-include $(CURL_OBJ:%.lo=%.d)
++
++-include $(MUTOOL_OBJ:%.lo=%.d)
++-include $(MUVIEW_GLUT_OBJ:%.lo=%.d)
++-include $(MUVIEW_X11_OBJ:%.lo=%.d)
++-include $(MUVIEW_WIN32_OBJ:%.lo=%.d)
+ 
+--include $(MURASTER_OBJ:%.o=%.d)
+--include $(MUVIEW_X11_CURL_OBJ:%.o=%.d)
++-include $(MURASTER_OBJ:%.lo=%.d)
++-include $(MUVIEW_X11_CURL_OBJ:%.lo=%.d)
  
  # --- Examples ---
  
-@@ -442,10 +452,10 @@ $(OUT)/multi-threaded: docs/examples/mul
+@@ -305,10 +309,10 @@ $(OUT)/multi-threaded: docs/examples/mul
  
  # --- Update version string header ---
  
@@ -298,10 +294,11 @@ $NetBSD: patch-ac,v 1.19 2018/05/06 13:1
  
  # --- Format man pages ---
  
-@@ -474,27 +484,29 @@ extra-apps: $(EXTRA_APPS)
+@@ -336,28 +340,30 @@ apps: $(INSTALL_APPS)
+ extra-apps: $(EXTRA_APPS)
  extra: extra-libs extra-apps
  
- install: libs apps
+-install: libs apps
 -      install -d $(DESTDIR)$(incdir)/mupdf
 -      install -d $(DESTDIR)$(incdir)/mupdf/fitz
 -      install -d $(DESTDIR)$(incdir)/mupdf/pdf
@@ -323,6 +320,7 @@ $NetBSD: patch-ac,v 1.19 2018/05/06 13:1
 -      install README COPYING CHANGES $(DESTDIR)$(docdir)
 -      install docs/*.html docs/*.css docs/*.png $(DESTDIR)$(docdir)
 -      install docs/examples/* $(DESTDIR)$(docdir)/examples
++install: libs apps extra-apps
 +      ${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
@@ -334,7 +332,7 @@ $NetBSD: patch-ac,v 1.19 2018/05/06 13:1
 +      done
 +
 +      ${BSD_INSTALL_PROGRAM_DIR} $(DESTDIR)$(bindir)
-+      for f in $(INSTALL_APPS); do \
++      for f in $(INSTALL_APPS) $(EXTRA_APPS); do \
 +              ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} $$f $(DESTDIR)$(bindir); \
 +      done
 +

Index: pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h
diff -u pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h:1.1 pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h:1.2
--- pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h:1.1   Mon Dec 18 15:06:34 2017
+++ pkgsrc/print/mupdf/patches/patch-platform_gl_gl-app.h       Thu Oct  4 19:02:33 2018
@@ -1,13 +1,13 @@
-$NetBSD: patch-platform_gl_gl-app.h,v 1.1 2017/12/18 15:06:34 leot Exp $
+$NetBSD: patch-platform_gl_gl-app.h,v 1.2 2018/10/04 19:02:33 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.orig  2018-09-25 12:39:17.000000000 +0000
 +++ platform/gl/gl-app.h
-@@ -7,11 +7,7 @@ int win_open_file(char *buf, int len);
- #include "mupdf/fitz.h"
+@@ -7,11 +7,7 @@ void win_install(void);
  #include "mupdf/ucdn.h"
+ #include "mupdf/pdf.h" /* for pdf specifics and forms */
  
 -#ifndef __APPLE__
 -#include <GL/freeglut.h>
@@ -16,5 +16,5 @@ $NetBSD: patch-platform_gl_gl-app.h,v 1.
 -#endif
 +#include <GL/glut.h>
  
- extern fz_context *ctx;
+ /* UI */
  
Index: pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c
diff -u pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c:1.1 pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c:1.2
--- pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c:1.1  Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/patches/patch-platform_gl_gl-main.c      Thu Oct  4 19:02:33 2018
@@ -1,16 +1,15 @@
-$NetBSD: patch-platform_gl_gl-main.c,v 1.1 2018/05/06 13:19:10 leot Exp $
+$NetBSD: patch-platform_gl_gl-main.c,v 1.2 2018/10/04 19:02:33 leot Exp $
 
-glutSetOption() is available only on freeglut.
+glutLeaveMainLoop() is present only on freeglut, define it otherwise.
 
---- platform/gl/gl-main.c.orig 2018-04-12 13:14:06.000000000 +0000
+--- platform/gl/gl-main.c.orig 2018-10-03 11:29:14.000000000 +0000
 +++ platform/gl/gl-main.c
-@@ -1674,7 +1674,9 @@ int main(int argc, char **argv)
+@@ -16,7 +16,7 @@
+ char *realpath(const char *path, char *resolved_path); /* in gl-file.c */
+ #endif
  
-       /* Init GLUT */
- 
-+#if defined(FREEGLUT)
-       glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE, GLUT_ACTION_GLUTMAINLOOP_RETURNS);
-+#endif
- 
-       glutInitErrorFunc(on_error);
-       glutInitWarningFunc(on_warning);
+-#ifdef __APPLE__
++#ifndef FREEGLUT
+ static void cleanup(void);
+ void glutLeaveMainLoop(void)
+ {

Index: pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile
diff -u pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile:1.4 pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile:1.5
--- pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile:1.4       Sun May  6 13:19:10 2018
+++ pkgsrc/print/mupdf/patches/patch-thirdparty_mujs_Makefile   Thu Oct  4 19:02:33 2018
@@ -1,48 +1,57 @@
-$NetBSD: patch-thirdparty_mujs_Makefile,v 1.4 2018/05/06 13:19:10 leot Exp $
+$NetBSD: patch-thirdparty_mujs_Makefile,v 1.5 2018/10/04 19:02:33 leot Exp $
 
 - Add libtool support to mujs.
 - Avoid to set (unused) VERSION variable.
 
---- thirdparty/mujs/Makefile.orig      2018-01-24 15:55:49.000000000 +0000
+--- thirdparty/mujs/Makefile.orig      2018-09-11 10:47:31.000000000 +0000
 +++ thirdparty/mujs/Makefile
 @@ -7,12 +7,6 @@ bindir ?= $(prefix)/bin
  incdir ?= $(prefix)/include
  libdir ?= $(prefix)/lib
  
 -ifeq "$(wildcard .git)" ".git"
--VERSION := $(shell git describe --tags --always)
+-  VERSION := $(shell git describe --tags --always)
 -else
--VERSION := $(shell basename $$PWD | sed -e s,^mujs-,,)
+-  VERSION := $(shell basename $$PWD | sed -e s,^mujs-,,)
 -endif
 -
  # Compiler flags for various configurations:
  
  CFLAGS := -std=c99 -pedantic -Wall -Wextra -Wno-unused-parameter
-@@ -63,19 +57,19 @@ jsdump.c: astnames.h opnames.h
- $(OUT):
-       mkdir -p $(OUT)
+@@ -64,15 +58,15 @@ one.c: $(SRCS)
  
--$(OUT)/main.o: main.c $(HDRS)
-+$(OUT)/main.lo: main.c $(HDRS)
+ jsdump.c: astnames.h opnames.h
+ 
+-$(OUT)/%.o: %.c $(HDRS)
++$(OUT)/%.lo: %.c $(HDRS)
+       @ mkdir -p $(dir $@)
        $(CC) $(CFLAGS) -o $@ -c $<
  
 -$(OUT)/libmujs.o: one.c $(HDRS)
 +$(OUT)/libmujs.lo: one.c $(HDRS)
+       @ mkdir -p $(dir $@)
        $(CC) $(CFLAGS) -o $@ -c $<
  
 -$(OUT)/libmujs.a: $(OUT)/libmujs.o
 +$(OUT)/libmujs.la: $(OUT)/libmujs.lo
-       $(AR) cru $@ $^
+       @ mkdir -p $(dir $@)
+       $(AR) cr $@ $^
  
- $(OUT)/libmujs.so: one.c $(HDRS)
+@@ -80,11 +74,11 @@ $(OUT)/libmujs.so: one.c $(HDRS)
+       @ mkdir -p $(dir $@)
        $(CC) $(CFLAGS) -fPIC -shared -o $@ $< -lm
  
 -$(OUT)/mujs: $(OUT)/libmujs.o $(OUT)/main.o
 +$(OUT)/mujs: $(OUT)/libmujs.lo $(OUT)/main.lo
+       @ mkdir -p $(dir $@)
+       $(CC) $(LDFLAGS) -o $@ $^ $(LIBREADLINE) -lm
+ 
+-$(OUT)/mujs-pp: $(OUT)/libmujs.o $(OUT)/pp.o
++$(OUT)/mujs-pp: $(OUT)/libmujs.lo $(OUT)/pp.lo
+       @ mkdir -p $(dir $@)
        $(CC) $(LDFLAGS) -o $@ $^ -lm
  
- $(OUT)/mujs.pc:
-@@ -100,7 +94,7 @@ install-common: release
+@@ -110,7 +104,7 @@ install-common: release
        install -m 755 build/release/mujs $(DESTDIR)$(bindir)
  
  install-static: install-common



Home | Main Index | Thread Index | Old Index