pkgsrc-WIP-changes archive

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

mupdf: Import mupdf-1.10 as wip/mupdf



Module Name:	pkgsrc-wip
Committed By:	Leonardo Taccari <leot%NetBSD.org@localhost>
Pushed By:	leot
Date:		Wed Nov 23 10:59:51 2016 +0100
Changeset:	94e827329df2a166d229671cd107a41ea8537740

Modified Files:
	Makefile
Added Files:
	mupdf/DESCR
	mupdf/Makefile
	mupdf/PLIST
	mupdf/buildlink3.mk
	mupdf/distinfo
	mupdf/files/mupdf.pc
	mupdf/options.mk
	mupdf/patches/patch-Makethird
	mupdf/patches/patch-ab
	mupdf/patches/patch-ac
	mupdf/patches/patch-ae
	mupdf/patches/patch-source_fitz_load-jpx.c
	mupdf/patches/patch-thirdparty_mujs_Makefile

Log Message:
mupdf: Import mupdf-1.10 as wip/mupdf

MuPDF is a lightweight PDF viewer and toolkit written in portable C.

The renderer in MuPDF is tailored for high quality anti-aliased
graphics.  MuPDF renders text with metrics and spacing accurate to
within fractions of a pixel for the highest fidelity in reproducing
the look of a printed page on screen.

MuPDF has a small footprint.  A binary that includes the standard
Roman fonts is only one megabyte.  A build with full CJK support
(including an Asian font) is approximately five megabytes.

MuPDF has support for all non-interactive PDF 1.7 features, and
the toolkit provides a simple API for accessing the internal
structures of the PDF document.  Example code for navigating
interactive links and bookmarks, encrypting PDF files, extracting
fonts, images, and searchable text, and rendering pages to image
files is provided.

XXX: For the moment it is imported in pkgsrc-wip instead of directly
XXX: updating print/mupdf because the new 1.10 API breaks
XXX: print/zathura-pdf-mupdf.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=94e827329df2a166d229671cd107a41ea8537740

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

diffstat:
 Makefile                                     |   1 +
 mupdf/DESCR                                  |  17 ++
 mupdf/Makefile                               |  58 ++++++
 mupdf/PLIST                                  |  96 +++++++++
 mupdf/buildlink3.mk                          |  30 +++
 mupdf/distinfo                               |  12 ++
 mupdf/files/mupdf.pc                         |  10 +
 mupdf/options.mk                             |  25 +++
 mupdf/patches/patch-Makethird                |  23 +++
 mupdf/patches/patch-ab                       |  86 ++++++++
 mupdf/patches/patch-ac                       | 289 +++++++++++++++++++++++++++
 mupdf/patches/patch-ae                       |  82 ++++++++
 mupdf/patches/patch-source_fitz_load-jpx.c   |  16 ++
 mupdf/patches/patch-thirdparty_mujs_Makefile |  47 +++++
 14 files changed, 792 insertions(+)

diffs:
diff --git a/Makefile b/Makefile
index 0fee920..258529d 100644
--- a/Makefile
+++ b/Makefile
@@ -1907,6 +1907,7 @@ SUBDIR+=	munge
 SUBDIR+=	munin-common
 SUBDIR+=	munin-master
 SUBDIR+=	munin-node
+SUBDIR+=	mupdf
 SUBDIR+=	mupen64
 SUBDIR+=	mupen64-base
 SUBDIR+=	mupen64-plugin-input
diff --git a/mupdf/DESCR b/mupdf/DESCR
new file mode 100644
index 0000000..41c10d3
--- /dev/null
+++ b/mupdf/DESCR
@@ -0,0 +1,17 @@
+MuPDF is a lightweight PDF viewer and toolkit written in portable C.
+
+The renderer in MuPDF is tailored for high quality anti-aliased
+graphics.  MuPDF renders text with metrics and spacing accurate to
+within fractions of a pixel for the highest fidelity in reproducing
+the look of a printed page on screen.
+
+MuPDF has a small footprint.  A binary that includes the standard
+Roman fonts is only one megabyte.  A build with full CJK support
+(including an Asian font) is approximately five megabytes.
+
+MuPDF has support for all non-interactive PDF 1.7 features, and
+the toolkit provides a simple API for accessing the internal
+structures of the PDF document.  Example code for navigating
+interactive links and bookmarks, encrypting PDF files, extracting
+fonts, images, and searchable text, and rendering pages to image
+files is provided.
diff --git a/mupdf/Makefile b/mupdf/Makefile
new file mode 100644
index 0000000..91064b0
--- /dev/null
+++ b/mupdf/Makefile
@@ -0,0 +1,58 @@
+# $NetBSD: Makefile,v 1.40 2016/10/07 18:25:33 adam Exp $
+
+DISTNAME=	mupdf-1.10-source
+PKGNAME=	${DISTNAME:S/-source//}
+CATEGORIES=	print
+MASTER_SITES=	http://mupdf.com/downloads/archive/
+
+MAINTAINER=	leot%NetBSD.org@localhost
+HOMEPAGE=	http://mupdf.com/
+COMMENT=	Lightweight PDF viewer and toolkit
+LICENSE=	gnu-agpl-v3
+
+USE_LANGUAGES=	c99
+USE_LIBTOOL=	yes
+USE_TOOLS+=	pkg-config gmake
+
+INSTALLATION_DIRS+=	bin include lib/pkgconfig
+INSTALL_MAKE_FLAGS+=	prefix=${PREFIX}
+INSTALL_MAKE_FLAGS+=	mandir=${PREFIX}/${PKGMANDIR}
+LDFLAGS=		${COMPILER_RPATH_FLAG}${X11BASE}/lib
+MAKE_FLAGS+=		LDFLAGS=${LDFLAGS:Q}
+MAKE_FLAGS+=		XCFLAGS=${CFLAGS:Q}
+MAKE_FLAGS+=		build=release
+
+CFLAGS+=	-DJBIG_NO_MEMENTO
+CFLAGS.SunOS+=	-D_XOPEN_SOURCE=600
+
+.include "options.mk"
+
+# Remove thirdparty directory in order to use the libraries provided by pkgsrc
+# mujs directory is an exception and should not be removed (MuJS is the
+# default Javascript interpreter for mupdf).
+post-extract:
+	${RM} -fr \
+	    ${WRKSRC}/thirdparty/curl \
+	    ${WRKSRC}/thirdparty/freetype \
+	    ${WRKSRC}/thirdparty/glfw \
+	    ${WRKSRC}/thirdparty/harfbuzz \
+	    ${WRKSRC}/thirdparty/jbig2dec \
+	    ${WRKSRC}/thirdparty/jpeg \
+	    ${WRKSRC}/thirdparty/openjpeg \
+	    ${WRKSRC}/thirdparty/zlib
+
+post-build:
+	sed -e "s,@PREFIX@,${PREFIX}," ${FILESDIR}/mupdf.pc > ${WRKSRC}/mupdf.pc
+
+post-install:
+	${INSTALL_DATA} ${WRKSRC}/mupdf.pc ${DESTDIR}${PREFIX}/lib/pkgconfig
+
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../fonts/harfbuzz/buildlink3.mk"
+.include "../../graphics/freetype2/buildlink3.mk"
+.include "../../graphics/jbig2dec/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../graphics/openjpeg/buildlink3.mk"
+.include "../../graphics/png/buildlink3.mk"
+.include "../../x11/libXext/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/mupdf/PLIST b/mupdf/PLIST
new file mode 100644
index 0000000..6930363
--- /dev/null
+++ b/mupdf/PLIST
@@ -0,0 +1,96 @@
+@comment $NetBSD$
+bin/mujstest
+bin/mupdf
+bin/muraster
+bin/mutool
+include/mupdf/fitz.h
+include/mupdf/fitz/annotation.h
+include/mupdf/fitz/archive.h
+include/mupdf/fitz/bidi.h
+include/mupdf/fitz/bitmap.h
+include/mupdf/fitz/buffer.h
+include/mupdf/fitz/colorspace.h
+include/mupdf/fitz/compressed-buffer.h
+include/mupdf/fitz/config.h
+include/mupdf/fitz/context.h
+include/mupdf/fitz/crypt.h
+include/mupdf/fitz/device.h
+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/getopt.h
+include/mupdf/fitz/glyph-cache.h
+include/mupdf/fitz/glyph.h
+include/mupdf/fitz/hash.h
+include/mupdf/fitz/image.h
+include/mupdf/fitz/link.h
+include/mupdf/fitz/math.h
+include/mupdf/fitz/outline.h
+include/mupdf/fitz/output-pcl.h
+include/mupdf/fitz/output-png.h
+include/mupdf/fitz/output-pnm.h
+include/mupdf/fitz/output-ps.h
+include/mupdf/fitz/output-pwg.h
+include/mupdf/fitz/output-svg.h
+include/mupdf/fitz/output-tga.h
+include/mupdf/fitz/output.h
+include/mupdf/fitz/path.h
+include/mupdf/fitz/pixmap.h
+include/mupdf/fitz/pool.h
+include/mupdf/fitz/separation.h
+include/mupdf/fitz/shade.h
+include/mupdf/fitz/store.h
+include/mupdf/fitz/stream.h
+include/mupdf/fitz/string.h
+include/mupdf/fitz/structured-text.h
+include/mupdf/fitz/system.h
+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
+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
+include/mupdf/pdf/document.h
+include/mupdf/pdf/event.h
+include/mupdf/pdf/field.h
+include/mupdf/pdf/font.h
+include/mupdf/pdf/interpret.h
+include/mupdf/pdf/javascript.h
+include/mupdf/pdf/name-table.h
+include/mupdf/pdf/object.h
+include/mupdf/pdf/output-pdf.h
+include/mupdf/pdf/page.h
+include/mupdf/pdf/parse.h
+include/mupdf/pdf/resource.h
+include/mupdf/pdf/widget.h
+include/mupdf/pdf/xref.h
+include/mupdf/svg.h
+lib/libmupdf.la
+lib/libmupdfthird.la
+lib/libmutools.la
+lib/pkgconfig/mupdf.pc
+man/man1/mupdf.1
+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
diff --git a/mupdf/buildlink3.mk b/mupdf/buildlink3.mk
new file mode 100644
index 0000000..2d47b30
--- /dev/null
+++ b/mupdf/buildlink3.mk
@@ -0,0 +1,30 @@
+# $NetBSD: buildlink3.mk,v 1.12 2016/10/07 18:25:33 adam Exp $
+
+BUILDLINK_TREE+=	mupdf
+
+.if !defined(MUPDF_BUILDLINK3_MK)
+MUPDF_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.mupdf+=	mupdf>=1.10
+BUILDLINK_ABI_DEPENDS.mupdf?=	mupdf>=1.10
+BUILDLINK_PKGSRCDIR.mupdf?=	../../wip/mupdf
+
+pkgbase := mupdf
+.include "../../mk/pkg-build-options.mk"
+
+.if !empty(PKG_BUILD_OPTIONS.mupdf:Mcurl)
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.endif
+
+.if !empty(PKG_BUILD_OPTIONS.mupdf:Mglfw)
+.include "../../graphics/glut/buildlink3.mk"
+.include "../../graphics/glfw/buildlink3.mk"
+.endif
+
+.include "../../graphics/jbig2dec/buildlink3.mk"
+.include "../../graphics/openjpeg/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.endif	# MUPDF_BUILDLINK3_MK
+
+BUILDLINK_TREE+=	-mupdf
diff --git a/mupdf/distinfo b/mupdf/distinfo
new file mode 100644
index 0000000..e7fef47
--- /dev/null
+++ b/mupdf/distinfo
@@ -0,0 +1,12 @@
+$NetBSD: distinfo,v 1.27 2016/08/03 08:50:17 leot Exp $
+
+SHA1 (mupdf-1.10-source.tar.gz) = 570350f46c00fa091972832b620a43c1ae6a3408
+RMD160 (mupdf-1.10-source.tar.gz) = 49a66c9eb0cc8b11343b2dab0cb71155a415745a
+SHA512 (mupdf-1.10-source.tar.gz) = 91dc77f1f785c960a4f70ee3f617b1ddda32c85015eb053c004ab3a90b899634c7e08e7eaa617a6b7b41910bb5e7e9e725fe636890e94098db1d5b61ed2b3c43
+Size (mupdf-1.10-source.tar.gz) = 42265171 bytes
+SHA1 (patch-Makethird) = 0a5951d543755c42053013f03b1c573b5da9c82c
+SHA1 (patch-ab) = 7bee583086078359ce04eacd9db3b4f03737a7bb
+SHA1 (patch-ac) = d75afe8b05b85d042dc1baeaf8a9988f2e60338a
+SHA1 (patch-ae) = c6b113818b32cb4470e8549c00a16e0b2f364ede
+SHA1 (patch-source_fitz_load-jpx.c) = fbe6814536d37835a4daa5bb90b1f6cf8698f807
+SHA1 (patch-thirdparty_mujs_Makefile) = f1da7cdf2c9e2e4bbac3e80ef486204a39b27e34
diff --git a/mupdf/files/mupdf.pc b/mupdf/files/mupdf.pc
new file mode 100644
index 0000000..c34f5dc
--- /dev/null
+++ b/mupdf/files/mupdf.pc
@@ -0,0 +1,10 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: mupdf
+Description: library for PDF files
+Version: 1.9a
+Libs: -Wl,-R${libdir} -L${libdir} -lmupdf
+Cflags: -I${includedir}
diff --git a/mupdf/options.mk b/mupdf/options.mk
new file mode 100644
index 0000000..a8a22fb
--- /dev/null
+++ b/mupdf/options.mk
@@ -0,0 +1,25 @@
+# $NetBSD: options.mk,v 1.4 2016/02/04 11:50:24 leot Exp $
+
+PKG_OPTIONS_VAR=	PKG_OPTIONS.mupdf
+PKG_SUPPORTED_OPTIONS=	curl glfw
+
+.include "../../mk/bsd.options.mk"
+
+PLIST_VARS+=		glfw
+
+#
+# curl support
+#
+.if !empty(PKG_OPTIONS:Mcurl)
+.include "../../www/curl/buildlink3.mk"
+.include "../../mk/pthread.buildlink3.mk"
+.endif
+
+#
+# glfw support
+#
+.if !empty(PKG_OPTIONS:Mglfw)
+PLIST.glfw=	yes
+.include "../../graphics/glut/buildlink3.mk"
+.include "../../graphics/glfw/buildlink3.mk"
+.endif
diff --git a/mupdf/patches/patch-Makethird b/mupdf/patches/patch-Makethird
new file mode 100644
index 0000000..6c5db23
--- /dev/null
+++ b/mupdf/patches/patch-Makethird
@@ -0,0 +1,23 @@
+$NetBSD: patch-Makethird,v 1.6 2016/04/27 12:34:58 leot Exp $
+
+o mujs building support with libtool
+
+--- Makethird.orig	2016-04-06 12:06:53.000000000 +0000
++++ Makethird
+@@ -24,13 +24,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" "
+ MUJS_OUT := $(OUT)/mujs
+ MUJS_SRC := one.c
+ 
+-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)
+ 	$(CC_CMD)
+ 
+ MUJS_CFLAGS := -I$(MUJS_DIR)
diff --git a/mupdf/patches/patch-ab b/mupdf/patches/patch-ab
new file mode 100644
index 0000000..7ef3d9d
--- /dev/null
+++ b/mupdf/patches/patch-ab
@@ -0,0 +1,86 @@
+$NetBSD: patch-ab,v 1.12 2016/04/27 12:34:58 leot Exp $
+
+o Handle the various operating systems in the same way avoiding hardcoding
+o Properly recognize glfw support
+
+--- Makerules.orig	2016-11-21 10:21:11.000000000 +0000
++++ Makerules
+@@ -60,51 +60,6 @@ ifeq "$(largefile)" "yes"
+ CFLAGS += -DFZ_LARGEFILE
+ endif
+ 
+-# Windows (MINGW) build doesn't use system libraries.
+-ifeq "$(OS)" "MINGW"
+-
+-WINDRES = windres
+-HAVE_X11 ?= no
+-HAVE_WIN32 = yes
+-CC=gcc
+-# Add flags required for Harfbuzz because of missing strdup
+-CFLAGS+= -U__STRICT_ANSI__
+-
+-# Mac OS X doesn't have pkg-config so we hard code paths.
+-else ifeq "$(OS)" "MACOS"
+-
+-HAVE_X11 ?= no
+-HAVE_PTHREADS ?= yes
+-
+-# 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_JPEG_LIBS = -ljpeg
+-SYS_ZLIB_LIBS = -lz
+-
+-CC = xcrun cc
+-AR = xcrun ar
+-LD = xcrun ld
+-RANLIB_CMD = xcrun ranlib $@
+-
+-# Linux uses pkg-config for system libraries.
+-else ifeq "$(OS)" "Linux"
+-
+ HAVE_PTHREADS ?= yes
+ 
+ ifeq "$(shell pkg-config --exists libcrypto && echo yes)" "yes"
+@@ -131,6 +86,17 @@ SYS_X11_CFLAGS = $(shell pkg-config --cf
+ SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
+ endif
+ 
++ifeq "$(shell pkg-config --exists glut && echo yes)" "yes"
++SYS_GLUT_CFLAGS = $(shell pkg-config --cflags glut)
++SYS_GLUT_LIBS = $(shell pkg-config --libs glut)
++endif
++
++ifeq "$(shell pkg-config --exists glfw3 && echo yes)" "yes"
++HAVE_GLFW = yes
++SYS_GLFW_CFLAGS = $(shell pkg-config --cflags glfw3)
++SYS_GLFW_LIBS = $(shell pkg-config --libs glfw3)
++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)
+@@ -150,8 +116,6 @@ SYS_JBIG2DEC_LIBS = -ljbig2dec
+ SYS_JPEG_LIBS = -ljpeg
+ SYS_ZLIB_LIBS = -lz
+ 
+-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.
diff --git a/mupdf/patches/patch-ac b/mupdf/patches/patch-ac
new file mode 100644
index 0000000..3150556
--- /dev/null
+++ b/mupdf/patches/patch-ac
@@ -0,0 +1,289 @@
+$NetBSD: patch-ac,v 1.14 2016/04/27 12:34:58 leot Exp $
+
+o libtool support 
+o Install target cleanup
+o Do not force `-O0' flag when building
+o Install MUTOOL_LIB as part of INSTALL_LIBS
+o Install only one "mupdf" binary, prefer the featureful one and always
+  install it as "mupdf"
+
+--- Makefile.orig	2016-11-21 10:21:11.000000000 +0000
++++ Makefile
+@@ -42,26 +42,12 @@ CFLAGS += $(ZLIB_CFLAGS)
+ 
+ # --- 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
+-
+-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) -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 $@
+ 
+ # --- File lists ---
+ 
+@@ -98,13 +84,13 @@ SVG_SRC_HDR := $(wildcard source/svg/*.h
+ HTML_SRC_HDR := $(wildcard source/html/*.h)
+ GPRF_SRC_HDR := $(wildcard source/gprf/*.h)
+ 
+-FITZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(FITZ_SRC))))
+-PDF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(PDF_SRC))))
+-XPS_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(XPS_SRC))))
+-SVG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(SVG_SRC))))
+-CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(CBZ_SRC))))
+-HTML_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(HTML_SRC))))
+-GPRF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(GPRF_SRC))))
++FITZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(FITZ_SRC))))
++PDF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(PDF_SRC))))
++XPS_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(XPS_SRC))))
++SVG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(SVG_SRC))))
++CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(CBZ_SRC))))
++HTML_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(HTML_SRC))))
++GPRF_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(GPRF_SRC))))
+ 
+ $(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR)
+ $(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR)
+@@ -130,7 +116,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)
+-FONT_OBJ := $(subst $(GEN)/, $(OUT)/fonts/, $(addsuffix .o, $(basename $(FONT_GEN))))
++FONT_OBJ := $(subst $(GEN)/, $(OUT)/fonts/, $(addsuffix .lo, $(basename $(FONT_GEN))))
+ 
+ $(GEN)/%.c : resources/fonts/droid/%.ttf $(FONTDUMP)
+ 	$(QUIET_GEN) $(FONTDUMP) $@ $<
+@@ -152,8 +138,8 @@ $(FONT_GEN_SIL) : $(FONT_BIN_SIL)
+ 
+ # --- Library ---
+ 
+-MUPDF_LIB = $(OUT)/libmupdf.a
+-THIRD_LIB = $(OUT)/libmupdfthird.a
++MUPDF_LIB = $(OUT)/libmupdf.la
++THIRD_LIB = $(OUT)/libmupdfthird.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) $(JPEG_OBJ) $(JPEGXR_OBJ) $(LURATECH_OBJ) $(MUJS_OBJ) $(OPENJPEG_OBJ) $(ZLIB_OBJ)
+@@ -168,39 +154,39 @@ INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB
+ $(ALL_DIR) $(OUT) $(GEN) :
+ 	$(MKDIR_CMD)
+ 
+-$(OUT)/%.a :
++$(OUT)/%.la :
+ 	$(RM_CMD)
+ 	$(AR_CMD)
+ 	$(RANLIB_CMD)
+ 
+-$(OUT)/%: $(OUT)/%.o
++$(OUT)/%: $(OUT)/%.lo
+ 	$(LINK_CMD)
+ 
+-$(OUT)/%.o : source/%.c | $(ALL_DIR)
++$(OUT)/%.lo : source/%.c | $(ALL_DIR)
+ 	$(CC_CMD)
+ 
+-$(OUT)/%.o : source/%.cpp | $(ALL_DIR)
++$(OUT)/%.lo : source/%.cpp | $(ALL_DIR)
+ 	$(CXX_CMD)
+ 
+-$(OUT)/%.o : scripts/%.c | $(OUT)
++$(OUT)/%.lo : scripts/%.c | $(OUT)
+ 	$(CC_CMD)
+ 
+-$(OUT)/fonts/%.o : $(GEN)/%.c | $(ALL_DIR)
+-	$(CC_CMD) -O0
++$(OUT)/fonts/%.lo : $(GEN)/%.c | $(ALL_DIR)
++	$(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/%.rc | $(OUT)
++$(OUT)/platform/x11/%.lo: platform/x11/%.rc | $(OUT)
+ 	$(WINDRES_CMD)
+ 
+-$(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) $(GLFW_CFLAGS)
+ 
+-.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules
++.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules
+ 
+ # --- Generated CMap and JavaScript files ---
+ 
+@@ -251,51 +237,53 @@ endif
+ 
+ generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN) $(NAME_GEN)
+ 
+-$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN)
+-$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN)
+-$(OUT)/pdf/pdf-js.o : $(JAVASCRIPT_GEN)
+-$(OUT)/pdf/pdf-object.o : source/pdf/pdf-name-table.h
+-$(OUT)/cmapdump.o : include/mupdf/pdf/cmap.h source/fitz/context.c source/fitz/error.c source/fitz/memory.c source/fitz/output.c source/fitz/string.c source/fitz/buffer.c source/fitz/stream-open.c source/fitz/stream-read.c source/fitz/strtod.c source/fitz/strtof.c source/fitz/ftoa.c source/fitz/printf.c source/fitz/time.c source/pdf/pdf-lex.c source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c source/pdf/pdf-name-table.h
++$(OUT)/pdf/pdf-cmap-table.lo : $(CMAP_GEN)
++$(OUT)/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN)
++$(OUT)/pdf/pdf-js.lo : $(JAVASCRIPT_GEN)
++$(OUT)/pdf/pdf-object.lo : source/pdf/pdf-name-table.h
++$(OUT)/cmapdump.lo : include/mupdf/pdf/cmap.h source/fitz/context.c source/fitz/error.c source/fitz/memory.c source/fitz/output.c source/fitz/string.c source/fitz/buffer.c source/fitz/stream-open.c source/fitz/stream-read.c source/fitz/strtod.c source/fitz/strtof.c source/fitz/ftoa.c source/fitz/printf.c source/fitz/time.c source/pdf/pdf-lex.c source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c source/pdf/pdf-name-table.h
+ 
+ # --- Tools and Apps ---
+ 
+ MUTOOL := $(OUT)/mutool
+-MUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.o muconvert.o mudraw.o murun.o)
+-MUTOOL_OBJ += $(addprefix $(OUT)/tools/, pdfclean.o pdfcreate.o pdfextract.o pdfinfo.o pdfmerge.o pdfposter.o pdfpages.o pdfshow.o)
++MUTOOL_OBJ := $(addprefix $(OUT)/tools/, mutool.lo muconvert.lo mudraw.lo murun.lo)
++MUTOOL_OBJ += $(addprefix $(OUT)/tools/, pdfclean.lo pdfcreate.lo pdfextract.lo pdfinfo.lo pdfmerge.lo pdfposter.lo pdfpages.lo pdfshow.lo)
+ $(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)
+-MUTOOL_LIB = $(OUT)/libmutools.a
++MUTOOL_LIB = $(OUT)/libmutools.la
+ $(MUTOOL_LIB) : $(MUTOOL_OBJ)
+ $(MUTOOL) : $(MUTOOL_LIB) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD)
+ 
++INSTALL_LIBS += $(MUTOOL_LIB)
++
+ MURASTER := $(OUT)/muraster
+-MURASTER_OBJ := $(addprefix $(OUT)/tools/, muraster.o)
++MURASTER_OBJ := $(addprefix $(OUT)/tools/, muraster.lo)
+ $(MURASTER_OBJ): $(FITZ_HDR)
+ $(MURASTER) : $(MURASTER_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD)
+ 
+ MJSGEN := $(OUT)/mjsgen
+-MJSGEN_OBJ := $(addprefix $(OUT)/tools/, mjsgen.o)
++MJSGEN_OBJ := $(addprefix $(OUT)/tools/, mjsgen.lo)
+ $(MUTOOL_OBJ): $(FITZ_HDR) $(PDF_HDR)
+ $(MJSGEN) : $(MJSGEN_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD)
+ 
+ MUJSTEST := $(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) : $(MUJSTEST_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD)
+ 
+ ifeq "$(HAVE_X11)" "yes"
+-MUVIEW_X11 := $(OUT)/mupdf-x11
+-MUVIEW_X11_OBJ := $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o)
++MUVIEW_X11 := $(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) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD) $(X11_LIBS)
+ 
+ ifeq "$(HAVE_CURL)" "yes"
+-MUVIEW_X11_CURL := $(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 := $(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) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB)
+ 	$(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS)
+@@ -303,8 +291,8 @@ endif
+ endif
+ 
+ ifeq "$(HAVE_GLFW)" "yes"
+-MUVIEW_GLFW := $(OUT)/mupdf-gl
+-MUVIEW_GLFW_OBJ := $(addprefix $(OUT)/platform/gl/, gl-font.o gl-input.o gl-main.o)
++MUVIEW_GLFW := $(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) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB)
+ 	$(LINK_CMD) $(GLFW_LIBS)
+@@ -312,16 +300,25 @@ endif
+ 
+ ifeq "$(HAVE_WIN32)" "yes"
+ MUVIEW_WIN32 := $(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) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB)
+ 	$(LINK_CMD) $(WIN32_LIBS)
+ endif
+ 
+-MUVIEW := $(MUVIEW_X11) $(MUVIEW_WIN32) $(MUVIEW_GLFW)
++MUVIEW := $(MUVIEW_X11) $(MUVIEW_WIN32)
+ MUVIEW_CURL := $(MUVIEW_X11_CURL) $(MUVIEW_WIN32_CURL)
+ 
+-INSTALL_APPS := $(MUTOOL) $(MUVIEW) $(MURASTER) $(MUJSTEST) $(MUVIEW_CURL)
++INSTALL_APPS := $(MUTOOL) $(MURASTER) $(MUJSTEST)
++ifeq "$(HAVE_CURL)" "yes"
++INSTALL_APPS += $(MUVIEW_CURL)
++else ifeq "$(HAVE_X11)" "yes"
++INSTALL_APPS += $(MUVIEW)
++endif
++
++ifeq "$(HAVE_GLFW)" "yes"
++INSTALL_APPS += $(MUVIEW_GLFW)
++endif
+ 
+ # --- Examples ---
+ 
+@@ -364,24 +361,26 @@ libs: $(INSTALL_LIBS)
+ apps: $(INSTALL_APPS)
+ 
+ install: libs apps
+-	install -d $(DESTDIR)$(incdir)/mupdf
+-	install -d $(DESTDIR)$(incdir)/mupdf/fitz
+-	install -d $(DESTDIR)$(incdir)/mupdf/pdf
+-	install include/mupdf/*.h $(DESTDIR)$(incdir)/mupdf
+-	install include/mupdf/fitz/*.h $(DESTDIR)$(incdir)/mupdf/fitz
+-	install include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
+-
+-	install -d $(DESTDIR)$(libdir)
+-	install $(INSTALL_LIBS) $(DESTDIR)$(libdir)
+-
+-	install -d $(DESTDIR)$(bindir)
+-	install $(INSTALL_APPS) $(DESTDIR)$(bindir)
++	${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
++	${BSD_INSTALL_DATA} include/mupdf/pdf/*.h $(DESTDIR)$(incdir)/mupdf/pdf
++
++	${BSD_INSTALL_LIB_DIR} $(DESTDIR)$(libdir)
++	for f in $(INSTALL_LIBS); do \
++		${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} $$f $(DESTDIR)$(libdir); \
++	done
++
++	${BSD_INSTALL_PROGRAM_DIR} $(DESTDIR)$(bindir)
++	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)
+ 
+ tarball:
+ 	bash scripts/archive.sh
diff --git a/mupdf/patches/patch-ae b/mupdf/patches/patch-ae
new file mode 100644
index 0000000..41a0419
--- /dev/null
+++ b/mupdf/patches/patch-ae
@@ -0,0 +1,82 @@
+$NetBSD: patch-ae,v 1.5 2016/02/04 11:50:24 leot Exp $
+
+Avoid namespace conflicts with bswap(3).
+
+--- source/fitz/crypt-sha2.c.orig	2015-11-10 16:19:51.000000000 +0000
++++ source/fitz/crypt-sha2.c
+@@ -17,7 +17,7 @@ static inline int isbigendian(void)
+ 	return *(char*)&one == 0;
+ }
+ 
+-static inline unsigned int bswap32(unsigned int num)
++static inline unsigned int mup_bswap32(unsigned int num)
+ {
+ 	return	( (((num) << 24))
+ 		| (((num) << 8) & 0x00FF0000)
+@@ -25,7 +25,7 @@ static inline unsigned int bswap32(unsig
+ 		| (((num) >> 24)) );
+ }
+ 
+-static inline uint64_t bswap64(uint64_t num)
++static inline uint64_t mup_bswap64(uint64_t num)
+ {
+ 	return ( (((num) << 56))
+ 		| (((num) << 40) & 0x00FF000000000000ULL)
+@@ -99,7 +99,7 @@ transform256(unsigned int state[8], unsi
+ 	/* ensure big-endian integers */
+ 	if (!isbigendian())
+ 		for (j = 0; j < 16; j++)
+-			data[j] = bswap32(data[j]);
++			data[j] = mup_bswap32(data[j]);
+ 
+ 	/* Copy state[] to working vars. */
+ 	memcpy(T, state, sizeof(T));
+@@ -192,8 +192,8 @@ void fz_sha256_final(fz_sha256 *context,
+ 
+ 	if (!isbigendian())
+ 	{
+-		context->buffer.u32[14] = bswap32(context->count[1]);
+-		context->buffer.u32[15] = bswap32(context->count[0]);
++		context->buffer.u32[14] = mup_bswap32(context->count[1]);
++		context->buffer.u32[15] = mup_bswap32(context->count[0]);
+ 	}
+ 	else
+ 	{
+@@ -204,7 +204,7 @@ void fz_sha256_final(fz_sha256 *context,
+ 
+ 	if (!isbigendian())
+ 		for (j = 0; j < 8; j++)
+-			context->state[j] = bswap32(context->state[j]);
++			context->state[j] = mup_bswap32(context->state[j]);
+ 
+ 	memcpy(digest, &context->state[0], 32);
+ 	memset(context, 0, sizeof(fz_sha256));
+@@ -271,7 +271,7 @@ transform512(uint64_t state[8], uint64_t
+ 	/* ensure big-endian integers */
+ 	if (!isbigendian())
+ 		for (j = 0; j < 16; j++)
+-			data[j] = bswap64(data[j]);
++			data[j] = mup_bswap64(data[j]);
+ 
+ 	/* Copy state[] to working vars. */
+ 	memcpy(T, state, sizeof(T));
+@@ -364,8 +364,8 @@ void fz_sha512_final(fz_sha512 *context,
+ 
+ 	if (!isbigendian())
+ 	{
+-		context->buffer.u64[14] = bswap64(context->count[1]);
+-		context->buffer.u64[15] = bswap64(context->count[0]);
++		context->buffer.u64[14] = mup_bswap64(context->count[1]);
++		context->buffer.u64[15] = mup_bswap64(context->count[0]);
+ 	}
+ 	else
+ 	{
+@@ -376,7 +376,7 @@ void fz_sha512_final(fz_sha512 *context,
+ 
+ 	if (!isbigendian())
+ 		for (j = 0; j < 8; j++)
+-			context->state[j] = bswap64(context->state[j]);
++			context->state[j] = mup_bswap64(context->state[j]);
+ 
+ 	memcpy(digest, &context->state[0], 64);
+ 	memset(context, 0, sizeof(fz_sha512));
diff --git a/mupdf/patches/patch-source_fitz_load-jpx.c b/mupdf/patches/patch-source_fitz_load-jpx.c
new file mode 100644
index 0000000..a09eac7
--- /dev/null
+++ b/mupdf/patches/patch-source_fitz_load-jpx.c
@@ -0,0 +1,16 @@
+$NetBSD$
+
+Restrict OPJ_STATIC to Windows (avoid linking errors due to hidden symbols)
+
+--- source/fitz/load-jpx.c.orig	2016-11-08 19:06:14.000000000 +0000
++++ source/fitz/load-jpx.c
+@@ -484,7 +484,9 @@ fz_load_jpx_info(fz_context *ctx, unsign
+ /* Without the definition of OPJ_STATIC, compilation fails on windows
+  * due to the use of __stdcall. We believe it is required on some
+  * linux toolchains too. */
++#ifdef _WIN32
+ #define OPJ_STATIC
++#endif
+ #ifndef _MSC_VER
+ #define OPJ_HAVE_STDINT_H
+ #endif
diff --git a/mupdf/patches/patch-thirdparty_mujs_Makefile b/mupdf/patches/patch-thirdparty_mujs_Makefile
new file mode 100644
index 0000000..334af5c
--- /dev/null
+++ b/mupdf/patches/patch-thirdparty_mujs_Makefile
@@ -0,0 +1,47 @@
+$NetBSD: patch-thirdparty_mujs_Makefile,v 1.1 2016/04/27 12:34:58 leot Exp $
+
+o Add libtool support lo mujs.
+o Avoid to set (unused) VERSION variable.
+
+--- thirdparty/mujs/Makefile.orig	2016-03-01 20:52:00.000000000 +0000
++++ thirdparty/mujs/Makefile
+@@ -41,16 +41,16 @@ jsdump.c: astnames.h opnames.h
+ build:
+ 	mkdir -p build
+ 
+-build/%.o: %.c $(HDRS)
++build/%.lo: %.c $(HDRS)
+ 	$(CC) $(CFLAGS) -o $@ -c $<
+ 
+-build/libmujs.a: $(OBJS)
++build/libmujs.la: $(OBJS)
+ 	$(AR) cru $@ $^
+ 
+-build/mujs: build/main.o build/libmujs.a
++build/mujs: build/main.lo build/libmujs.la
+ 	$(CC) $(LDFLAGS) -o $@ $^ -lm
+ 
+-build/mujsone: build/main.o build/one.o
++build/mujsone: build/main.o build/one.lo
+ 	$(CC) $(LDFLAGS) -o $@ $^ -lm
+ 
+ install: release
+@@ -61,12 +61,12 @@ install: release
+ 	install build/libmujs.a $(DESTDIR)$(libdir)
+ 	install build/mujs $(DESTDIR)$(bindir)
+ 
+-VERSION = $(shell git describe --tags --always)
+-
+-tarball:
+-	git archive --format=zip --prefix=mujs-$(VERSION)/ HEAD > mujs-$(VERSION).zip
+-	git archive --format=tar --prefix=mujs-$(VERSION)/ HEAD | gzip > mujs-$(VERSION).tar.gz
+-	git archive --format=tar --prefix=mujs-$(VERSION)/ HEAD | xz > mujs-$(VERSION).tar.xz
++#VERSION = $(shell git describe --tags --always)
++#
++#tarball:
++#	git archive --format=zip --prefix=mujs-$(VERSION)/ HEAD > mujs-$(VERSION).zip
++#	git archive --format=tar --prefix=mujs-$(VERSION)/ HEAD | gzip > mujs-$(VERSION).tar.gz
++#	git archive --format=tar --prefix=mujs-$(VERSION)/ HEAD | xz > mujs-$(VERSION).tar.xz
+ 
+ tags: $(SRCS) main.c $(HDRS)
+ 	ctags $^


Home | Main Index | Thread Index | Old Index