Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Aug 2014 20:19:29 +0000 (UTC)
From:      Kurt Jaeger <pi@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r364050 - in head/graphics/mupdf: . files
Message-ID:  <53dfead1.5c5e.4fc33d5f@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pi
Date: Mon Aug  4 20:19:28 2014
New Revision: 364050
URL: http://svnweb.freebsd.org/changeset/ports/364050
QAT: https://qat.redports.org/buildarchive/r364050/

Log:
  graphics/mupdf: 1.2 -> 1.5
  
  - For changes since 1.2 see http://www.mupdf.com/news
  - new maintainer: Zsolt Udvari
  
  PR:		184335
  Submitted by:	Zsolt Udvari <udvzsolt@gmail.com>
  Approved by:	lichray@gmail.com (maintainer timeout)

Added:
  head/graphics/mupdf/files/patch-platform__x11__x11_main.c   (contents, props changed)
  head/graphics/mupdf/files/patch-source__fitz__load-jpx.c   (contents, props changed)
  head/graphics/mupdf/files/scroll_hack-platform__x11__pdfapp.c   (contents, props changed)
Deleted:
  head/graphics/mupdf/files/patch-apps_x11_main.c
  head/graphics/mupdf/files/scroll_hack-apps_pdfapp.c
Modified:
  head/graphics/mupdf/Makefile
  head/graphics/mupdf/distinfo
  head/graphics/mupdf/files/patch-Makefile
  head/graphics/mupdf/pkg-plist

Modified: head/graphics/mupdf/Makefile
==============================================================================
--- head/graphics/mupdf/Makefile	Mon Aug  4 20:17:05 2014	(r364049)
+++ head/graphics/mupdf/Makefile	Mon Aug  4 20:19:28 2014	(r364050)
@@ -2,15 +2,14 @@
 # $FreeBSD$
 
 PORTNAME=	mupdf
-PORTVERSION=	1.2
-PORTREVISION=	2
+PORTVERSION=	1.5
 PORTEPOCH=	1
 CATEGORIES=	graphics
 MASTER_SITES=	GOOGLE_CODE \
 		http://www.mupdf.com/download/
-EXTRACT_SUFX=	-source.zip
+EXTRACT_SUFX=	-source.tar.gz
 
-MAINTAINER=	lichray@gmail.com
+MAINTAINER=	udvzsolt@gmail.com
 COMMENT=	Lightweight PDF viewer and toolkit
 
 LICENSE=	AGPLv3
@@ -18,11 +17,13 @@ LICENSE=	AGPLv3
 LIB_DEPENDS=	libfreetype.so:${PORTSDIR}/print/freetype2 \
 		libjpeg.so:${PORTSDIR}/graphics/jpeg \
 		libjbig2dec.so:${PORTSDIR}/graphics/jbig2dec \
-		libopenjpeg.so:${PORTSDIR}/graphics/openjpeg15
+		libopenjp2.so:${PORTSDIR}/graphics/openjpeg
 
 MAKE_ARGS+=	build=release prefix=${PREFIX} verbose=1 mandir=${PREFIX}/man \
-		XCFLAGS=-I${LOCALBASE}/include
-USES=		pkgconfig gmake zip
+			HAVE_X11=yes \
+			XCFLAGS="`pkg-config --cflags freetype2` -I ${LOCALBASE}/include" \
+			XLIBS="`pkg-config --libs freetype2 libopenjp2 x11 xext` -ljpeg -ljbig2dec"
+USES=		pkgconfig gmake
 USE_XORG=	x11 xext
 
 WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}-source
@@ -42,7 +43,7 @@ CFLAGS+=	-mfpmath=sse
 .endif
 
 .if ${PORT_OPTIONS:MSCROLL}
-EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-apps_pdfapp.c
+EXTRA_PATCHES+=	${FILESDIR}/scroll_hack-platform__x11__pdfapp.c
 .endif
 
 .if ${PORT_OPTIONS:MJS}
@@ -50,17 +51,16 @@ LIB_DEPENDS+=	libv8.so:${PORTSDIR}/lang/
 MAKE_ARGS+=	V8_PRESENT=1 V8LIBS=-lv8
 .endif
 
-post-patch:	.SILENT
-	${REINPLACE_CMD} \
-		-e '/install:/,/^$$/ { /-d/d; }' \
-		-e '/install.*bindir)$$/s/install/$$(BSD_INSTALL_PROGRAM)/' \
-		-e '/install.*libdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
-		-e '/install.*incdir)$$/s/install/$$(BSD_INSTALL_DATA)/' \
-		-e '/install.*man1$$/s/install/$$(BSD_INSTALL_MAN)/' \
-		${WRKSRC}/Makefile
+post-patch:
 	${REINPLACE_CMD} -e 's/-pipe -O2 //' \
 		-e 's|/usr/local|${LOCALBASE}|' \
 		${WRKSRC}/Makerules
 	${RM} -r ${WRKSRC}/thirdparty/*
 
+post-install:
+	${MV} ${STAGEDIR}${PREFIX}/bin/mupdf-x11 ${STAGEDIR}${PREFIX}/bin/mupdf
+.for binary in mudraw mutool mujstest mupdf
+	${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/${binary}
+.endfor
+
 .include <bsd.port.mk>

Modified: head/graphics/mupdf/distinfo
==============================================================================
--- head/graphics/mupdf/distinfo	Mon Aug  4 20:17:05 2014	(r364049)
+++ head/graphics/mupdf/distinfo	Mon Aug  4 20:19:28 2014	(r364050)
@@ -1,2 +1,2 @@
-SHA256 (mupdf-1.2-source.zip) = 9bc9e31ec27c091dad37f70940bd799e46ab6da4299bc58e803bff3dbb07dc3b
-SIZE (mupdf-1.2-source.zip) = 13808821
+SHA256 (mupdf-1.5-source.tar.gz) = e41fa8951de3b44a5ec95052b8897fbcca1eb721e0fd0289862e31e2f03f846a
+SIZE (mupdf-1.5-source.tar.gz) = 13269193

Modified: head/graphics/mupdf/files/patch-Makefile
==============================================================================
--- head/graphics/mupdf/files/patch-Makefile	Mon Aug  4 20:17:05 2014	(r364049)
+++ head/graphics/mupdf/files/patch-Makefile	Mon Aug  4 20:19:28 2014	(r364050)
@@ -1,67 +1,16 @@
---- Makefile.orig	2013-02-13 09:25:07.000000000 -0500
-+++ Makefile	2013-05-06 13:00:30.619173583 -0400
-@@ -12,19 +12,13 @@ default: all
- # Do not specify CFLAGS or LIBS on the make invocation line - specify
- # XCFLAGS or XLIBS instead. Make ignores any lines in the makefile that
- # set a variable that was set on the command line.
--CFLAGS += $(XCFLAGS) -Ifitz -Ipdf -Ixps -Icbz -Iscripts
--LIBS += $(XLIBS) -lfreetype -ljbig2dec -ljpeg -lopenjpeg -lz -lm
-+CFLAGS += -Ifitz -Ipdf -Ixps -Icbz -Iscripts $(XCFLAGS)
-+LIBS += -lfreetype -ljbig2dec -ljpeg -lopenjpeg -lz -lm $(XLIBS)
- LIBS_V8 = $(LIBS) $(V8LIBS)
- 
+--- ./Makefile.orig	2014-06-10 17:09:28.000000000 +0200
++++ ./Makefile	2014-08-04 18:51:44.000000000 +0200
+@@ -18,13 +18,6 @@
  include Makerules
  include Makethird
  
--THIRD_LIBS := $(FREETYPE_LIB)
+-THIRD_LIBS += $(FREETYPE_LIB)
 -THIRD_LIBS += $(JBIG2DEC_LIB)
 -THIRD_LIBS += $(JPEG_LIB)
 -THIRD_LIBS += $(OPENJPEG_LIB)
+-THIRD_LIBS += $(OPENSSL_LIB)
 -THIRD_LIBS += $(ZLIB_LIB)
 -
- ifeq "$(verbose)" ""
- QUIET_AR = @ echo ' ' ' ' AR $@ ;
- QUIET_CC = @ echo ' ' ' ' CC $@ ;
-@@ -169,14 +163,15 @@ $(MUTOOL) : $(addprefix $(OUT)/, pdfclea
- 
- ifeq "$(NOX11)" ""
- MUVIEW := $(OUT)/mupdf
-+ifeq "$(V8_PRESENT)" "1"
-+$(MUVIEW) : $(FITZ_V8_LIB) $(THIRD_LIBS)
-+$(MUVIEW) : $(addprefix $(OUT)/, x11_main.o x11_image.o pdfapp.o)
-+	$(LINK_V8_CMD) $(X11_LIBS)
-+else
- $(MUVIEW) : $(FITZ_LIB) $(THIRD_LIBS)
- $(MUVIEW) : $(addprefix $(OUT)/, x11_main.o x11_image.o pdfapp.o)
- 	$(LINK_CMD) $(X11_LIBS)
--
--MUVIEW_V8 := $(OUT)/mupdf-v8
--$(MUVIEW_V8) : $(FITZ_V8_LIB) $(THIRD_LIBS)
--$(MUVIEW_V8) : $(addprefix $(OUT)/, x11_main.o x11_image.o pdfapp.o)
--	$(LINK_V8_CMD) $(X11_LIBS)
-+endif
- endif
- 
- MUJSTEST_V8 := $(OUT)/mujstest-v8
-@@ -184,12 +179,6 @@ $(MUJSTEST_V8) : $(FITZ_V8_LIB) $(THIRD_
- $(MUJSTEST_V8) : $(addprefix $(OUT)/, jstest_main.o pdfapp.o)
- 	$(LINK_V8_CMD)
- 
--ifeq "$(V8_PRESENT)" "1"
--JSTARGETS := $(MUJSTEST_V8) $(FITZ_V8_LIB) $(MUVIEW_V8)
--else
--JSTARGETS :=
--endif
--
- # --- Format man pages ---
- 
- %.txt: %.1
-@@ -212,7 +201,7 @@ install: $(FITZ_LIB) $(MUVIEW) $(MUDRAW)
- 	install -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(incdir) $(DESTDIR)$(mandir)/man1
- 	install $(FITZ_LIB) $(DESTDIR)$(libdir)
- 	install fitz/memento.h fitz/fitz.h pdf/mupdf.h xps/muxps.h cbz/mucbz.h $(DESTDIR)$(incdir)
--	install $(MUVIEW) $(MUDRAW) $(MUBUSY) $(DESTDIR)$(bindir)
-+	install $(MUVIEW) $(MUDRAW) $(MUTOOL) $(DESTDIR)$(bindir)
- 	install $(wildcard apps/man/*.1) $(DESTDIR)$(mandir)/man1
- 
- # --- Clean and Default ---
+ LIBS += $(FREETYPE_LIBS)
+ LIBS += $(JBIG2DEC_LIBS)
+ LIBS += $(JPEG_LIBS)

Added: head/graphics/mupdf/files/patch-platform__x11__x11_main.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mupdf/files/patch-platform__x11__x11_main.c	Mon Aug  4 20:19:28 2014	(r364050)
@@ -0,0 +1,27 @@
+--- ./platform/x11/x11_main.c.orig	2014-06-10 17:09:28.000000000 +0200
++++ ./platform/x11/x11_main.c	2014-08-04 18:51:44.000000000 +0200
+@@ -794,6 +794,24 @@
+ 	exit(1);
+ }
+ 
++/* reference:
++ * http://stackoverflow.com/questions/2621439/how-to-get-screen-dpi-linux-mac-programatically
++ */
++int get_dpi(void)
++{
++	Display *xdpy;
++	int xscr;
++	int x = 0;
++
++	if ((xdpy = XOpenDisplay(NULL))) {
++		xscr = DefaultScreen(xdpy);
++		x = (int) (DisplayWidth(xdpy, xscr) * 25.4 /
++				DisplayWidthMM(xdpy, xscr) + 0.5);
++		XCloseDisplay(xdpy);
++	}
++	return x;
++}
++
+ int main(int argc, char **argv)
+ {
+ 	int c;

Added: head/graphics/mupdf/files/patch-source__fitz__load-jpx.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mupdf/files/patch-source__fitz__load-jpx.c	Mon Aug  4 20:19:28 2014	(r364050)
@@ -0,0 +1,20 @@
+--- ./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 @@
+ #define OPJ_HAVE_STDINT_H
+ #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 @@
+ 	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);
+ 

Added: head/graphics/mupdf/files/scroll_hack-platform__x11__pdfapp.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/graphics/mupdf/files/scroll_hack-platform__x11__pdfapp.c	Mon Aug  4 20:19:28 2014	(r364050)
@@ -0,0 +1,49 @@
+--- ./platform/x11/pdfapp.c.orig	2014-08-04 19:59:53.000000000 +0200
++++ ./platform/x11/pdfapp.c	2014-08-04 20:03:46.000000000 +0200
+@@ -1166,6 +1166,8 @@
+ 	case 'j':
+ 		{
+ 			int h = fz_pixmap_height(app->ctx, app->image);
++                        if ( (app->pany + h) <= app->winh )
++                            goto pagedown;
+ 			if (h <= app->winh || app->pany <= app->winh - h)
+ 			{
+ 				panto = PAN_TO_TOP;
+@@ -1182,6 +1184,8 @@
+ 	case 'k':
+ 		{
+ 			int h = fz_pixmap_height(app->ctx, app->image);
++                        if (app->pany >= 0)
++                            goto pageup;
+ 			if (h <= app->winh || app->pany == 0)
+ 			{
+ 				panto = PAN_TO_BOTTOM;
+@@ -1257,6 +1261,7 @@
+ 	 */
+ 
+ 	case ',':
++        pageup:
+ 		panto = PAN_TO_BOTTOM;
+ 		if (app->numberlen > 0)
+ 			app->pageno -= atoi(app->number);
+@@ -1265,6 +1270,7 @@
+ 		break;
+ 
+ 	case '.':
++        pagedown:
+ 		panto = PAN_TO_TOP;
+ 		if (app->numberlen > 0)
+ 			app->pageno += atoi(app->number);
+@@ -1585,6 +1591,12 @@
+ 				int isx = (modifiers & (1<<0));
+ 				int xstep = isx ? 20 * dir : 0;
+ 				int ystep = !isx ? 20 * dir : 0;
++				if (!isx && dir < 0 && app->pany +
++				    fz_pixmap_height(app->ctx, app->image) <= app->winh)
++					pdfapp_onkey(app, 'j');
++				else if (!isx && dir > 0 && app->pany >= 0)
++					pdfapp_onkey(app, 'k');
++				else
+ 				pdfapp_panview(app, app->panx + xstep, app->pany + ystep);
+ 			}
+ 		}

Modified: head/graphics/mupdf/pkg-plist
==============================================================================
--- head/graphics/mupdf/pkg-plist	Mon Aug  4 20:17:05 2014	(r364049)
+++ head/graphics/mupdf/pkg-plist	Mon Aug  4 20:19:28 2014	(r364050)
@@ -1,12 +1,86 @@
-bin/mupdf
 bin/mudraw
+bin/mujstest
+bin/mupdf
 bin/mutool
-include/fitz.h
-include/memento.h
-include/mucbz.h
-include/mupdf.h
-include/muxps.h
-lib/libfitz.a
+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/glyph.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-tga.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/tree.h
+include/mupdf/fitz/version.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/tiff.h
+include/mupdf/xps.h
+lib/libmupdf.a
 man/man1/mudraw.1.gz
 man/man1/mupdf.1.gz
 man/man1/mutool.1.gz
+%%PORTDOCS%%%%DOCSDIR%%/CHANGES
+%%PORTDOCS%%%%DOCSDIR%%/COPYING
+%%PORTDOCS%%%%DOCSDIR%%/README
+%%PORTDOCS%%%%DOCSDIR%%/naming.txt
+%%PORTDOCS%%%%DOCSDIR%%/overview.txt
+%%PORTDOCS%%%%DOCSDIR%%/progressive.txt
+%%PORTDOCS%%%%DOCSDIR%%/refcount.txt
+%%PORTDOCS%%%%DOCSDIR%%/thirdparty.txt
+@dirrmtry include/mupdf/fitz
+@dirrmtry include/mupdf/pdf
+@dirrmtry include/mupdf
+%%PORTDOCS%%@dirrmtry %%DOCSDIR%%



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53dfead1.5c5e.4fc33d5f>