Index: head/graphics/mupdf/Makefile =================================================================== --- head/graphics/mupdf/Makefile (revision 398614) +++ head/graphics/mupdf/Makefile (revision 398615) @@ -1,70 +1,62 @@ # Created by: Martin Dieringer # $FreeBSD$ PORTNAME= mupdf PORTVERSION= 1.7 +DISTVERSIONSUFFIX= -source PORTEPOCH= 1 CATEGORIES= graphics -MASTER_SITES= http://www.mupdf.com/download/ -EXTRACT_SUFX= -source.tar.gz +MASTER_SITES= http://www.mupdf.com/download/ \ + http://www.mupdf.com/download/archive/ MAINTAINER= udvzsolt@gmail.com COMMENT= Lightweight PDF viewer and toolkit LICENSE= AGPLv3 -BROKEN= fails to link with openjpeg 2.1.1 - LIB_DEPENDS= libcurl.so:${PORTSDIR}/ftp/curl \ libfreetype.so:${PORTSDIR}/print/freetype2 \ libjbig2dec.so:${PORTSDIR}/graphics/jbig2dec \ libopenjp2.so:${PORTSDIR}/graphics/openjpeg LIBS+= -L${LOCALBASE}/lib MAKE_ARGS= build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes USES= cpe compiler:c++11-lang gmake jpeg pkgconfig USE_XORG= x11 xext CPE_VENDOR= artifex WRKSRC= ${WRKDIR}/${PORTNAME}-${PORTVERSION}-source OPTIONS_DEFINE= SCROLL JS OPTIONS_DEFAULT=SCROLL SCROLL_DESC= Build with scroll hacks JS_DESC= JavaScript support (V8 engine) -.include - -.if ${PORT_OPTIONS:MSCROLL} -EXTRA_PATCHES+= ${FILESDIR}/scroll_hack-platform__x11__pdfapp.c -.endif - -.if ${PORT_OPTIONS:MJS} -LIB_DEPENDS+= libv8.so:${PORTSDIR}/lang/v8 -MAKE_ARGS+= V8_PRESENT=1 V8LIBS=-lv8 -.endif +SCROLL_EXTRA_PATCHES= ${FILESDIR}/scroll_hack-platform__x11__pdfapp.c +JS_LIB_DEPENDS= libv8.so:${PORTSDIR}/lang/v8 +JS_MAKE_ARGS= V8_PRESENT=1 V8LIBS=-lv8 post-patch: @${REINPLACE_CMD} -e 's/-pipe -O2 //' \ -e 's|/usr/local|${LOCALBASE}|' \ -e 's/Linux/FreeBSD/' \ ${WRKSRC}/Makerules @${REINPLACE_CMD} '/^CFLAGS/s|$$| -I${LOCALBASE}/include|' \ ${WRKSRC}/Makefile @${RM} -r ${WRKSRC}/thirdparty/* post-build: (cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \ ${MAKEFILE} ${MAKE_ARGS} OUT=build/pic XCFLAGS=-fpic libs) post-install: ${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdf.a \ ${STAGEDIR}${PREFIX}/lib/libmupdf_pic.a ${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 ${STAGEDIR}${PREFIX}/bin/mupdf .for binary in mudraw mutool mujstest mupdf mupdf-x11-curl ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${binary} .endfor .include Index: head/graphics/mupdf/files/patch-source__fitz__load-jpx.c =================================================================== --- head/graphics/mupdf/files/patch-source__fitz__load-jpx.c (revision 398614) +++ head/graphics/mupdf/files/patch-source__fitz__load-jpx.c (revision 398615) @@ -1,20 +1,37 @@ ---- ./source/fitz/load-jpx.c.orig 2014-06-10 17:09:28.000000000 +0200 -+++ ./source/fitz/load-jpx.c 2014-08-04 18:51:45.000000000 +0200 -@@ -8,7 +8,7 @@ +--- source/fitz/load-jpx.c.orig 2015-04-16 08:57:45 UTC ++++ source/fitz/load-jpx.c +@@ -3,12 +3,17 @@ + /* 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 __cplusplus ++extern "C" ++{ + #define OPJ_STATIC + #ifndef _MSC_VER #define OPJ_HAVE_STDINT_H #endif ++#endif -#include +#include static void fz_opj_error_callback(const char *msg, void *client_data) { -@@ -116,7 +116,7 @@ +@@ -117,7 +122,7 @@ fz_load_jpx(fz_context *ctx, unsigned ch opj_stream_set_read_function(stream, fz_opj_stream_read); opj_stream_set_skip_function(stream, fz_opj_stream_skip); opj_stream_set_seek_function(stream, fz_opj_stream_seek); - opj_stream_set_user_data(stream, &sb); + opj_stream_set_user_data(stream, &sb,NULL); /* Set the length to avoid an assert */ opj_stream_set_user_data_length(stream, size); +@@ -247,3 +252,6 @@ fz_load_jpx(fz_context *ctx, unsigned ch + + return img; + } ++#ifdef __cplusplus ++} ++#endif