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

Collapse All | Expand All

(-)graphics/mupdf/Makefile (-18 / +16 lines)
Lines 5-12 Link Here
5
# $FreeBSD: ports/graphics/mupdf/Makefile,v 1.19 2012/06/01 05:20:22 dinoex Exp $
5
# $FreeBSD: ports/graphics/mupdf/Makefile,v 1.19 2012/06/01 05:20:22 dinoex Exp $
6
6
7
PORTNAME=	mupdf
7
PORTNAME=	mupdf
8
PORTVERSION=	0.9
8
PORTVERSION=	1.0
9
PORTREVISION=	1
10
PORTEPOCH=	1
9
PORTEPOCH=	1
11
CATEGORIES=	graphics
10
CATEGORIES=	graphics
12
MASTER_SITES=	GOOGLE_CODE \
11
MASTER_SITES=	GOOGLE_CODE \
Lines 19-67 COMMENT= Lightweight PDF viewer and tool Link Here
19
LICENSE=	GPLv3
18
LICENSE=	GPLv3
20
LICENSE_FILE=	${WRKSRC}/COPYING
19
LICENSE_FILE=	${WRKSRC}/COPYING
21
20
22
LIB_DEPENDS=	freetype.9:${PORTSDIR}/print/freetype2 \
21
LIB_DEPENDS=	freetype:${PORTSDIR}/print/freetype2 \
23
		jpeg.11:${PORTSDIR}/graphics/jpeg \
22
		jpeg:${PORTSDIR}/graphics/jpeg \
24
		jbig2dec.0:${PORTSDIR}/graphics/jbig2dec \
23
		jbig2dec:${PORTSDIR}/graphics/jbig2dec \
25
		openjpeg.2:${PORTSDIR}/graphics/openjpeg
24
		openjpeg:${PORTSDIR}/graphics/openjpeg
26
25
27
USE_GMAKE=	yes
26
USE_GMAKE=	yes
28
MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1 mandir=${PREFIX}/man
27
MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1 mandir=${PREFIX}/man
29
USE_XORG=	x11 xext
28
USE_XORG=	x11 xext
30
USE_GNOME=	pkgconfig
29
USE_GNOME=	pkgconfig
31
MAN1=		mupdf.1 mu_pdfclean.1 mu_pdfdraw.1 mu_pdfshow.1
30
MAN1=		mupdf.1 mupdfclean.1 mudraw.1 mupdfshow.1
32
31
33
MAKE_JOBS_SAFE=	yes
32
MAKE_JOBS_SAFE=	yes
33
WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-source
34
34
35
OPTIONS=	SCROLL	"Build with scroll hacks" on \
35
OPTIONS_DEFINE=	SCROLL
36
OPTIONS_DEFAULT=SCROLL
37
38
SCROLL_DESC=	"Build with scroll hacks"
36
39
37
.include <bsd.port.options.mk>
40
.include <bsd.port.options.mk>
38
41
39
.if ${ARCH} == "amd64" || ${ARCH} == "i386"
42
.if ${CC:T:Mclang} == "clang"
43
CFLAGS+=	-no-integrated-as
44
.elif ${ARCH} == "amd64" || ${ARCH} == "i386"
40
CFLAGS+=	-mfpmath=sse
45
CFLAGS+=	-mfpmath=sse
41
.endif
46
.endif
42
47
43
.if defined(WITH_SCROLL)
48
.if ${PORT_OPTIONS:MSCROLL}
44
EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-apps_pdfapp.c
49
EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-apps_pdfapp.c
45
.endif
50
.endif
46
51
47
post-patch:	.SILENT
52
post-patch:	.SILENT
48
	${REINPLACE_CMD} \
53
	${REINPLACE_CMD} \
49
		-e 's#\(PDF_APPS :=.*/\)#\1mu_#' \
50
		-e 's#\(XPS_APPS :=.*/\)#\1mu_#' \
51
		-e 's#\(MUPDF) :.*/\)#\1mu_#' \
52
		-e 's#\(OUT)/\).*: apps/#\1mu_%.o : apps/#' \
53
		-e '/install:/,/^$$/ { /-d/d; }' \
54
		-e '/install:/,/^$$/ { /-d/d; }' \
54
		-e '/install.*bindir)$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
55
		-e '/install.*bindir)$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
55
		-e '/install.*libdir)$$/s/install/$$(BSD_INSTALL_LIB)/' \
56
		-e '/install.*libdir)$$/s/install/$$(BSD_INSTALL_LIB)/' \
56
		-e '/install.*incdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
57
		-e '/install.*incdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
57
		-e '/install.*man1$$/s/install/$$(BSD_INSTALL_MAN)/' \
58
		-e '/install.*man1$$/s/install/$$(BSD_INSTALL_MAN)/' \
58
		${WRKSRC}/Makefile
59
		${WRKSRC}/Makefile
59
	${REINPLACE_CMD} -e 's/-O2//' \
60
	${REINPLACE_CMD} -e 's/-pipe -O2 //' \
60
		-e 's|/usr/local|${LOCALBASE}|' \
61
		-e 's|/usr/local|${LOCALBASE}|' \
61
		${WRKSRC}/Makerules
62
		${WRKSRC}/Makerules
62
63
63
pre-install:	.SILENT
64
	${FIND} ${WRKSRC} -name pdf\*.1 -exec ${SH} -c 'mv {} $$(dirname {})/mu_$$(basename {})' \;
65
66
.include <bsd.port.pre.mk>
64
.include <bsd.port.pre.mk>
67
.include <bsd.port.post.mk>
65
.include <bsd.port.post.mk>
(-)graphics/mupdf/distinfo (-2 / +2 lines)
Lines 1-2 Link Here
1
SHA256 (mupdf-0.9-source.tar.gz) = abed825cb1d73e0e28f0a7ee72b5d7a451ba41d21b0c55837ed2a212f3b16b2d
1
SHA256 (mupdf-1.0-source.tar.gz) = 4f5e12625f7f827f6eb5606026c9a7a7dbdeaf935fcea3bc173ed8d469698ec2
2
SIZE (mupdf-0.9-source.tar.gz) = 3917075
2
SIZE (mupdf-1.0-source.tar.gz) = 4208530
(-)graphics/mupdf/files/patch-apps_x11_main.c (-24 / +4 lines)
Lines 1-18 Link Here
1
--- apps/x11_main.c.orig	2011-04-29 14:06:09.000000000 -0500
1
--- apps/x11_main.c.orig	2012-03-29 05:46:53.000000000 -0500
2
+++ apps/x11_main.c	2011-06-11 02:15:12.203411543 -0500
2
+++ apps/x11_main.c	2012-04-07 14:37:40.754315181 -0500
3
@@ -482,9 +482,7 @@ void winreloadfile(pdfapp_t *app)
3
@@ -602,6 +602,24 @@ static void usage(void)
4
 
4
 	exit(1);
5
 void winopenuri(pdfapp_t *app, char *buf)
6
 {
7
-	char *browser = getenv("BROWSER");
8
-	if (!browser)
9
-		browser = "open";
10
+	char browser[] = "xdg-open";
11
 	if (fork() == 0)
12
 		execlp(browser, browser, buf, (char*)0);
13
 }
14
@@ -563,6 +561,24 @@ static void winresettmo(struct timeval *
15
 	tmo_at->tv_usec = 0;
16
 }
5
 }
17
 
6
 
18
+/* reference:
7
+/* reference:
Lines 36-47 Link Here
36
 int main(int argc, char **argv)
25
 int main(int argc, char **argv)
37
 {
26
 {
38
 	int c;
27
 	int c;
39
@@ -571,7 +587,7 @@ int main(int argc, char **argv)
40
 	KeySym keysym;
41
 	int oldx = 0;
42
 	int oldy = 0;
43
-	int resolution = 72;
44
+	int resolution = get_dpi();
45
 	int pageno = 1;
46
 	int wasshowingpage;
47
 	struct timeval tmo, tmo_at;
(-)graphics/mupdf/files/scroll_hack-apps_pdfapp.c (-13 / +14 lines)
Lines 1-22 Link Here
1
--- apps/pdfapp.c.orig	2011-04-29 14:06:09.000000000 -0500
1
--- apps/pdfapp.c.orig	2012-03-29 05:46:53.000000000 -0500
2
+++ apps/pdfapp.c	2011-05-16 19:58:55.650380651 -0500
2
+++ apps/pdfapp.c	2012-04-07 16:43:55.030462608 -0500
3
@@ -777,11 +777,15 @@ void pdfapp_onkey(pdfapp_t *app, int c)
3
@@ -774,11 +774,15 @@ void pdfapp_onkey(pdfapp_t *app, int c)
4
 		break;
4
 		break;
5
 
5
 
6
 	case 'j':
6
 	case 'j':
7
+		if (app->pany + app->image->h <= app->winh)
7
+ 		if (app->pany + fz_pixmap_height(app->ctx, app->image) <= app->winh)
8
+			goto pagedown;
8
+ 			goto pagedown;
9
 		app->pany -= app->image->h / 10;
9
 		app->pany -= fz_pixmap_height(app->ctx, app->image) / 10;
10
 		pdfapp_showpage(app, 0, 0, 1);
10
 		pdfapp_showpage(app, 0, 0, 1);
11
 		break;
11
 		break;
12
 
12
 
13
 	case 'k':
13
 	case 'k':
14
+		if (app->pany >= 0)
14
+ 		if (app->pany >= 0)
15
+			goto pageup;
15
+ 			goto pageup;
16
 		app->pany += app->image->h / 10;
16
 		app->pany += fz_pixmap_height(app->ctx, app->image) / 10;
17
 		pdfapp_showpage(app, 0, 0, 1);
17
 		pdfapp_showpage(app, 0, 0, 1);
18
 		break;
18
 		break;
19
@@ -843,6 +847,7 @@ void pdfapp_onkey(pdfapp_t *app, int c)
19
@@ -842,6 +846,7 @@ void pdfapp_onkey(pdfapp_t *app, int c)
20
 	 */
20
 	 */
21
 
21
 
22
 	case ',':
22
 	case ',':
Lines 24-30 Link Here
24
 		panto = PAN_TO_BOTTOM;
24
 		panto = PAN_TO_BOTTOM;
25
 		if (app->numberlen > 0)
25
 		if (app->numberlen > 0)
26
 			app->pageno -= atoi(app->number);
26
 			app->pageno -= atoi(app->number);
27
@@ -851,6 +856,7 @@ void pdfapp_onkey(pdfapp_t *app, int c)
27
@@ -850,6 +855,7 @@ void pdfapp_onkey(pdfapp_t *app, int c)
28
 		break;
28
 		break;
29
 
29
 
30
 	case '.':
30
 	case '.':
Lines 32-42 Link Here
32
 		panto = PAN_TO_TOP;
32
 		panto = PAN_TO_TOP;
33
 		if (app->numberlen > 0)
33
 		if (app->numberlen > 0)
34
 			app->pageno += atoi(app->number);
34
 			app->pageno += atoi(app->number);
35
@@ -1022,6 +1028,11 @@ void pdfapp_onmouse(pdfapp_t *app, int x
35
@@ -1039,6 +1045,12 @@ void pdfapp_onmouse(pdfapp_t *app, int x
36
 				int isx = (modifiers & (1<<0));
36
 				int isx = (modifiers & (1<<0));
37
 				int xstep = isx ? 20 * dir : 0;
37
 				int xstep = isx ? 20 * dir : 0;
38
 				int ystep = !isx ? 20 * dir : 0;
38
 				int ystep = !isx ? 20 * dir : 0;
39
+				if (!isx && dir < 0 && app->pany + app->image->h <= app->winh)
39
+				if (!isx && dir < 0 && app->pany +
40
+				    fz_pixmap_height(app->ctx, app->image) <= app->winh)
40
+					pdfapp_onkey(app, 'j');
41
+					pdfapp_onkey(app, 'j');
41
+				else if (!isx && dir > 0 && app->pany >= 0)
42
+				else if (!isx && dir > 0 && app->pany >= 0)
42
+					pdfapp_onkey(app, 'k');
43
+					pdfapp_onkey(app, 'k');
(-)graphics/mupdf/pkg-plist (-8 / +7 lines)
Lines 1-13 Link Here
1
bin/mupdf
1
bin/mupdf
2
bin/mu_pdfclean
2
bin/mupdfclean
3
bin/mu_pdfdraw
3
bin/mudraw
4
bin/mu_pdfextract
4
bin/mupdfextract
5
bin/mu_pdfinfo
5
bin/mupdfinfo
6
bin/mu_pdfshow
6
bin/mupdfshow
7
bin/mu_xpsdraw
8
include/fitz.h
7
include/fitz.h
8
include/memento.h
9
include/mucbz.h
9
include/mupdf.h
10
include/mupdf.h
10
include/muxps.h
11
include/muxps.h
11
lib/libfitz.a
12
lib/libfitz.a
12
lib/libmupdf.a
13
lib/libmuxps.a

Return to bug 166745