aboutsummaryrefslogtreecommitdiff
path: root/graphics/mupdf
diff options
context:
space:
mode:
authorSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-10-04 18:01:53 +0000
committerSunpoet Po-Chuan Hsieh <sunpoet@FreeBSD.org>2015-10-04 18:01:53 +0000
commit10cec83bc5d282f87963b9713293130c489d48b1 (patch)
treecb606db0f64b16d7394aa5cc1da7c8fa594017c1 /graphics/mupdf
parent002b9ffba6c00ee7572328cc8122c4c51e059f7e (diff)
downloadports-10cec83bc5d282f87963b9713293130c489d48b1.tar.gz
ports-10cec83bc5d282f87963b9713293130c489d48b1.zip
Notes
Diffstat (limited to 'graphics/mupdf')
-rw-r--r--graphics/mupdf/Makefile20
-rw-r--r--graphics/mupdf/files/patch-source__fitz__load-jpx.c25
2 files changed, 27 insertions, 18 deletions
diff --git a/graphics/mupdf/Makefile b/graphics/mupdf/Makefile
index 0ff276247b41..f3d773bb69ab 100644
--- a/graphics/mupdf/Makefile
+++ b/graphics/mupdf/Makefile
@@ -3,18 +3,17 @@
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 \
@@ -35,16 +34,9 @@ OPTIONS_DEFAULT=SCROLL
SCROLL_DESC= Build with scroll hacks
JS_DESC= JavaScript support (V8 engine)
-.include <bsd.port.options.mk>
-
-.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 //' \
diff --git a/graphics/mupdf/files/patch-source__fitz__load-jpx.c b/graphics/mupdf/files/patch-source__fitz__load-jpx.c
index befed22f76d4..3f28b2908099 100644
--- a/graphics/mupdf/files/patch-source__fitz__load-jpx.c
+++ b/graphics/mupdf/files/patch-source__fitz__load-jpx.c
@@ -1,15 +1,25 @@
---- ./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 <openjpeg.h>
+#include <openjpeg-2.1/openjpeg.h>
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);
@@ -18,3 +28,10 @@
/* 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