diff options
author | leot <leot@pkgsrc.org> | 2017-04-12 13:03:08 +0000 |
---|---|---|
committer | leot <leot@pkgsrc.org> | 2017-04-12 13:03:08 +0000 |
commit | 361e9d8fe3f3186a456003079ad9b2b399533006 (patch) | |
tree | b04b00c1d7a7fc9ebb1921c499adb0eba1697305 /print/mupdf | |
parent | 0984875cbe9d5281bd60b3744255342cd5701ad3 (diff) | |
download | pkgsrc-361e9d8fe3f3186a456003079ad9b2b399533006.tar.gz |
Update print/mupdf to 1.11
Changes:
List of changes in MuPDF 1.11
-----------------------------
* This is primarily a bug fix release.
* Split Android and iOS viewers into separate projects:
- mupdf-viewer-ios.git has the iOS viewer.
- mupdf-viewer-android-old.git has the Android viewer.
- mupdf-viewer-android-nui.git has a new advanced Android viewer.
- mupdf-viewer-android-mini.git has a new minimalist Android viewer.
* PDF portfolio support with command line tool "mutool portfolio".
* Add callbacks to load fallback fonts from the system.
* Use system fonts in Android to reduce install size.
* Flag to disable publisher styles in EPUB layout.
* Improved SVG output.
Diffstat (limited to 'print/mupdf')
-rw-r--r-- | print/mupdf/Makefile | 8 | ||||
-rw-r--r-- | print/mupdf/PLIST | 9 | ||||
-rw-r--r-- | print/mupdf/buildlink3.mk | 9 | ||||
-rw-r--r-- | print/mupdf/distinfo | 24 | ||||
-rw-r--r-- | print/mupdf/files/mupdf.pc | 4 | ||||
-rw-r--r-- | print/mupdf/options.mk | 6 | ||||
-rw-r--r-- | print/mupdf/patches/patch-Makethird | 8 | ||||
-rw-r--r-- | print/mupdf/patches/patch-ab | 86 | ||||
-rw-r--r-- | print/mupdf/patches/patch-ac | 303 | ||||
-rw-r--r-- | print/mupdf/patches/patch-source_fitz_load-jpx.c | 18 | ||||
-rw-r--r-- | print/mupdf/patches/patch-source_fitz_pixmap.c | 44 | ||||
-rw-r--r-- | print/mupdf/patches/patch-source_tools_mudraw.c | 17 | ||||
-rw-r--r-- | print/mupdf/patches/patch-thirdparty_mujs_Makefile | 22 | ||||
-rw-r--r-- | print/mupdf/patches/patch-thirdparty_mujs_jsdate.c | 27 | ||||
-rw-r--r-- | print/mupdf/patches/patch-thirdparty_mujs_jsrun.c | 21 |
15 files changed, 279 insertions, 327 deletions
diff --git a/print/mupdf/Makefile b/print/mupdf/Makefile index a951aab99ad..32ba9551597 100644 --- a/print/mupdf/Makefile +++ b/print/mupdf/Makefile @@ -1,8 +1,7 @@ -# $NetBSD: Makefile,v 1.47 2017/02/12 06:24:48 ryoon Exp $ +# $NetBSD: Makefile,v 1.48 2017/04/12 13:03:08 leot Exp $ -DISTNAME= mupdf-1.10a-source +DISTNAME= mupdf-1.11-source PKGNAME= ${DISTNAME:S/-source//} -PKGREVISION= 5 CATEGORIES= print MASTER_SITES= http://mupdf.com/downloads/archive/ @@ -38,7 +37,7 @@ post-extract: ${WRKSRC}/thirdparty/glfw \ ${WRKSRC}/thirdparty/harfbuzz \ ${WRKSRC}/thirdparty/jbig2dec \ - ${WRKSRC}/thirdparty/jpeg \ + ${WRKSRC}/thirdparty/libjpeg \ ${WRKSRC}/thirdparty/openjpeg \ ${WRKSRC}/thirdparty/zlib @@ -53,6 +52,7 @@ post-install: .include "../../graphics/freetype2/buildlink3.mk" .include "../../graphics/jbig2dec/buildlink3.mk" .include "../../mk/jpeg.buildlink3.mk" +.include "../../mk/pthread.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 264f41c8e13..a1792f0a872 100644 --- a/print/mupdf/PLIST +++ b/print/mupdf/PLIST @@ -1,4 +1,4 @@ -@comment $NetBSD: PLIST,v 1.13 2016/11/28 14:40:42 leot Exp $ +@comment $NetBSD: PLIST,v 1.14 2017/04/12 13:03:08 leot Exp $ bin/mujstest bin/mupdf ${PLIST.glfw}bin/mupdf-gl @@ -7,6 +7,7 @@ bin/mutool include/mupdf/fitz.h include/mupdf/fitz/annotation.h include/mupdf/fitz/archive.h +include/mupdf/fitz/band-writer.h include/mupdf/fitz/bidi.h include/mupdf/fitz/bitmap.h include/mupdf/fitz/buffer.h @@ -21,13 +22,13 @@ 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 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 @@ -44,7 +45,7 @@ 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/string-util.h include/mupdf/fitz/structured-text.h include/mupdf/fitz/system.h include/mupdf/fitz/text.h @@ -82,7 +83,7 @@ include/mupdf/pdf/xref.h include/mupdf/svg.h lib/libmupdf.la lib/libmupdfthird.la -lib/libmutools.la +lib/libmuthreads.la lib/pkgconfig/mupdf.pc man/man1/mupdf.1 man/man1/mutool.1 diff --git a/print/mupdf/buildlink3.mk b/print/mupdf/buildlink3.mk index 732f74f0bf4..180400bcca3 100644 --- a/print/mupdf/buildlink3.mk +++ b/print/mupdf/buildlink3.mk @@ -1,12 +1,11 @@ -# $NetBSD: buildlink3.mk,v 1.17 2017/02/12 06:24:48 ryoon Exp $ +# $NetBSD: buildlink3.mk,v 1.18 2017/04/12 13:03:08 leot Exp $ BUILDLINK_TREE+= mupdf .if !defined(MUPDF_BUILDLINK3_MK) MUPDF_BUILDLINK3_MK:= -BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.10a -BUILDLINK_ABI_DEPENDS.mupdf?= mupdf>=1.10anb5 +BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.11 BUILDLINK_PKGSRCDIR.mupdf?= ../../print/mupdf pkgbase := mupdf @@ -14,11 +13,10 @@ pkgbase := mupdf .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/MesaLib/buildlink3.mk" .include "../../graphics/glfw/buildlink3.mk" .endif @@ -29,6 +27,7 @@ pkgbase := mupdf .include "../../graphics/openjpeg/buildlink3.mk" .include "../../graphics/png/buildlink3.mk" .include "../../mk/jpeg.buildlink3.mk" +.include "../../mk/pthread.buildlink3.mk" .endif # MUPDF_BUILDLINK3_MK BUILDLINK_TREE+= -mupdf diff --git a/print/mupdf/distinfo b/print/mupdf/distinfo index f490cc368df..7be3623b244 100644 --- a/print/mupdf/distinfo +++ b/print/mupdf/distinfo @@ -1,16 +1,12 @@ -$NetBSD: distinfo,v 1.31 2017/02/11 09:39:05 leot Exp $ +$NetBSD: distinfo,v 1.32 2017/04/12 13:03:08 leot Exp $ -SHA1 (mupdf-1.10a-source.tar.gz) = 1c3a6e1d4406912004b8e2c09435199e6b425191 -RMD160 (mupdf-1.10a-source.tar.gz) = bfb482681c6804db8a0fd9ec46b16ac6f9fffdf2 -SHA512 (mupdf-1.10a-source.tar.gz) = 8c735963364985e74ceb38242afae555a3d2ee7c69abe3fe5c485e8613a83d996a58f231cb689a156019d431fa67d565503247d010b0a404054850483aed9fec -Size (mupdf-1.10a-source.tar.gz) = 42264707 bytes -SHA1 (patch-Makethird) = 0a5951d543755c42053013f03b1c573b5da9c82c -SHA1 (patch-ab) = 7bee583086078359ce04eacd9db3b4f03737a7bb -SHA1 (patch-ac) = d75afe8b05b85d042dc1baeaf8a9988f2e60338a +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-Makethird) = a4d1bb3c8d509a84803c9b60521fd9b6b17b9717 +SHA1 (patch-ab) = d348b41bf3c35c78c22e9816d860f1894910b2c9 +SHA1 (patch-ac) = 9b0c368d05a436f94118efce517fea69c82898e7 SHA1 (patch-ae) = c6b113818b32cb4470e8549c00a16e0b2f364ede -SHA1 (patch-source_fitz_load-jpx.c) = fbe6814536d37835a4daa5bb90b1f6cf8698f807 -SHA1 (patch-source_fitz_pixmap.c) = d0b3e44780fd64381424e367e5233ce1013dc974 -SHA1 (patch-source_tools_mudraw.c) = 99b827e39767559a8d5b6b380f0bbb100f5125e7 -SHA1 (patch-thirdparty_mujs_Makefile) = f1da7cdf2c9e2e4bbac3e80ef486204a39b27e34 -SHA1 (patch-thirdparty_mujs_jsdate.c) = 020fcb9d1e77bd7ba10943070673d53bbcee573b -SHA1 (patch-thirdparty_mujs_jsrun.c) = 79f730436b1f67780468c10096d3dbfb5e14d5a5 +SHA1 (patch-source_fitz_load-jpx.c) = 773ec1ef6b1632a10ff7c8ff76081e89bdcad593 +SHA1 (patch-thirdparty_mujs_Makefile) = cd6a20d56020ae5028f95e24e75f5e4a62127f9f diff --git a/print/mupdf/files/mupdf.pc b/print/mupdf/files/mupdf.pc index d9c22e0ea9d..80d03bc1df4 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.10a -Libs: -Wl,-R${libdir} -L${libdir} -lmupdf +Version: 1.11 +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 a8a22fb9e11..fce0fd513c4 100644 --- a/print/mupdf/options.mk +++ b/print/mupdf/options.mk @@ -1,4 +1,4 @@ -# $NetBSD: options.mk,v 1.4 2016/02/04 11:50:24 leot Exp $ +# $NetBSD: options.mk,v 1.5 2017/04/12 13:03:08 leot Exp $ PKG_OPTIONS_VAR= PKG_OPTIONS.mupdf PKG_SUPPORTED_OPTIONS= curl glfw @@ -12,7 +12,6 @@ PLIST_VARS+= glfw # .if !empty(PKG_OPTIONS:Mcurl) .include "../../www/curl/buildlink3.mk" -.include "../../mk/pthread.buildlink3.mk" .endif # @@ -20,6 +19,7 @@ PLIST_VARS+= glfw # .if !empty(PKG_OPTIONS:Mglfw) PLIST.glfw= yes -.include "../../graphics/glut/buildlink3.mk" +.include "../../graphics/MesaLib/buildlink3.mk" +BUILDLINK_API_DEPENDS.glfw+= glfw>=3.2.1 .include "../../graphics/glfw/buildlink3.mk" .endif diff --git a/print/mupdf/patches/patch-Makethird b/print/mupdf/patches/patch-Makethird index 6c5db234ec4..8cc007fff9f 100644 --- a/print/mupdf/patches/patch-Makethird +++ b/print/mupdf/patches/patch-Makethird @@ -1,11 +1,11 @@ -$NetBSD: patch-Makethird,v 1.6 2016/04/27 12:34:58 leot Exp $ +$NetBSD: patch-Makethird,v 1.7 2017/04/12 13:03:08 leot Exp $ o mujs building support with libtool ---- Makethird.orig 2016-04-06 12:06:53.000000000 +0000 +--- Makethird.orig 2017-03-31 14:23:45.000000000 +0000 +++ Makethird -@@ -24,13 +24,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" " - MUJS_OUT := $(OUT)/mujs +@@ -26,13 +26,13 @@ ifneq "$(wildcard $(MUJS_DIR)/README)" " + MUJS_OUT := $(OUT)/thirdparty/mujs MUJS_SRC := one.c -MUJS_OBJ := $(addprefix $(MUJS_OUT)/, $(MUJS_SRC:%.c=%.o)) diff --git a/print/mupdf/patches/patch-ab b/print/mupdf/patches/patch-ab index e5a5e25841f..7eb99de569e 100644 --- a/print/mupdf/patches/patch-ab +++ b/print/mupdf/patches/patch-ab @@ -1,20 +1,20 @@ -$NetBSD: patch-ab,v 1.13 2016/11/28 14:40:42 leot Exp $ +$NetBSD: patch-ab,v 1.14 2017/04/12 13:03:08 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.orig 2017-04-05 11:02:21.000000000 +0000 +++ Makerules -@@ -60,51 +60,6 @@ ifeq "$(largefile)" "yes" +@@ -64,54 +64,6 @@ ifeq "$(largefile)" "yes" CFLAGS += -DFZ_LARGEFILE endif -# Windows (MINGW) build doesn't use system libraries. -ifeq "$(OS)" "MINGW" - --WINDRES = windres +-WINDRES := windres -HAVE_X11 ?= no --HAVE_WIN32 = yes +-HAVE_WIN32 := yes -CC=gcc -# Add flags required for Harfbuzz because of missing strdup -CFLAGS+= -U__STRICT_ANSI__ @@ -23,61 +23,61 @@ o Properly recognize glfw support -else ifeq "$(OS)" "MACOS" - -HAVE_X11 ?= no --HAVE_PTHREADS ?= yes +- +-HAVE_PTHREAD := yes +-SYS_PTHREAD_CFLAGS := +-SYS_PTHREAD_LIBS := -lpthread - -# Mac OS X deprecated libcrypto, so the default is to not include it. --HAVE_LIBCRYTO ?= no --SYS_LIBCRYPTO_CFLAGS = --SYS_LIBCRYPTO_LIBS = +-HAVE_LIBCRYTO := no +-SYS_LIBCRYPTO_CFLAGS := +-SYS_LIBCRYPTO_LIBS := -ifeq "$(HAVE_LIBCRYPTO)" "yes" --SYS_LIBCRYPTO_CFLAGS = -DHAVE_LIBCRYPTO --SYS_LIBCRYPTO_LIBS = -lcrypto +-SYS_LIBCRYPTO_CFLAGS := -DHAVE_LIBCRYPTO +-SYS_LIBCRYPTO_LIBS := -lcrypto -endif - --SYS_CURL_DEPS = -lpthread +-SYS_CURL_DEPS := -lpthread - --SYS_X11_CFLAGS = -I/usr/X11R6/include --SYS_X11_LIBS = -L/usr/X11R6/lib -lX11 -lXext +-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 +-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" - - 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) + HAVE_PTHREAD := yes + SYS_PTHREAD_CFLAGS := + SYS_PTHREAD_LIBS := -lpthread +@@ -140,6 +92,14 @@ SYS_X11_CFLAGS := $(shell pkg-config --c + 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) ++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) +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 + SYS_HARFBUZZ_CFLAGS := $(shell pkg-config --cflags harfbuzz) + SYS_HARFBUZZ_LIBS := $(shell pkg-config --libs harfbuzz) +@@ -159,8 +119,6 @@ SYS_JBIG2DEC_LIBS := -ljbig2dec + SYS_LIBJPEG_LIBS := -ljpeg + SYS_ZLIB_LIBS := -lz -endif - diff --git a/print/mupdf/patches/patch-ac b/print/mupdf/patches/patch-ac index 7e7294b5b3c..835fe1956f8 100644 --- a/print/mupdf/patches/patch-ac +++ b/print/mupdf/patches/patch-ac @@ -1,15 +1,17 @@ -$NetBSD: patch-ac,v 1.15 2016/11/28 14:40:42 leot Exp $ +$NetBSD: patch-ac,v 1.16 2017/04/12 13:03:08 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 Install MUTOOL_LIB as part of INSTALL_LIBS +o 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" ---- Makefile.orig 2016-11-21 10:21:11.000000000 +0000 +--- Makefile.orig 2017-03-31 14:23:45.000000000 +0000 +++ Makefile -@@ -42,26 +42,12 @@ CFLAGS += $(ZLIB_CFLAGS) +@@ -57,65 +57,51 @@ ALL_DIR += $(OUT)/platform/gl # --- Commands --- @@ -40,51 +42,9 @@ o Install only one "mupdf" binary, prefer the featureful one and always +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 + # --- Rules --- - 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) : + $(ALL_DIR) $(OUT) generated : $(MKDIR_CMD) -$(OUT)/%.a : @@ -93,33 +53,33 @@ o Install only one "mupdf" binary, prefer the featureful one and always $(AR_CMD) $(RANLIB_CMD) --$(OUT)/%: $(OUT)/%.o -+$(OUT)/%: $(OUT)/%.lo +-$(OUT)/%.exe: $(OUT)/%.o | $(ALL_DIR) ++$(OUT)/%.exe: $(OUT)/%.lo | $(ALL_DIR) $(LINK_CMD) --$(OUT)/%.o : source/%.c | $(ALL_DIR) -+$(OUT)/%.lo : source/%.c | $(ALL_DIR) +-$(OUT)/%.o : %.c | $(ALL_DIR) ++$(OUT)/%.lo : %.c | $(ALL_DIR) $(CC_CMD) --$(OUT)/%.o : source/%.cpp | $(ALL_DIR) -+$(OUT)/%.lo : source/%.cpp | $(ALL_DIR) +-$(OUT)/%.o : %.cpp | $(ALL_DIR) ++$(OUT)/%.lo : %.cpp | $(ALL_DIR) $(CXX_CMD) --$(OUT)/%.o : scripts/%.c | $(OUT) -+$(OUT)/%.lo : scripts/%.c | $(OUT) - $(CC_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 --$(OUT)/fonts/%.o : $(GEN)/%.c | $(ALL_DIR) +-$(OUT)/generated/%.o : generated/%.c | $(ALL_DIR) - $(CC_CMD) -O0 -+$(OUT)/fonts/%.lo : $(GEN)/%.c | $(ALL_DIR) ++$(OUT)/generated/%.lo : generated/%.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) +-$(OUT)/platform/x11/%.o: platform/x11/%.rc | $(ALL_DIR) ++$(OUT)/platform/x11/%.lo: platform/x11/%.rc | $(ALL_DIR) $(WINDRES_CMD) -$(OUT)/platform/x11/curl/%.o : platform/x11/%.c | $(ALL_DIR) @@ -133,118 +93,211 @@ o Install only one "mupdf" binary, prefer the featureful one and always -.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules +.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules - # --- Generated CMap and JavaScript files --- + # --- File lists --- -@@ -251,51 +237,53 @@ endif +@@ -141,14 +127,14 @@ SVG_SRC_HDR := $(wildcard source/svg/*.h + HTML_SRC_HDR := $(wildcard source/html/*.h) + GPRF_SRC_HDR := $(wildcard source/gprf/*.h) - generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN) $(NAME_GEN) +-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) +-THREAD_OBJ := $(THREAD_SRC:%.c=$(OUT)/%.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) --$(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 + $(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR) + $(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR) +@@ -172,7 +158,7 @@ ifneq "$(CROSSCOMPILE)" "yes" + $(NAME_GEN) : $(NAMEDUMP_EXE) + endif - # --- Tools and Apps --- +-$(OUT)/source/pdf/pdf-object.o : source/pdf/pdf-name-table.h ++$(OUT)/source/pdf/pdf-object.lo : source/pdf/pdf-name-table.h - 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) + generate: $(NAME_GEN) -+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) +@@ -194,7 +180,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 := $(FONT_GEN:%.c=$(OUT)/%.o) ++FONT_OBJ := $(FONT_GEN:%.c=$(OUT)/%.lo) - 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) + 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 + +-$(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 \ + +-$(OUT)/source/pdf/pdf-cmap-table.o : $(CMAP_GEN) ++$(OUT)/source/pdf/pdf-cmap-table.lo : $(CMAP_GEN) + + 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) + + # --- Library --- + +-MUPDF_LIB = $(OUT)/libmupdf.a +-THIRD_LIB = $(OUT)/libmupdfthird.a +-THREAD_LIB = $(OUT)/libmuthreads.a ++MUPDF_LIB = $(OUT)/libmupdf.la ++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) + $(THIRD_LIB) : $(THIRD_OBJ) + $(THREAD_LIB) : $(THREAD_OBJ) + +-INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) ++INSTALL_LIBS := $(MUPDF_LIB) $(THIRD_LIB) $(THREAD_LIB) + + # --- 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_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) + + 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) + + 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) : $(MJSGEN_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(LINK_CMD) - MUJSTEST := $(OUT)/mujstest + 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) : $(MUJSTEST_OBJ) $(MUPDF_LIB) $(THIRD_LIB) + $(MUJSTEST_EXE) : $(MUJSTEST_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(LINK_CMD) ifeq "$(HAVE_X11)" "yes" --MUVIEW_X11 := $(OUT)/mupdf-x11 +-MUVIEW_X11_EXE := $(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_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) : $(MUVIEW_X11_OBJ) $(MUPDF_LIB) $(THIRD_LIB) + $(MUVIEW_X11_EXE) : $(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_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 := $(OUT)/platform/x11/curl/mupdf ++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) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB) + $(MUVIEW_X11_CURL_EXE) : $(MUVIEW_X11_CURL_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(CURL_LIB) $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) $(SYS_CURL_DEPS) -@@ -303,8 +291,8 @@ endif +@@ -359,8 +345,8 @@ endif endif ifeq "$(HAVE_GLFW)" "yes" --MUVIEW_GLFW := $(OUT)/mupdf-gl +-MUVIEW_GLFW_EXE := $(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_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) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB) + $(MUVIEW_GLFW_EXE) : $(MUVIEW_GLFW_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(GLFW_LIB) $(LINK_CMD) $(GLFW_LIBS) -@@ -312,16 +300,25 @@ endif +@@ -368,7 +354,7 @@ endif ifeq "$(HAVE_WIN32)" "yes" - MUVIEW_WIN32 := $(OUT)/mupdf + 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) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) + $(MUVIEW_WIN32_EXE) : $(MUVIEW_WIN32_OBJ) $(MUPDF_LIB) $(THIRD_LIB) $(LINK_CMD) $(WIN32_LIBS) - endif +@@ -377,11 +363,20 @@ endif + MUVIEW_EXE := $(MUVIEW_X11_EXE) $(MUVIEW_WIN32_EXE) $(MUVIEW_GLFW_EXE) + MUVIEW_CURL_EXE := $(MUVIEW_X11_CURL_EXE) $(MUVIEW_WIN32_CURL_EXE) --MUVIEW := $(MUVIEW_X11) $(MUVIEW_WIN32) $(MUVIEW_GLFW) -+MUVIEW := $(MUVIEW_X11) $(MUVIEW_WIN32) - MUVIEW_CURL := $(MUVIEW_X11_CURL) $(MUVIEW_WIN32_CURL) +-INSTALL_APPS := $(MUTOOL_EXE) $(MUVIEW_EXE) ++INSTALL_APPS := $(MUTOOL_EXE) + INSTALL_APPS += $(MURASTER_EXE) +-INSTALL_APPS += $(MUVIEW_CURL_EXE) + INSTALL_APPS += $(MUJSTEST_EXE) --INSTALL_APPS := $(MUTOOL) $(MUVIEW) $(MURASTER) $(MUJSTEST) $(MUVIEW_CURL) -+INSTALL_APPS := $(MUTOOL) $(MURASTER) $(MUJSTEST) +ifeq "$(HAVE_CURL)" "yes" -+INSTALL_APPS += $(MUVIEW_CURL) ++INSTALL_APPS += $(MUVIEW_CURL_EXE) +else ifeq "$(HAVE_X11)" "yes" -+INSTALL_APPS += $(MUVIEW) ++INSTALL_APPS += $(MUVIEW_EXE) +endif + +ifeq "$(HAVE_GLFW)" "yes" -+INSTALL_APPS += $(MUVIEW_GLFW) ++INSTALL_APPS += $(MUVIEW_GLFW_EXE) +endif - ++ # --- Examples --- -@@ -364,24 +361,26 @@ libs: $(INSTALL_LIBS) + examples: $(OUT)/example $(OUT)/multi-threaded +@@ -393,10 +388,10 @@ $(OUT)/multi-threaded: docs/multi-thread + + # --- Update version string header --- + +-VERSION = $(shell git describe --tags) +- +-version: +- sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h ++#VERSION = $(shell git describe --tags) ++# ++#version: ++# sed -i~ -e '/FZ_VERSION /s/".*"/"'$(VERSION)'"/' include/mupdf/fitz/version.h + + # --- Format man pages --- + +@@ -423,24 +418,26 @@ libs: $(INSTALL_LIBS) apps: $(INSTALL_APPS) install: libs apps diff --git a/print/mupdf/patches/patch-source_fitz_load-jpx.c b/print/mupdf/patches/patch-source_fitz_load-jpx.c index 13e03eba33a..886d8b66004 100644 --- a/print/mupdf/patches/patch-source_fitz_load-jpx.c +++ b/print/mupdf/patches/patch-source_fitz_load-jpx.c @@ -1,16 +1,16 @@ -$NetBSD: patch-source_fitz_load-jpx.c,v 1.4 2016/11/28 14:40:42 leot Exp $ +$NetBSD: patch-source_fitz_load-jpx.c,v 1.5 2017/04/12 13:03:08 leot Exp $ 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.orig 2017-03-31 14:23:45.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 +@@ -443,7 +443,9 @@ fz_load_jpx_info(fz_context *ctx, unsign + + #else /* HAVE_LURATECH */ + ++#if defined(_WIN32) || defined(_WIN64) #define OPJ_STATIC +#endif - #ifndef _MSC_VER + #define OPJ_HAVE_INTTYPES_H + #if !defined(_WIN32) && !defined(_WIN64) #define OPJ_HAVE_STDINT_H - #endif diff --git a/print/mupdf/patches/patch-source_fitz_pixmap.c b/print/mupdf/patches/patch-source_fitz_pixmap.c deleted file mode 100644 index e42552d704c..00000000000 --- a/print/mupdf/patches/patch-source_fitz_pixmap.c +++ /dev/null @@ -1,44 +0,0 @@ -$NetBSD: patch-source_fitz_pixmap.c,v 1.1 2017/02/11 09:39:05 leot Exp $ - -Backport a fix from upstream for CVE-2017-5896: - -bug 697515: Fix out of bounds read in fz_subsample_pixmap - -Pointer arithmetic for final special case was going wrong. - ---- source/fitz/pixmap.c.orig -+++ source/fitz/pixmap.c -@@ -1104,6 +1104,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor, - "@STACK:r1,<9>,factor,n,fwd,back,back2,fwd2,divX,back4,fwd4,fwd3,divY,back5,divXY\n" - "ldr r4, [r13,#4*22] @ r4 = divXY \n" - "ldr r5, [r13,#4*11] @ for (nn = n; nn > 0; n--) { \n" -+ "ldr r8, [r13,#4*17] @ r8 = back4 \n" - "18: @ \n" - "mov r14,#0 @ r14= v = 0 \n" - "sub r5, r5, r1, LSL #8 @ for (xx = x; xx > 0; x--) { \n" -@@ -1120,7 +1121,7 @@ fz_subsample_pixmap_ARM(unsigned char *ptr, int w, int h, int f, int factor, - "mul r14,r4, r14 @ r14= v *= divX \n" - "mov r14,r14,LSR #16 @ r14= v >>= 16 \n" - "strb r14,[r9], #1 @ *d++ = r14 \n" -- "sub r0, r0, r8 @ s -= back2 \n" -+ "sub r0, r0, r8 @ s -= back4 \n" - "subs r5, r5, #1 @ n-- \n" - "bgt 18b @ } \n" - "21: @ \n" -@@ -1249,6 +1250,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor) - x += f; - if (x > 0) - { -+ int back4 = x * n - 1; - div = x * y; - for (nn = n; nn > 0; nn--) - { -@@ -1263,7 +1265,7 @@ fz_subsample_pixmap(fz_context *ctx, fz_pixmap *tile, int factor) - s -= back5; - } - *d++ = v / div; -- s -= back2; -+ s -= back4; - } - } - } diff --git a/print/mupdf/patches/patch-source_tools_mudraw.c b/print/mupdf/patches/patch-source_tools_mudraw.c deleted file mode 100644 index 6b53c688b65..00000000000 --- a/print/mupdf/patches/patch-source_tools_mudraw.c +++ /dev/null @@ -1,17 +0,0 @@ -$NetBSD: patch-source_tools_mudraw.c,v 1.1 2017/02/11 09:39:05 leot Exp $ - -Backport a fix from upstream for bug 697514: - -Bug 697514: Write SVG output to stdout if no output specified. - ---- source/tools/mudraw.c.orig -+++ source/tools/mudraw.c -@@ -578,7 +578,7 @@ static void dodrawpage(fz_context *ctx, fz_page *page, fz_display_list *list, in - char buf[512]; - fz_output *out; - -- if (!strcmp(output, "-")) -+ if (!output || !strcmp(output, "-")) - out = fz_stdout(ctx); - else - { diff --git a/print/mupdf/patches/patch-thirdparty_mujs_Makefile b/print/mupdf/patches/patch-thirdparty_mujs_Makefile index 334af5cc58f..6092fd76d4e 100644 --- a/print/mupdf/patches/patch-thirdparty_mujs_Makefile +++ b/print/mupdf/patches/patch-thirdparty_mujs_Makefile @@ -1,10 +1,18 @@ -$NetBSD: patch-thirdparty_mujs_Makefile,v 1.1 2016/04/27 12:34:58 leot Exp $ +$NetBSD: patch-thirdparty_mujs_Makefile,v 1.2 2017/04/12 13:03:08 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.orig 2017-03-29 13:56:39.000000000 +0000 +++ thirdparty/mujs/Makefile +@@ -1,6 +1,6 @@ + SRCS := $(wildcard js*.c utf*.c regexp.c) + HDRS := $(wildcard js*.h mujs.h utf.h regexp.h) +-OBJS := $(SRCS:%.c=build/%.o) ++OBJS := $(SRCS:%.c=build/%.lo) + + prefix ?= /usr/local + bindir ?= $(prefix)/bin @@ -41,16 +41,16 @@ jsdump.c: astnames.h opnames.h build: mkdir -p build @@ -22,12 +30,16 @@ o Avoid to set (unused) VERSION variable. $(CC) $(LDFLAGS) -o $@ $^ -lm -build/mujsone: build/main.o build/one.o -+build/mujsone: build/main.o build/one.lo ++build/mujsone: build/main.lo build/one.lo $(CC) $(LDFLAGS) -o $@ $^ -lm install: release -@@ -61,12 +61,12 @@ install: release - install build/libmujs.a $(DESTDIR)$(libdir) +@@ -58,15 +58,15 @@ install: release + install -d $(DESTDIR)$(libdir) + install -d $(DESTDIR)$(bindir) + install mujs.h $(DESTDIR)$(incdir) +- install build/libmujs.a $(DESTDIR)$(libdir) ++ install build/libmujs.la $(DESTDIR)$(libdir) install build/mujs $(DESTDIR)$(bindir) -VERSION = $(shell git describe --tags --always) diff --git a/print/mupdf/patches/patch-thirdparty_mujs_jsdate.c b/print/mupdf/patches/patch-thirdparty_mujs_jsdate.c deleted file mode 100644 index bb83c94204b..00000000000 --- a/print/mupdf/patches/patch-thirdparty_mujs_jsdate.c +++ /dev/null @@ -1,27 +0,0 @@ -$NetBSD: patch-thirdparty_mujs_jsdate.c,v 1.1 2017/01/30 14:06:05 leot Exp $ - -Backport a fix from upstream for CVE-2017-5628: - -Fix 697496: Check NAN before accessing array in MakeDay(). - ---- thirdparty/mujs/jsdate.c.orig -+++ thirdparty/mujs/jsdate.c -@@ -207,12 +207,17 @@ static double MakeDay(double y, double m, double date) - }; - - double yd, md; -+ int im; - - y += floor(m / 12); - m = pmod(m, 12); - -+ im = (int)m; -+ if (im < 0 || im >= 12) -+ return NAN; -+ - yd = floor(TimeFromYear(y) / msPerDay); -- md = firstDayOfMonth[InLeapYear(y)][(int)m]; -+ md = firstDayOfMonth[InLeapYear(y)][im]; - - return yd + md + date - 1; - } diff --git a/print/mupdf/patches/patch-thirdparty_mujs_jsrun.c b/print/mupdf/patches/patch-thirdparty_mujs_jsrun.c deleted file mode 100644 index 3feecf477b2..00000000000 --- a/print/mupdf/patches/patch-thirdparty_mujs_jsrun.c +++ /dev/null @@ -1,21 +0,0 @@ -$NetBSD: patch-thirdparty_mujs_jsrun.c,v 1.1 2017/01/30 14:06:05 leot Exp $ - -Backport a fix from upstream for CVE-2017-5627: - -Fix 697497: Ensure array length is positive. - -As a side effect when changing to using regular integers (and avoid the -nightmare of mixing signed and unsigned) we accidentally allowed negative -array lengths. - ---- thirdparty/mujs/jsrun.c.orig -+++ thirdparty/mujs/jsrun.c -@@ -544,7 +544,7 @@ static void jsR_setproperty(js_State *J, js_Object *obj, const char *name) - if (!strcmp(name, "length")) { - double rawlen = jsV_tonumber(J, value); - int newlen = jsV_numbertointeger(rawlen); -- if (newlen != rawlen) -+ if (newlen != rawlen || newlen < 0) - js_rangeerror(J, "array length"); - jsV_resizearray(J, obj, newlen); - return; |