View | Details | Raw Unified | Return to bug 199576 | Differences between
and this patch

Collapse All | Expand All

(-)graphics/mupdf/Makefile (-1 / +1 lines)
Lines 2-8 Link Here
2
# $FreeBSD: head/graphics/mupdf/Makefile 370949 2014-10-15 19:48:22Z amdmi3 $
2
# $FreeBSD: head/graphics/mupdf/Makefile 370949 2014-10-15 19:48:22Z amdmi3 $
3
3
4
PORTNAME=	mupdf
4
PORTNAME=	mupdf
5
PORTVERSION=	1.6
5
PORTVERSION=	1.7
6
PORTEPOCH=	1
6
PORTEPOCH=	1
7
CATEGORIES=	graphics
7
CATEGORIES=	graphics
8
MASTER_SITES=	GOOGLE_CODE \
8
MASTER_SITES=	GOOGLE_CODE \
(-)graphics/mupdf/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (mupdf-1.6-source.tar.gz) = 9813ee330950a641364181649ebd369c947adbcea9d41ed953ec5365640ea563
1
SHA256 (mupdf-1.7-source.tar.gz) = d0bd5c656c464411cb5788c73d5a7c9a5b89f1e9e84e3c8c7c982ed8b90f5642
2
SIZE (mupdf-1.6-source.tar.gz) = 13975531
2
SIZE (mupdf-1.7-source.tar.gz) = 13301969
(-)graphics/mupdf/files/patch-platform__x11__x11_main.c (-27 lines)
Lines 1-27 Link Here
1
--- ./platform/x11/x11_main.c.orig	2014-06-10 17:09:28.000000000 +0200
2
+++ ./platform/x11/x11_main.c	2014-08-04 18:51:44.000000000 +0200
3
@@ -794,6 +794,24 @@
4
 	exit(1);
5
 }
6
 
7
+/* reference:
8
+ * http://stackoverflow.com/questions/2621439/how-to-get-screen-dpi-linux-mac-programatically
9
+ */
10
+int get_dpi(void)
11
+{
12
+	Display *xdpy;
13
+	int xscr;
14
+	int x = 0;
15
+
16
+	if ((xdpy = XOpenDisplay(NULL))) {
17
+		xscr = DefaultScreen(xdpy);
18
+		x = (int) (DisplayWidth(xdpy, xscr) * 25.4 /
19
+				DisplayWidthMM(xdpy, xscr) + 0.5);
20
+		XCloseDisplay(xdpy);
21
+	}
22
+	return x;
23
+}
24
+
25
 int main(int argc, char **argv)
26
 {
27
 	int c;
(-)graphics/mupdf/files/scroll_hack-platform__x11__pdfapp.c (-13 lines)
Lines 34-49 Link Here
34
 		panto = PAN_TO_TOP;
34
 		panto = PAN_TO_TOP;
35
 		if (app->numberlen > 0)
35
 		if (app->numberlen > 0)
36
 			app->pageno += atoi(app->number);
36
 			app->pageno += atoi(app->number);
37
@@ -1585,6 +1591,12 @@
38
 				int isx = (modifiers & (1<<0));
39
 				int xstep = isx ? 20 * dir : 0;
40
 				int ystep = !isx ? 20 * dir : 0;
41
+				if (!isx && dir < 0 && app->pany +
42
+				    fz_pixmap_height(app->ctx, app->image) <= app->winh)
43
+					pdfapp_onkey(app, 'j');
44
+				else if (!isx && dir > 0 && app->pany >= 0)
45
+					pdfapp_onkey(app, 'k');
46
+				else
47
 				pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
48
 			}
49
 		}
(-)graphics/mupdf/mupdf/Makefile (-68 lines)
Lines 1-68 Link Here
1
# Created by: Martin Dieringer <martin.dieringer@gmx.de>
2
# $FreeBSD: head/graphics/mupdf/Makefile 370949 2014-10-15 19:48:22Z amdmi3 $
3
4
PORTNAME=	mupdf
5
PORTVERSION=	1.6
6
PORTEPOCH=	1
7
CATEGORIES=	graphics
8
MASTER_SITES=	GOOGLE_CODE \
9
		http://www.mupdf.com/download/
10
EXTRACT_SUFX=	-source.tar.gz
11
12
MAINTAINER=	udvzsolt@gmail.com
13
COMMENT=	Lightweight PDF viewer and toolkit
14
15
LICENSE=	AGPLv3
16
17
LIB_DEPENDS=	libcurl.so:${PORTSDIR}/ftp/curl \
18
		libfreetype.so:${PORTSDIR}/print/freetype2 \
19
		libjpeg.so:${PORTSDIR}/graphics/jpeg \
20
		libjbig2dec.so:${PORTSDIR}/graphics/jbig2dec \
21
		libopenjp2.so:${PORTSDIR}/graphics/openjpeg
22
23
LIBS+=		-L${LOCALBASE}/lib
24
MAKE_ARGS=	build=release prefix=${PREFIX} mandir=${PREFIX}/man verbose=yes
25
USES=		compiler:c++11-lang pkgconfig gmake
26
USE_XORG=	x11 xext
27
28
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-source
29
30
OPTIONS_DEFINE=	SCROLL JS
31
OPTIONS_DEFAULT=SCROLL
32
33
SCROLL_DESC=	Build with scroll hacks
34
JS_DESC=	JavaScript support (V8 engine)
35
36
.include <bsd.port.options.mk>
37
38
.if ${PORT_OPTIONS:MSCROLL}
39
EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-platform__x11__pdfapp.c
40
.endif
41
42
.if ${PORT_OPTIONS:MJS}
43
LIB_DEPENDS+=	libv8.so:${PORTSDIR}/lang/v8
44
MAKE_ARGS+=	V8_PRESENT=1 V8LIBS=-lv8
45
.endif
46
47
post-patch:
48
	@${REINPLACE_CMD} -e 's/-pipe -O2 //' \
49
		-e 's|/usr/local|${LOCALBASE}|' \
50
		-e 's/Linux/FreeBSD/' \
51
		${WRKSRC}/Makerules
52
	@${REINPLACE_CMD} '/^CFLAGS/s|$$| -I${LOCALBASE}/include|' \
53
		${WRKSRC}/Makefile
54
	@${RM} -r ${WRKSRC}/thirdparty/*
55
56
post-build:
57
	(cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} ${MAKE_CMD} ${MAKE_FLAGS} \
58
		${MAKEFILE} ${MAKE_ARGS} OUT=build/pic XCFLAGS=-fpic libs)
59
60
post-install:
61
	${INSTALL_DATA} ${WRKSRC}/build/pic/libmupdf.a \
62
		${STAGEDIR}${PREFIX}/lib/libmupdf_pic.a
63
	${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 ${STAGEDIR}${PREFIX}/bin/mupdf
64
.for binary in mudraw mutool mujstest mupdf mupdf-x11-curl
65
	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${binary}
66
.endfor
67
68
.include <bsd.port.mk>
(-)graphics/mupdf/mupdf/distinfo (-2 lines)
Lines 1-2 Link Here
1
SHA256 (mupdf-1.6-source.tar.gz) = 9813ee330950a641364181649ebd369c947adbcea9d41ed953ec5365640ea563
2
SIZE (mupdf-1.6-source.tar.gz) = 13975531
(-)graphics/mupdf/mupdf/files/patch-platform__x11__x11_main.c (-27 lines)
Lines 1-27 Link Here
1
--- ./platform/x11/x11_main.c.orig	2014-06-10 17:09:28.000000000 +0200
2
+++ ./platform/x11/x11_main.c	2014-08-04 18:51:44.000000000 +0200
3
@@ -794,6 +794,24 @@
4
 	exit(1);
5
 }
6
 
7
+/* reference:
8
+ * http://stackoverflow.com/questions/2621439/how-to-get-screen-dpi-linux-mac-programatically
9
+ */
10
+int get_dpi(void)
11
+{
12
+	Display *xdpy;
13
+	int xscr;
14
+	int x = 0;
15
+
16
+	if ((xdpy = XOpenDisplay(NULL))) {
17
+		xscr = DefaultScreen(xdpy);
18
+		x = (int) (DisplayWidth(xdpy, xscr) * 25.4 /
19
+				DisplayWidthMM(xdpy, xscr) + 0.5);
20
+		XCloseDisplay(xdpy);
21
+	}
22
+	return x;
23
+}
24
+
25
 int main(int argc, char **argv)
26
 {
27
 	int c;
(-)graphics/mupdf/mupdf/files/patch-source__fitz__load-jpx.c (-20 lines)
Lines 1-20 Link Here
1
--- ./source/fitz/load-jpx.c.orig	2014-06-10 17:09:28.000000000 +0200
2
+++ ./source/fitz/load-jpx.c	2014-08-04 18:51:45.000000000 +0200
3
@@ -8,7 +8,7 @@
4
 #define OPJ_HAVE_STDINT_H
5
 #endif
6
 
7
-#include <openjpeg.h>
8
+#include <openjpeg-2.1/openjpeg.h>
9
 
10
 static void fz_opj_error_callback(const char *msg, void *client_data)
11
 {
12
@@ -116,7 +116,7 @@
13
 	opj_stream_set_read_function(stream, fz_opj_stream_read);
14
 	opj_stream_set_skip_function(stream, fz_opj_stream_skip);
15
 	opj_stream_set_seek_function(stream, fz_opj_stream_seek);
16
-	opj_stream_set_user_data(stream, &sb);
17
+	opj_stream_set_user_data(stream, &sb,NULL);
18
 	/* Set the length to avoid an assert */
19
 	opj_stream_set_user_data_length(stream, size);
20
 
(-)graphics/mupdf/mupdf/files/scroll_hack-platform__x11__pdfapp.c (-49 lines)
Lines 1-49 Link Here
1
--- ./platform/x11/pdfapp.c.orig	2014-08-04 19:59:53.000000000 +0200
2
+++ ./platform/x11/pdfapp.c	2014-08-04 20:03:46.000000000 +0200
3
@@ -1166,6 +1166,8 @@
4
 	case 'j':
5
 		{
6
 			int h = fz_pixmap_height(app->ctx, app->image);
7
+                        if ( (app->pany + h) <= app->winh )
8
+                            goto pagedown;
9
 			if (h <= app->winh || app->pany <= app->winh - h)
10
 			{
11
 				panto = PAN_TO_TOP;
12
@@ -1182,6 +1184,8 @@
13
 	case 'k':
14
 		{
15
 			int h = fz_pixmap_height(app->ctx, app->image);
16
+                        if (app->pany >= 0)
17
+                            goto pageup;
18
 			if (h <= app->winh || app->pany == 0)
19
 			{
20
 				panto = PAN_TO_BOTTOM;
21
@@ -1257,6 +1261,7 @@
22
 	 */
23
 
24
 	case ',':
25
+        pageup:
26
 		panto = PAN_TO_BOTTOM;
27
 		if (app->numberlen > 0)
28
 			app->pageno -= atoi(app->number);
29
@@ -1265,6 +1270,7 @@
30
 		break;
31
 
32
 	case '.':
33
+        pagedown:
34
 		panto = PAN_TO_TOP;
35
 		if (app->numberlen > 0)
36
 			app->pageno += atoi(app->number);
37
@@ -1585,6 +1591,12 @@
38
 				int isx = (modifiers & (1<<0));
39
 				int xstep = isx ? 20 * dir : 0;
40
 				int ystep = !isx ? 20 * dir : 0;
41
+				if (!isx && dir < 0 && app->pany +
42
+				    fz_pixmap_height(app->ctx, app->image) <= app->winh)
43
+					pdfapp_onkey(app, 'j');
44
+				else if (!isx && dir > 0 && app->pany >= 0)
45
+					pdfapp_onkey(app, 'k');
46
+				else
47
 				pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
48
 			}
49
 		}
(-)graphics/mupdf/mupdf/pkg-descr (-18 lines)
Lines 1-18 Link Here
1
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
2
3
The renderer in MuPDF is tailored for high quality anti-aliased graphics. It
4
renders text with metrics and spacing accurate to within fractions of a
5
pixel for the highest fidelity in reproducing the look of a printed page on
6
screen.
7
8
MuPDF has a small footprint. A binary that includes the standard Roman fonts
9
is only one megabyte. A build with full CJK support (including an Asian
10
font) is approximately five megabytes.
11
12
MuPDF has support for all non-interactive PDF 1.7 features, and the toolkit
13
provides a simple API for accessing the internal structures of the PDF
14
document. Example code for navigating interactive links and bookmarks,
15
encrypting PDF files, extracting fonts, images, and searchable text, and
16
rendering pages to image files is provided.
17
18
WWW: http://www.mupdf.com/
(-)graphics/mupdf/mupdf/pkg-plist (-85 lines)
Lines 1-85 Link Here
1
bin/mudraw
2
bin/mujstest
3
bin/mupdf
4
bin/mupdf-x11-curl
5
bin/mutool
6
include/mupdf/cbz.h
7
include/mupdf/fitz.h
8
include/mupdf/fitz/annotation.h
9
include/mupdf/fitz/bitmap.h
10
include/mupdf/fitz/buffer.h
11
include/mupdf/fitz/colorspace.h
12
include/mupdf/fitz/compressed-buffer.h
13
include/mupdf/fitz/context.h
14
include/mupdf/fitz/crypt.h
15
include/mupdf/fitz/device.h
16
include/mupdf/fitz/display-list.h
17
include/mupdf/fitz/document.h
18
include/mupdf/fitz/filter.h
19
include/mupdf/fitz/font.h
20
include/mupdf/fitz/function.h
21
include/mupdf/fitz/getopt.h
22
include/mupdf/fitz/glyph-cache.h
23
include/mupdf/fitz/glyph.h
24
include/mupdf/fitz/hash.h
25
include/mupdf/fitz/image.h
26
include/mupdf/fitz/link.h
27
include/mupdf/fitz/math.h
28
include/mupdf/fitz/meta.h
29
include/mupdf/fitz/outline.h
30
include/mupdf/fitz/output-pcl.h
31
include/mupdf/fitz/output-png.h
32
include/mupdf/fitz/output-pnm.h
33
include/mupdf/fitz/output-pwg.h
34
include/mupdf/fitz/output-svg.h
35
include/mupdf/fitz/output-tga.h
36
include/mupdf/fitz/output.h
37
include/mupdf/fitz/path.h
38
include/mupdf/fitz/pixmap.h
39
include/mupdf/fitz/shade.h
40
include/mupdf/fitz/store.h
41
include/mupdf/fitz/stream.h
42
include/mupdf/fitz/string.h
43
include/mupdf/fitz/structured-text.h
44
include/mupdf/fitz/system.h
45
include/mupdf/fitz/text.h
46
include/mupdf/fitz/transition.h
47
include/mupdf/fitz/tree.h
48
include/mupdf/fitz/version.h
49
include/mupdf/fitz/write-document.h
50
include/mupdf/fitz/xml.h
51
include/mupdf/img.h
52
include/mupdf/memento.h
53
include/mupdf/pdf.h
54
include/mupdf/pdf-tools.h
55
include/mupdf/pdf/annot.h
56
include/mupdf/pdf/appearance.h
57
include/mupdf/pdf/cmap.h
58
include/mupdf/pdf/crypt.h
59
include/mupdf/pdf/document.h
60
include/mupdf/pdf/event.h
61
include/mupdf/pdf/field.h
62
include/mupdf/pdf/font.h
63
include/mupdf/pdf/javascript.h
64
include/mupdf/pdf/object.h
65
include/mupdf/pdf/output-pdf.h
66
include/mupdf/pdf/page.h
67
include/mupdf/pdf/parse.h
68
include/mupdf/pdf/resource.h
69
include/mupdf/pdf/widget.h
70
include/mupdf/pdf/xref.h
71
include/mupdf/tiff.h
72
include/mupdf/xps.h
73
lib/libmupdf.a
74
lib/libmupdf_pic.a
75
man/man1/mudraw.1.gz
76
man/man1/mupdf.1.gz
77
man/man1/mutool.1.gz
78
%%PORTDOCS%%%%DOCSDIR%%/CHANGES
79
%%PORTDOCS%%%%DOCSDIR%%/COPYING
80
%%PORTDOCS%%%%DOCSDIR%%/README
81
%%PORTDOCS%%%%DOCSDIR%%/naming.txt
82
%%PORTDOCS%%%%DOCSDIR%%/overview.txt
83
%%PORTDOCS%%%%DOCSDIR%%/progressive.txt
84
%%PORTDOCS%%%%DOCSDIR%%/refcount.txt
85
%%PORTDOCS%%%%DOCSDIR%%/thirdparty.txt
(-)graphics/mupdf/pkg-plist (-4 / +5 lines)
Lines 3-9 Link Here
3
bin/mupdf
3
bin/mupdf
4
bin/mupdf-x11-curl
4
bin/mupdf-x11-curl
5
bin/mutool
5
bin/mutool
6
include/mupdf/cbz.h
7
include/mupdf/fitz.h
6
include/mupdf/fitz.h
8
include/mupdf/fitz/annotation.h
7
include/mupdf/fitz/annotation.h
9
include/mupdf/fitz/bitmap.h
8
include/mupdf/fitz/bitmap.h
Lines 25-31 Link Here
25
include/mupdf/fitz/image.h
24
include/mupdf/fitz/image.h
26
include/mupdf/fitz/link.h
25
include/mupdf/fitz/link.h
27
include/mupdf/fitz/math.h
26
include/mupdf/fitz/math.h
28
include/mupdf/fitz/meta.h
29
include/mupdf/fitz/outline.h
27
include/mupdf/fitz/outline.h
30
include/mupdf/fitz/output-pcl.h
28
include/mupdf/fitz/output-pcl.h
31
include/mupdf/fitz/output-png.h
29
include/mupdf/fitz/output-png.h
Lines 45-66 Link Here
45
include/mupdf/fitz/text.h
43
include/mupdf/fitz/text.h
46
include/mupdf/fitz/transition.h
44
include/mupdf/fitz/transition.h
47
include/mupdf/fitz/tree.h
45
include/mupdf/fitz/tree.h
46
include/mupdf/fitz/unzip.h
48
include/mupdf/fitz/version.h
47
include/mupdf/fitz/version.h
49
include/mupdf/fitz/write-document.h
48
include/mupdf/fitz/write-document.h
50
include/mupdf/fitz/xml.h
49
include/mupdf/fitz/xml.h
51
include/mupdf/img.h
50
include/mupdf/html.h
52
include/mupdf/memento.h
51
include/mupdf/memento.h
53
include/mupdf/pdf.h
52
include/mupdf/pdf.h
54
include/mupdf/pdf-tools.h
53
include/mupdf/pdf-tools.h
55
include/mupdf/pdf/annot.h
54
include/mupdf/pdf/annot.h
56
include/mupdf/pdf/appearance.h
55
include/mupdf/pdf/appearance.h
56
include/mupdf/pdf/clean.h
57
include/mupdf/pdf/cmap.h
57
include/mupdf/pdf/cmap.h
58
include/mupdf/pdf/crypt.h
58
include/mupdf/pdf/crypt.h
59
include/mupdf/pdf/document.h
59
include/mupdf/pdf/document.h
60
include/mupdf/pdf/event.h
60
include/mupdf/pdf/event.h
61
include/mupdf/pdf/field.h
61
include/mupdf/pdf/field.h
62
include/mupdf/pdf/font.h
62
include/mupdf/pdf/font.h
63
include/mupdf/pdf/interpret.h
63
include/mupdf/pdf/javascript.h
64
include/mupdf/pdf/javascript.h
65
include/mupdf/pdf/name-table.h
64
include/mupdf/pdf/object.h
66
include/mupdf/pdf/object.h
65
include/mupdf/pdf/output-pdf.h
67
include/mupdf/pdf/output-pdf.h
66
include/mupdf/pdf/page.h
68
include/mupdf/pdf/page.h
Lines 68-74 Link Here
68
include/mupdf/pdf/resource.h
70
include/mupdf/pdf/resource.h
69
include/mupdf/pdf/widget.h
71
include/mupdf/pdf/widget.h
70
include/mupdf/pdf/xref.h
72
include/mupdf/pdf/xref.h
71
include/mupdf/tiff.h
72
include/mupdf/xps.h
73
include/mupdf/xps.h
73
lib/libmupdf.a
74
lib/libmupdf.a
74
lib/libmupdf_pic.a
75
lib/libmupdf_pic.a

Return to bug 199576