From bc98dac605042d444b9f2b18aabf60e7b092466b Mon Sep 17 00:00:00 2001 From: mef Date: Thu, 9 Jan 2014 14:25:23 +0000 Subject: Update print/mupdf to 1.3 (via pkgsrc-wip by Leonardo Taccari, thanks) ============================================================================= Notes on updating mupdf to mupdf-1.3 (maybe useful for future updates too) * mupdf-1.3 depends on openjpeg-2.0 (previously mupdf-1.1 depended on openjpeg-1.5). ${WRKSRC}/Makerules is NOT correct and still looks for openjpeg-1.5 so patches/patch-ab was modified in order to fix this behaviour. Please also note the SUBST.makerules class in Makefile. * mupdf should be build with "build=release" (the default is "build=debug" and that may be indesiderable for the common user). * In order to completely disable the building of third party libraries (it is better to use the ones provided/handled by pkgsrc) a brutal ${RM} -fr completely remove the ${WRKSRC}/thirdparty directory. For more information please read ${WRKSRC}/Makethird and the post-extract target in Makefile. * ${WRKSRC}/docs/thirdparty.txt may help for adding correct version of the dependencies. * To add libcurl support (www/curl) patches/patch-Makethird was introduced and patches/patch-ab was modified in order to use pkg-config for $(SYS_CURL_CFLAGS) and $(SYS_CURL_LIBS). * By default now mupdf install different binaries, e.g. mupdf-x11 (previous it was just "mupdf"), mupdf-x11-curl, etc.. In pkgsrc we install *only* the featureful version of mupdf simply as "mupdf". For more information please give a look to patches/patch-ac. ============================================================================= (Upstream) List of changes on master since MuPDF 1.2 * Windows RT viewer app for MuPDF. * Library changes to support progressive loading (display PDF files as they download). Windows/Linux/MacOS viewer supports this using curl. * Incremental updates to PDF files are now (optionally) preserved on loading/saving. * Prototype support for checking PDF Digital Signatures. * Initial annotation support (strike-out, underline, highlight and ink) (library and android builds only). * Fix operation on Android API level 8. * Android redraw optimisations. * Android app now supports Google Cloud Print. * Android app translated into many languages. * Android support for more architectures. * Improvements to store (avoid collisions causing unnecessary evictions). * Windows apps use Unicode filenames now. * PDF function handling improved; functions can now be passed to devices without 'sampling'. * PDF image handling improved; images can now be passed to devices without decompression. * Indexed images are no longer uncompressed at load time, saving memory. * Caching of rendered tiles for speed. * Improved text analysis mode, capable of spotting columns/indents, right-to-left text etc. * HTML output mode now includes image output. * PDF password encoding handling improved. * MuPDF now opens Jpeg, Tiff and PNG files directly. * Bug preventing OpenXPS files from being opened fixed. * Initial (feature incomplete) SVG and PDF output devices. * PWG raster (mono/grey/RGB) and PCL (mono) output devices. * Various performance improvements (including tilings and mesh based shadings). * Revamped directory structure to reflect recent changes. * Various potential SEGV, SoftMask and rendering fixes. * Many potential crashes in Jpeg2000 and JBIG2 images fixed. List of changes on master since MuPDF 1.1 * Important API changes: * fz_bbox is now fz_irect. * APIs (including fz_device) now pass fz_rect/fz_matrix by reference. * fz_device API is now more consistent with regards to use of fz_rect rather than fz_bbox. * Add support for Javascript and forms handling. * Fix many SEGVs with out of spec files. Many thanks to Mateusz "j00ru" Jurczyk and Gynvael Coldwind of the Google Security team, zeniko, Sebastian Rasmussen and all other contributors. * Add fz_open_document_with_stream to allow non-file based operation. * Move to using git submodules for third party libraries. * Much enhanced Android application. Now on Google Play! * Oversized and stroke text clipping implemented. * Change shadings to decompose at render times; massive memory savings. * Renamed 'mubusy' to 'mutool'. * PDF 1.7 Extension Level 8 encryption implemented. * Added consts to various parts of the API to help C++ interworking. * Prototype transition support. * Text searching API moved to fitz. * Highlight and copy text selections. * Performance enhancements for color conversion and fax decompression. * ARM optimisations for color conversion and bitmap scaling. * Bitmap subsampling stage introduced, with ARM optimisations. * Type 3 fonts; glyphs are now handled as display lists. * Scan converter performance improvements. * Various rendering fixes. --- print/mupdf/Makefile | 31 +++- print/mupdf/PLIST | 83 ++++++++- print/mupdf/buildlink3.mk | 4 +- print/mupdf/distinfo | 16 +- print/mupdf/files/mupdf.pc | 2 +- print/mupdf/patches/patch-Makethird | 15 ++ print/mupdf/patches/patch-ab | 78 +++++--- print/mupdf/patches/patch-ac | 279 ++++++++++++++++++++--------- print/mupdf/patches/patch-ae | 10 +- print/mupdf/patches/patch-fitz_image_jpx.c | 15 -- 10 files changed, 373 insertions(+), 160 deletions(-) create mode 100644 print/mupdf/patches/patch-Makethird delete mode 100644 print/mupdf/patches/patch-fitz_image_jpx.c diff --git a/print/mupdf/Makefile b/print/mupdf/Makefile index a623a58dc1f..68e98011545 100644 --- a/print/mupdf/Makefile +++ b/print/mupdf/Makefile @@ -1,25 +1,37 @@ -# $NetBSD: Makefile,v 1.18 2013/06/04 22:16:59 tron Exp $ +# $NetBSD: Makefile,v 1.19 2014/01/09 14:25:23 mef Exp $ -DISTNAME= mupdf-1.1-source +DISTNAME= mupdf-1.3-source PKGNAME= ${DISTNAME:S/-source//} -PKGREVISION= 3 CATEGORIES= print -MASTER_SITES= http://ccxvii.net/mupdf/download/ \ - http://ccxvii.net/mupdf/download/archive/ +MASTER_SITES= http://mupdf.googlecode.com/files/ MAINTAINER= pkgsrc-users@NetBSD.org HOMEPAGE= http://mupdf.com/ COMMENT= Lightweight PDF viewer and toolkit -LICENSE= gnu-gpl-v3 +LICENSE= gnu-agpl-v3 USE_LIBTOOL= yes USE_TOOLS+= pkg-config gmake +SUBST_CLASSES+= makerules +SUBST_STAGE.makerules= post-patch +SUBST_MESSAGE.makerules= Fixing CFLAGS for openjpeg in Makerules. +SUBST_FILES.makerules= Makerules +SUBST_VARS.makerules+= PREFIX + INSTALLATION_DIRS+= bin include lib/pkgconfig -INSTALL_MAKE_FLAGS+= prefix=${DESTDIR}${PREFIX} -INSTALL_MAKE_FLAGS+= mandir=${DESTDIR}${PREFIX}/${PKGMANDIR} +INSTALL_MAKE_FLAGS+= prefix=${PREFIX} +INSTALL_MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR} LDFLAGS= ${COMPILER_RPATH_FLAG}${X11BASE}/lib MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q} +MAKE_FLAGS+= V8_PRESENT=no +MAKE_FLAGS+= build=release + +.include "options.mk" + +# Remove thirdparty directory in order to use the libraries provided by pkgsrc +post-extract: + ${RM} -fr ${WRKSRC}/thirdparty post-build: sed -e "s,@PREFIX@,${PREFIX}," ${FILESDIR}/mupdf.pc > ${WRKSRC}/mupdf.pc @@ -31,6 +43,7 @@ post-install: .include "../../graphics/freetype2/buildlink3.mk" .include "../../graphics/jbig2dec/buildlink3.mk" .include "../../mk/jpeg.buildlink3.mk" -.include "../../graphics/openjpeg15/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/print/mupdf/PLIST b/print/mupdf/PLIST index 1aff2825b38..6c8e773aaa4 100644 --- a/print/mupdf/PLIST +++ b/print/mupdf/PLIST @@ -1,14 +1,79 @@ -@comment $NetBSD: PLIST,v 1.5 2012/08/21 19:50:53 drochner Exp $ -bin/mubusy +@comment $NetBSD: PLIST,v 1.6 2014/01/09 14:25:23 mef Exp $ bin/mudraw bin/mupdf -include/fitz.h -include/memento.h -include/mucbz.h -include/mupdf.h -include/muxps.h -lib/libfitz.la +bin/mutool +include/mupdf/cbz.h +include/mupdf/fitz.h +include/mupdf/fitz/annotation.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/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/hash.h +include/mupdf/fitz/image.h +include/mupdf/fitz/link.h +include/mupdf/fitz/math.h +include/mupdf/fitz/meta.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-pwg.h +include/mupdf/fitz/output-svg.h +include/mupdf/fitz/output.h +include/mupdf/fitz/path.h +include/mupdf/fitz/pixmap.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/transition.h +include/mupdf/fitz/write-document.h +include/mupdf/fitz/xml.h +include/mupdf/img.h +include/mupdf/memento.h +include/mupdf/pdf.h +include/mupdf/pdf/annot.h +include/mupdf/pdf/appearance.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/javascript.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/xps.h +lib/libmupdf-js-none.la +lib/libmupdf.la lib/pkgconfig/mupdf.pc -man/man1/mubusy.1 man/man1/mudraw.1 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 diff --git a/print/mupdf/buildlink3.mk b/print/mupdf/buildlink3.mk index 29dfa1e3f3a..c6da59801ac 100644 --- a/print/mupdf/buildlink3.mk +++ b/print/mupdf/buildlink3.mk @@ -1,11 +1,11 @@ -# $NetBSD: buildlink3.mk,v 1.2 2011/03/08 17:09:25 drochner Exp $ +# $NetBSD: buildlink3.mk,v 1.3 2014/01/09 14:25:23 mef Exp $ BUILDLINK_TREE+= mupdf .if !defined(MUPDF_BUILDLINK3_MK) MUPDF_BUILDLINK3_MK:= -BUILDLINK_API_DEPENDS.mupdf+= mupdf>=0.0.937 +BUILDLINK_API_DEPENDS.mupdf+= mupdf>=1.3 BUILDLINK_PKGSRCDIR.mupdf?= ../../print/mupdf .endif # MUPDF_BUILDLINK3_MK diff --git a/print/mupdf/distinfo b/print/mupdf/distinfo index 6dfaf5b891d..9c00ce0c009 100644 --- a/print/mupdf/distinfo +++ b/print/mupdf/distinfo @@ -1,9 +1,9 @@ -$NetBSD: distinfo,v 1.9 2012/12/08 23:09:39 adam Exp $ +$NetBSD: distinfo,v 1.10 2014/01/09 14:25:23 mef Exp $ -SHA1 (mupdf-1.1-source.tar.gz) = e2c2cd555d790ed97bd6507accf29817945dfe81 -RMD160 (mupdf-1.1-source.tar.gz) = 7ebdbd3a1cc64a4de1de920d7b149a3682ba1431 -Size (mupdf-1.1-source.tar.gz) = 4281735 bytes -SHA1 (patch-ab) = fa8d1acb5ff8cf3562e0f27f0b2a0d27408d2542 -SHA1 (patch-ac) = dbda8ee49ac4cfe43b09329d25a7d7e6b45ef164 -SHA1 (patch-ae) = 792df3bea1f8c13230bfdce5495eaaf99c62cc12 -SHA1 (patch-fitz_image_jpx.c) = 6ca57a09c527b11f1b1bcf5364a5a2dfbe39f79d +SHA1 (mupdf-1.3-source.tar.gz) = 082325aceb5565b07b82c2b6cc52a97533e03cf9 +RMD160 (mupdf-1.3-source.tar.gz) = 5f898cfaa3a54c7c34835411b0d386914edee2f8 +Size (mupdf-1.3-source.tar.gz) = 14594969 bytes +SHA1 (patch-Makethird) = 37b0be98bf859ec9d995dd7a3c05c191be42a479 +SHA1 (patch-ab) = d3258d2c37743a3c4bc1949d3246e71d81e4d69e +SHA1 (patch-ac) = aa528c732ca5f42234279734467155e68aa39663 +SHA1 (patch-ae) = df35d031a816eceac5bdfd5ddb298adea4a48ce0 diff --git a/print/mupdf/files/mupdf.pc b/print/mupdf/files/mupdf.pc index d545c334974..e10c0ed849d 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.1 +Version: 1.3 Libs: -Wl,-R${libdir} -L${libdir} -lmupdf Cflags: -I${includedir} diff --git a/print/mupdf/patches/patch-Makethird b/print/mupdf/patches/patch-Makethird new file mode 100644 index 00000000000..167ba287c86 --- /dev/null +++ b/print/mupdf/patches/patch-Makethird @@ -0,0 +1,15 @@ +$NetBSD: patch-Makethird,v 1.1 2014/01/09 14:25:23 mef Exp $ + +libcurl (www/curl) support. By default mupdf can be installed with curl +support *only* building it in ${WRKSRC}/thirdparty. + +--- Makethird.orig 2013-08-14 12:41:20.000000000 +0000 ++++ Makethird +@@ -444,5 +444,6 @@ $(CURL_OUT)/%.o: $(CURL_DIR)/lib/%.c | $ + CURL_CFLAGS := -I$(CURL_DIR)/include + CURL_LIBS := $(SYS_CURL_DEPS) + else +-NOCURL := yes ++CURL_CFLAGS := $(SYS_CURL_CFLAGS) ++CURL_LIBS := $(SYS_CURL_LIBS) $(SYS_CURL_DEPS) + endif diff --git a/print/mupdf/patches/patch-ab b/print/mupdf/patches/patch-ab index a5b3b251f87..e11a04123f5 100644 --- a/print/mupdf/patches/patch-ab +++ b/print/mupdf/patches/patch-ab @@ -1,39 +1,65 @@ -$NetBSD: patch-ab,v 1.4 2012/08/21 19:50:54 drochner Exp $ +$NetBSD: patch-ab,v 1.5 2014/01/09 14:25:23 mef Exp $ -Handle the various operating systems in the same way avoiding hardcoding. +o Handle the various operating systems in the same way avoiding hardcoding +o Build and link with openjpeg-2.0 +o libcurl (www/curl) support ---- Makerules.orig 2012-08-16 13:55:20.000000000 +0000 +--- Makerules.orig 2013-08-14 12:41:20.000000000 +0000 +++ Makerules -@@ -23,32 +23,8 @@ else +@@ -24,52 +24,26 @@ else $(error unknown build setting: '$(build)') endif --ifeq "$(OS)" "Linux" - SYS_FREETYPE_INC := `pkg-config --cflags freetype2` - X11_LIBS := -lX11 -lXext --endif +-# Windows (MINGW) build doesn't use system libraries. +-ifeq "$(OS)" "MINGW" +-NOX11 ?= yes - --ifeq "$(OS)" "FreeBSD" --SYS_FREETYPE_INC := `pkg-config --cflags freetype2` --LDFLAGS += -L/usr/local/lib --X11_LIBS := -lX11 -lXext --endif +-# Mac OS X doesn't have pkg-config so we hard code paths. +-else ifeq "$(OS)" "Darwin" +-SYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL +-SYS_OPENSSL_LIBS = -lcrypto +- +-SYS_CURL_DEPS = -lpthread +- +-SYS_X11_CFLAGS = -I/usr/X11R6/include +-SYS_X11_LIBS = -L/usr/X11R6/lib -lX11 -lXext +- +-SYS_FREETYPE_CFLAGS = -I/usr/X11R6/include/freetype2 +-SYS_FREETYPE_LIBS = -lfreetype +-SYS_OPENJPEG_LIBS = -lopenjpeg +-SYS_JBIG2DEC_LIBS = -ljbig2dec +-SYS_JPEG_LIBS = -ljpeg +-SYS_ZLIB_LIBS = -lz - --# Mac OS X build depends on some thirdparty libs --ifeq "$(OS)" "Darwin" --SYS_FREETYPE_INC := -I/usr/X11R6/include/freetype2 --CFLAGS += -I/usr/X11R6/include --LDFLAGS += -L/usr/X11R6/lib -RANLIB_CMD = ranlib $@ --X11_LIBS := -lX11 -lXext --ifeq "$(arch)" "amd64" --CFLAGS += -m64 --LDFLAGS += -m64 +- +-# Other Unixes use pkg-config for system libraries. -else --CFLAGS += -m32 --LDFLAGS += -m32 --endif --endif +- + ifeq "$(shell pkg-config --exists libcrypto && echo yes)" "yes" + SYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL $(shell pkg-config --cflags libcrypto) + SYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto) + endif + ++SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl) + SYS_CURL_DEPS = -lpthread -lrt ++SYS_CURL_LIBS = $(shell pkg-config --libs libcurl) + + SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext) + SYS_X11_LIBS = $(shell pkg-config --libs x11 xext) + SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) + SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2) +-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjpeg1) +-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjpeg1) ++SYS_OPENJPEG_CFLAGS = -I@PREFIX@/include/openjpeg-2.0 ++SYS_OPENJPEG_LIBS = -lopenjp2 + 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/print/mupdf/patches/patch-ac b/print/mupdf/patches/patch-ac index cbd3c5cfb68..7b3f44277ba 100644 --- a/print/mupdf/patches/patch-ac +++ b/print/mupdf/patches/patch-ac @@ -1,137 +1,246 @@ -$NetBSD: patch-ac,v 1.5 2012/08/21 19:50:54 drochner Exp $ +$NetBSD: patch-ac,v 1.6 2014/01/09 14:25:23 mef Exp $ -libtool support and install target cleanup. +o libtool support +o Install target cleanup +o Install only one "mupdf" binary, prefer the featureful one and always + install it as "mupdf" ---- Makefile.orig 2012-08-16 13:55:20.000000000 +0000 +--- Makefile.orig 2013-08-14 12:41:20.000000000 +0000 +++ Makefile -@@ -24,18 +24,10 @@ THIRD_LIBS += $(JPEG_LIB) - THIRD_LIBS += $(OPENJPEG_LIB) - THIRD_LIBS += $(ZLIB_LIB) +@@ -41,22 +41,12 @@ CFLAGS += $(ZLIB_CFLAGS) + + # --- Commands --- -ifeq "$(verbose)" "" -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 $@ ; -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 $@ +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 --- + +@@ -67,6 +57,7 @@ ALL_DIR += $(OUT)/cbz + ALL_DIR += $(OUT)/img + ALL_DIR += $(OUT)/tools + ALL_DIR += $(OUT)/platform/x11 ++ALL_DIR += $(OUT)/platform/x11/curl + + FITZ_HDR := include/mupdf/fitz.h $(wildcard include/mupdf/fitz/*.h) + PDF_HDR := include/mupdf/pdf.h $(wildcard include/mupdf/pdf/*.h) +@@ -86,14 +77,14 @@ XPS_SRC_HDR := $(wildcard source/xps/*.h + CBZ_SRC_HDR := $(wildcard source/cbz/*.h) + IMG_SRC_HDR := $(wildcard source/img/*.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)))) +-CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(CBZ_SRC)))) +-IMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .o, $(basename $(IMG_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)))) ++CBZ_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(CBZ_SRC)))) ++IMG_OBJ := $(subst source/, $(OUT)/, $(addsuffix .lo, $(basename $(IMG_SRC)))) + +-PDF_JS_V8_OBJ := $(OUT)/pdf/js/pdf-js.o $(OUT)/pdf/js/pdf-jsimp-cpp.o $(OUT)/pdf/js/pdf-jsimp-v8.o +-PDF_JS_NONE_OBJ := $(OUT)/pdf/js/pdf-js-none.o ++PDF_JS_V8_OBJ := $(OUT)/pdf/js/pdf-js.lo $(OUT)/pdf/js/pdf-jsimp-cpp.lo $(OUT)/pdf/js/pdf-jsimp-v8.lo ++PDF_JS_NONE_OBJ := $(OUT)/pdf/js/pdf-js-none.lo + + $(FITZ_OBJ) : $(FITZ_HDR) $(FITZ_SRC_HDR) + $(PDF_OBJ) : $(FITZ_HDR) $(PDF_HDR) $(PDF_SRC_HDR) +@@ -106,14 +97,14 @@ $(PDF_JS_NONE_OBJ) := $(FITZ_HDR) $(PDF + + # --- Library --- + +-MUPDF_LIB := $(OUT)/libmupdf.a +-MUPDF_JS_NONE_LIB := $(OUT)/libmupdf-js-none.a ++MUPDF_LIB := $(OUT)/libmupdf.la ++MUPDF_JS_NONE_LIB := $(OUT)/libmupdf-js-none.la + + $(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(IMG_OBJ) + $(MUPDF_JS_NONE_LIB) : $(PDF_JS_NONE_OBJ) + + ifeq "$(V8_PRESENT)" "yes" +-MUPDF_JS_V8_LIB := $(OUT)/libmupdf-js-v8.a ++MUPDF_JS_V8_LIB := $(OUT)/libmupdf-js-v8.la + $(MUPDF_JS_V8_LIB) : $(PDF_JS_V8_OBJ) + endif - # --- Rules --- - -@@ -47,33 +39,32 @@ MUCBZ_HDR := $(FITZ_HDR) cbz/mucbz.h - $(OUT) $(GEN) : +@@ -124,31 +115,29 @@ INSTALL_LIBS := $(MUPDF_LIB) $(MUPDF_JS_ + $(ALL_DIR) $(OUT) $(GEN) : $(MKDIR_CMD) -$(OUT)/%.a : +$(OUT)/%.la : + $(RM_CMD) $(AR_CMD) - $(RANLIB_CMD) --$(OUT)/% : $(OUT)/%.o -+$(OUT)/% : $(OUT)/%.lo +-$(OUT)/%: $(OUT)/%.o ++$(OUT)/%: $(OUT)/%.lo $(LINK_CMD) --$(OUT)/%.o : fitz/%.c $(FITZ_HDR) | $(OUT) -+$(OUT)/%.lo : fitz/%.c $(FITZ_HDR) | $(OUT) - $(CC_CMD) --$(OUT)/%.o : draw/%.c $(FITZ_HDR) | $(OUT) -+$(OUT)/%.lo : draw/%.c $(FITZ_HDR) | $(OUT) - $(CC_CMD) --$(OUT)/%.o : pdf/%.c $(MUPDF_HDR) | $(OUT) -+$(OUT)/%.lo : pdf/%.c $(MUPDF_HDR) | $(OUT) - $(CC_CMD) --$(OUT)/%.o : xps/%.c $(MUXPS_HDR) | $(OUT) -+$(OUT)/%.lo : xps/%.c $(MUXPS_HDR) | $(OUT) - $(CC_CMD) --$(OUT)/%.o : cbz/%.c $(MUCBZ_HDR) | $(OUT) -+$(OUT)/%.lo : cbz/%.c $(MUCBZ_HDR) | $(OUT) - $(CC_CMD) --$(OUT)/%.o : apps/%.c fitz/fitz.h pdf/mupdf.h xps/muxps.h cbz/mucbz.h | $(OUT) -+$(OUT)/%.lo : apps/%.c fitz/fitz.h pdf/mupdf.h xps/muxps.h cbz/mucbz.h | $(OUT) +-$(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) --.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules -+.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules +-$(OUT)/platform/x11/%.o : platform/x11/%.c | $(ALL_DIR) ++$(OUT)/platform/x11/%.lo : platform/x11/%.c | $(ALL_DIR) + $(CC_CMD) $(X11_CFLAGS) $(CURL_CFLAGS) - # --- Fitz, MuPDF, MuXPS and MuCBZ library --- +-$(OUT)/platform/x11/curl/%.o : platform/x11/%.c | $(ALL_DIR) +- mkdir -p $(OUT)/platform/x11/curl ++$(OUT)/platform/x11/curl/%.lo : platform/x11/%.c | $(ALL_DIR) + $(CC_CMD) $(X11_CFLAGS) $(CURL_CFLAGS) -DHAVE_CURL --FITZ_LIB := $(OUT)/libfitz.a -+FITZ_LIB := $(OUT)/libfitz.la - - FITZ_SRC := $(notdir $(wildcard fitz/*.c draw/*.c)) - FITZ_SRC := $(filter-out draw_simple_scale.c, $(FITZ_SRC)) -@@ -81,10 +72,10 @@ MUPDF_SRC := $(notdir $(wildcard pdf/*.c - MUXPS_SRC := $(notdir $(wildcard xps/*.c)) - MUCBZ_SRC := $(notdir $(wildcard cbz/*.c)) - --$(FITZ_LIB) : $(addprefix $(OUT)/, $(FITZ_SRC:%.c=%.o)) --$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUPDF_SRC:%.c=%.o)) --$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUXPS_SRC:%.c=%.o)) --$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUCBZ_SRC:%.c=%.o)) -+$(FITZ_LIB) : $(addprefix $(OUT)/, $(FITZ_SRC:%.c=%.lo)) -+$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUPDF_SRC:%.c=%.lo)) -+$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUXPS_SRC:%.c=%.lo)) -+$(FITZ_LIB) : $(addprefix $(OUT)/, $(MUCBZ_SRC:%.c=%.lo)) +-.PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules ++.PRECIOUS : $(OUT)/%.lo # Keep intermediates from chained rules - libs: $(FITZ_LIB) $(THIRD_LIBS) + # --- Generated CMAP, FONT and JAVASCRIPT files --- -@@ -127,9 +118,9 @@ endif +@@ -208,41 +197,41 @@ endif - generate: $(CMAP_HDR) $(FONT_HDR) + generate: $(CMAP_GEN) $(FONT_GEN) $(JAVASCRIPT_GEN) $(ADOBECA_GEN) --$(OUT)/pdf_cmap_table.o : $(CMAP_HDR) --$(OUT)/pdf_fontfile.o : $(FONT_HDR) --$(OUT)/cmapdump.o : pdf/pdf_cmap.c pdf/pdf_cmap_parse.c -+$(OUT)/pdf_cmap_table.lo : $(CMAP_HDR) -+$(OUT)/pdf_fontfile.lo : $(FONT_HDR) -+$(OUT)/cmapdump.lo : pdf/pdf_cmap.c pdf/pdf_cmap_parse.c +-$(OUT)/pdf/pdf-cmap-table.o : $(CMAP_GEN) +-$(OUT)/pdf/pdf-fontfile.o : $(FONT_GEN) +-$(OUT)/pdf/pdf-pkcs7.o : $(ADOBECA_GEN) +-$(OUT)/pdf/js/pdf-js.o : $(JAVASCRIPT_GEN) +-$(OUT)/cmapdump.o : source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c ++$(OUT)/pdf/pdf-cmap-table.lo : $(CMAP_GEN) ++$(OUT)/pdf/pdf-fontfile.lo : $(FONT_GEN) ++$(OUT)/pdf/pdf-pkcs7.lo : $(ADOBECA_GEN) ++$(OUT)/pdf/js/pdf-js.lo : $(JAVASCRIPT_GEN) ++$(OUT)/cmapdump.lo : source/pdf/pdf-cmap.c source/pdf/pdf-cmap-parse.c # --- Tools and Apps --- -@@ -137,12 +128,12 @@ MUDRAW := $(addprefix $(OUT)/, mudraw) - $(MUDRAW) : $(FITZ_LIB) $(THIRD_LIBS) + MUDRAW := $(addprefix $(OUT)/, mudraw) + $(MUDRAW) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS) +-$(MUDRAW) : $(addprefix $(OUT)/tools/, mudraw.o) ++$(MUDRAW) : $(addprefix $(OUT)/tools/, mudraw.lo) + $(LINK_CMD) + + MUTOOL := $(addprefix $(OUT)/, mutool) + $(MUTOOL) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS) +-$(MUTOOL) : $(addprefix $(OUT)/tools/, mutool.o pdfclean.o pdfextract.o pdfinfo.o pdfposter.o pdfshow.o) ++$(MUTOOL) : $(addprefix $(OUT)/tools/, mutool.lo pdfclean.lo pdfextract.lo pdfinfo.lo pdfposter.lo pdfshow.lo) + $(LINK_CMD) - MUBUSY := $(addprefix $(OUT)/, mubusy) --$(MUBUSY) : $(addprefix $(OUT)/, mupdfclean.o mupdfextract.o mupdfinfo.o mupdfposter.o mupdfshow.o) $(FITZ_LIB) $(THIRD_LIBS) -+$(MUBUSY) : $(addprefix $(OUT)/, mupdfclean.lo mupdfextract.lo mupdfinfo.lo mupdfposter.lo mupdfshow.lo) $(FITZ_LIB) $(THIRD_LIBS) + ifeq "$(V8_PRESENT)" "yes" + MUJSTEST_V8 := $(OUT)/mujstest-v8 + $(MUJSTEST_V8) : $(MUPDF_LIB) $(MUPDF_JS_V8_LIB) $(THIRD_LIBS) +-$(MUJSTEST_V8) : $(addprefix $(OUT)/platform/x11/, jstest_main.o pdfapp.o) ++$(MUJSTEST_V8) : $(addprefix $(OUT)/platform/x11/, jstest_main.lo pdfapp.lo) + $(LINK_CMD) $(V8_LIBS) + endif ifeq "$(NOX11)" "" - MUVIEW := $(OUT)/mupdf - $(MUVIEW) : $(FITZ_LIB) $(THIRD_LIBS) --$(MUVIEW) : $(addprefix $(OUT)/, x11_main.o x11_image.o pdfapp.o) -+$(MUVIEW) : $(addprefix $(OUT)/, x11_main.lo x11_image.lo pdfapp.lo) +-MUVIEW_X11 := $(OUT)/mupdf-x11 ++MUVIEW_X11 := $(OUT)/platform/x11/mupdf + $(MUVIEW_X11) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS) +-$(MUVIEW_X11) : $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o) ++$(MUVIEW_X11) : $(addprefix $(OUT)/platform/x11/, x11_main.lo x11_image.lo pdfapp.lo) $(LINK_CMD) $(X11_LIBS) - endif -@@ -165,11 +156,14 @@ incdir ?= $(prefix)/include - mandir ?= $(prefix)/share/man - - install: $(FITZ_LIB) $(MUVIEW) $(MUDRAW) $(MUBUSY) -- install -d $(bindir) $(libdir) $(incdir) $(mandir)/man1 -- install $(FITZ_LIB) $(libdir) -- install fitz/memento.h fitz/fitz.h pdf/mupdf.h xps/muxps.h cbz/mucbz.h $(incdir) -- install $(MUVIEW) $(MUDRAW) $(MUBUSY) $(bindir) -- install $(wildcard apps/man/*.1) $(mandir)/man1 -+ ${BSD_INSTALL_DATA_DIR} $(bindir) $(libdir) $(incdir) -+ ${BSD_INSTALL_MAN_DIR} $(mandir)/man1 -+ ${LIBTOOL} --mode=install ${BSD_INSTALL_LIB} $(FITZ_LIB) $(libdir) -+ ${BSD_INSTALL_DATA} fitz/memento.h fitz/fitz.h pdf/mupdf.h xps/muxps.h cbz/mucbz.h $(incdir) -+ for f in $(MUVIEW) $(MUDRAW) $(MUBUSY); do \ -+ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} $$f $(bindir); \ + ifeq "$(NOCURL)" "" +-MUVIEW_X11_CURL := $(OUT)/mupdf-x11-curl ++MUVIEW_X11_CURL := $(OUT)/platform/x11/curl/mupdf + $(MUVIEW_X11_CURL) : $(MUPDF_LIB) $(MUPDF_JS_NONE_LIB) $(THIRD_LIBS) $(CURL_LIB) +-$(MUVIEW_X11_CURL) : $(addprefix $(OUT)/platform/x11/curl/, x11_main.o x11_image.o pdfapp.o curl_stream.o) ++$(MUVIEW_X11_CURL) : $(addprefix $(OUT)/platform/x11/curl/, x11_main.lo x11_image.lo pdfapp.lo curl_stream.lo) + $(LINK_CMD) $(X11_LIBS) $(CURL_LIBS) + endif + endif +@@ -251,7 +240,7 @@ ifeq "$(V8_PRESENT)" "yes" + ifeq "$(NOX11)" "" + MUVIEW_X11_V8 := $(OUT)/mupdf-x11-v8 + $(MUVIEW_X11_V8) : $(MUPDF_LIB) $(MUPDF_JS_V8_LIB) $(THIRD_LIBS) +-$(MUVIEW_X11_V8) : $(addprefix $(OUT)/platform/x11/, x11_main.o x11_image.o pdfapp.o) ++$(MUVIEW_X11_V8) : $(addprefix $(OUT)/platform/x11/, x11_main.lo x11_image.lo pdfapp.lo) + $(LINK_CMD) $(X11_LIBS) $(V8_LIBS) + endif + endif +@@ -260,7 +249,12 @@ MUVIEW := $(MUVIEW_X11) + MUVIEW_V8 := $(MUVIEW_X11_V8) + MUVIEW_CURL := $(MUVIEW_X11_CURL) + +-INSTALL_APPS := $(MUDRAW) $(MUTOOL) $(MUVIEW) $(MUJSTEST_V8) $(MUVIEW_V8) $(MUVIEW_CURL) ++INSTALL_APPS := $(MUDRAW) $(MUTOOL) ++ifeq "$(NOCURL)" "" ++INSTALL_APPS += $(MUVIEW_CURL) ++else ifeq "$(NOX11)" "" ++INSTALL_APPS += $(MUVIEW) ++endif + + # --- Format man pages --- + +@@ -286,24 +280,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} $(bindir) ++ for f in $(INSTALL_APPS); do \ ++ ${LIBTOOL} --mode=install ${BSD_INSTALL_PROGRAM} $$f $(DESTDIR)$(bindir); \ + done -+ ${BSD_INSTALL_MAN} $(wildcard apps/man/*.1) $(mandir)/man1 - # --- Clean and Default --- +- 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/print/mupdf/patches/patch-ae b/print/mupdf/patches/patch-ae index c78820a08ac..67db8543dac 100644 --- a/print/mupdf/patches/patch-ae +++ b/print/mupdf/patches/patch-ae @@ -1,9 +1,9 @@ -$NetBSD: patch-ae,v 1.2 2012/08/21 19:50:54 drochner Exp $ +$NetBSD: patch-ae,v 1.3 2014/01/09 14:25:23 mef Exp $ -avoid namespace conflict on NetBSD +Avoid namespace conflicts with bswap(3). ---- fitz/crypt_sha2.c.orig 2012-08-16 13:55:20.000000000 +0000 -+++ fitz/crypt_sha2.c +--- source/fitz/crypt-sha2.c.orig 2013-08-14 12:41:20.000000000 +0000 ++++ source/fitz/crypt-sha2.c @@ -17,7 +17,7 @@ static inline int isbigendian(void) return *(char*)&one == 0; } @@ -66,7 +66,7 @@ avoid namespace conflict on NetBSD + context->buffer.u64[15] = mup_bswap64(context->count[0]); transform512(context->state, context->buffer.u64); - for (j = 0; j < 16; j++) + for (j = 0; j < 8; j++) - ((uint64_t *)digest)[j] = bswap64(context->state[j]); + ((uint64_t *)digest)[j] = mup_bswap64(context->state[j]); memset(context, 0, sizeof(fz_sha512)); diff --git a/print/mupdf/patches/patch-fitz_image_jpx.c b/print/mupdf/patches/patch-fitz_image_jpx.c deleted file mode 100644 index 76ef8e3af44..00000000000 --- a/print/mupdf/patches/patch-fitz_image_jpx.c +++ /dev/null @@ -1,15 +0,0 @@ -$NetBSD: patch-fitz_image_jpx.c,v 1.1 2012/12/08 23:09:40 adam Exp $ - -Fix path to openjpeg include. - ---- fitz/image_jpx.c.orig 2012-12-08 22:53:28.000000000 +0000 -+++ fitz/image_jpx.c -@@ -1,7 +1,7 @@ - #include "fitz-internal.h" - - #define OPJ_STATIC --#include -+#include - - static void fz_opj_error_callback(const char *msg, void *client_data) - { -- cgit v1.2.3