diff --git a/textproc/mupdf/Makefile b/textproc/mupdf/Makefile index b0ce9a2b901..509acc93d05 100644 --- a/textproc/mupdf/Makefile +++ b/textproc/mupdf/Makefile @@ -1,14 +1,13 @@ -# $OpenBSD: Makefile,v 1.58 2015/10/30 12:59:17 sthen Exp $ +# $OpenBSD: Makefile,v 1.59 2015/11/12 17:26:54 sthen Exp $ SHARED_ONLY = Yes SHARED_LIBS += mupdf 3.0 COMMENT = graphic library, pdf parser, viewer and utilities -V = 1.7a +V = 1.8 DISTNAME = mupdf-$V-source PKGNAME = mupdf-$V -REVISION = 1 CATEGORIES = textproc x11 @@ -21,8 +20,11 @@ MAINTAINER = Stuart Henderson # droid font: Apache. PERMIT_PACKAGE_CDROM = Yes -WANTLIB += X11 Xext c crypto curl freetype idn jbig2dec jpeg m -WANTLIB += nghttp2 openjp2 pthread ssl z +FLAVORS= js +FLAVOR?= + +WANTLIB += GL X11 Xcursor Xext Xinerama Xrandr c crypto curl freetype +WANTLIB += idn jbig2dec jpeg m nghttp2 openjp2 pthread ssl z # http://git.ghostscript.com/?p=mupdf.git;a=summary MASTER_SITES = http://mupdf.com/downloads/ \ @@ -59,8 +61,12 @@ MAKE_FLAGS = CC="${CC}" CXX="${CXX}" \ FAKE_FLAGS = NOCURL= prefix=${PREFIX} mandir=${PREFIX}/man pre-configure: - cd ${WRKSRC}/; ${SUBST_CMD} Makerules - rm -rf ${WRKSRC}/thirdparty + cd ${WRKSRC}/; ${SUBST_CMD} Makerules Makethird + rm -rf ${WRKSRC}/thirdparty/{curl,freetype,jbig2dec,jpeg,openjpeg,zlib} # use from ports + #rm -rf ${WRKSRC}/thirdparty/glfw # not yet in ports, doesn't build here +.if !${FLAVOR:Mjs} + rm -rf ${WRKSRC}/thirdparty/mujs # not building with javascript support +.endif post-install: ${INSTALL_DATA_DIR} ${PREFIX}/share/{applications,pixmaps} diff --git a/textproc/mupdf/distinfo b/textproc/mupdf/distinfo index 6c1fc3e4429..cd2dea39e06 100644 --- a/textproc/mupdf/distinfo +++ b/textproc/mupdf/distinfo @@ -1,2 +1,2 @@ -SHA256 (mupdf-1.7a-source.tar.gz) = jANf+gEfxE+KSI9w2j5uUYiVCLv2b+a5CmPgz6bBfRw= -SIZE (mupdf-1.7a-source.tar.gz) = 13310720 +SHA256 (mupdf-1.8-source.tar.gz) = oqPGTYskkg+Hz06pM5olq/c4hJZEDxOzdILRQDwzwgY= +SIZE (mupdf-1.8-source.tar.gz) = 14169777 diff --git a/textproc/mupdf/patches/patch-Makefile b/textproc/mupdf/patches/patch-Makefile index d87ee4ec557..4a2c507829a 100644 --- a/textproc/mupdf/patches/patch-Makefile +++ b/textproc/mupdf/patches/patch-Makefile @@ -1,15 +1,24 @@ -$OpenBSD: patch-Makefile,v 1.9 2015/04/25 23:04:54 sthen Exp $ ---- Makefile.orig Thu Apr 16 09:57:45 2015 -+++ Makefile Sat Apr 25 23:26:07 2015 -@@ -123,9 +123,10 @@ $(HTML_OBJ) : $(FITZ_HDR) $(HTML_HDR) $(HTML_SRC_HDR) +$OpenBSD: patch-Makefile,v 1.10 2015/11/12 17:26:54 sthen Exp $ +--- Makefile.orig Tue Nov 10 16:19:51 2015 ++++ Makefile Thu Nov 12 17:16:53 2015 +@@ -129,9 +129,10 @@ $(GPRF_OBJ) : $(FITZ_HDR) $(GPRF_HDR) $(GPRF_SRC_HDR) # --- Library --- -MUPDF_LIB := $(OUT)/libmupdf.a +MUPDF_LIB := libmupdf.so.${LIBmupdf_VERSION} - $(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(HTML_OBJ) + $(MUPDF_LIB) : $(FITZ_OBJ) $(PDF_OBJ) $(XPS_OBJ) $(CBZ_OBJ) $(HTML_OBJ) $(GPRF_OBJ) + $(CC) $(LDFLAGS) --shared -o $@ $^ $(LIBS) INSTALL_LIBS := $(MUPDF_LIB) +@@ -167,7 +168,7 @@ $(OUT)/platform/x11/curl/%.o : platform/x11/%.c | $(AL + $(CC_CMD) $(X11_CFLAGS) $(CURL_CFLAGS) -DHAVE_CURL + + $(OUT)/platform/gl/%.o : platform/gl/%.c | $(ALL_DIR) +- $(CC_CMD) $(GLFW_CFLAGS) ++ $(CC_CMD) -I${X11BASE}/include $(GLFW_CFLAGS) + + .PRECIOUS : $(OUT)/%.o # Keep intermediates from chained rules + diff --git a/textproc/mupdf/patches/patch-Makerules b/textproc/mupdf/patches/patch-Makerules index 35a378a5ef3..5f9443c36ba 100644 --- a/textproc/mupdf/patches/patch-Makerules +++ b/textproc/mupdf/patches/patch-Makerules @@ -1,6 +1,6 @@ -$OpenBSD: patch-Makerules,v 1.13 2015/04/25 23:04:54 sthen Exp $ ---- Makerules.orig Thu Apr 16 09:57:45 2015 -+++ Makerules Sat Apr 25 23:31:58 2015 +$OpenBSD: patch-Makerules,v 1.14 2015/11/12 17:26:54 sthen Exp $ +--- Makerules.orig Tue Nov 10 16:19:51 2015 ++++ Makerules Thu Nov 12 17:18:22 2015 @@ -7,6 +7,7 @@ OS := $(OS:Darwin=MACOS) CFLAGS += -Wall @@ -15,9 +15,9 @@ $OpenBSD: patch-Makerules,v 1.13 2015/04/25 23:04:54 sthen Exp $ endif +endif - # Windows (MINGW) build doesn't use system libraries. - ifeq "$(OS)" "MINGW" -@@ -54,7 +56,7 @@ LD = xcrun ld + ifeq "$(largefile)" "yes" + CFLAGS += -DFZ_LARGEFILE +@@ -67,7 +69,7 @@ LD = xcrun ld RANLIB_CMD = xcrun ranlib $@ # Linux uses pkg-config for system libraries. @@ -25,8 +25,8 @@ $OpenBSD: patch-Makerules,v 1.13 2015/04/25 23:04:54 sthen Exp $ +else HAVE_X11 ?= yes - -@@ -68,12 +70,12 @@ HAVE_CURL = yes + HAVE_GLUT ?= yes +@@ -82,7 +84,7 @@ HAVE_CURL = yes SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl) SYS_CURL_LIBS = $(shell pkg-config --libs libcurl) endif @@ -35,9 +35,11 @@ $OpenBSD: patch-Makerules,v 1.13 2015/04/25 23:04:54 sthen Exp $ SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext) SYS_X11_LIBS = $(shell pkg-config --libs x11 xext) - --SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) -+SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) -I/usr/local/include - SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2) +@@ -95,6 +97,7 @@ SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjp2) SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjp2) + SYS_JBIG2DEC_LIBS = -ljbig2dec ++SYS_JPEG_CFLAGS = -I${LOCALBASE}/include + SYS_JPEG_LIBS = -ljpeg + SYS_ZLIB_LIBS = -lz + diff --git a/textproc/mupdf/patches/patch-Makethird b/textproc/mupdf/patches/patch-Makethird new file mode 100644 index 00000000000..9ba8890c976 --- /dev/null +++ b/textproc/mupdf/patches/patch-Makethird @@ -0,0 +1,15 @@ +$OpenBSD: patch-Makethird,v 1.1 2015/11/12 17:26:54 sthen Exp $ +--- Makethird.orig Tue Nov 10 16:19:51 2015 ++++ Makethird Thu Nov 12 17:22:39 2015 +@@ -503,9 +503,9 @@ $(GLFW_LIB): $(addprefix $(GLFW_OUT)/, $(GLFW_SRC:%.c= + $(GLFW_OUT): + $(MKDIR_CMD) + $(GLFW_OUT)/%.o: $(GLFW_DIR)/src/%.c | $(GLFW_OUT) +- $(CC_CMD) -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLFW_HAS_GLXGETPROCADDRESS ++ $(CC_CMD) -I${X11BASE}/include -D_GLFW_X11 -D_GLFW_GLX -D_GLFW_USE_OPENGL -D_GLFW_HAS_GLXGETPROCADDRESS + +-GLFW_CFLAGS := -I$(GLFW_DIR)/include ++GLFW_CFLAGS := -I${X11BASE}/include -I$(GLFW_DIR)/include + GLFW_LIBS := -lGL -lX11 -lXcursor -lXrandr -lXinerama -lpthread + + HAVE_GLFW := yes diff --git a/textproc/mupdf/patches/patch-platform_x11_pdfapp_c b/textproc/mupdf/patches/patch-platform_x11_pdfapp_c index 0975c4db14d..c24e0a9b8d5 100644 --- a/textproc/mupdf/patches/patch-platform_x11_pdfapp_c +++ b/textproc/mupdf/patches/patch-platform_x11_pdfapp_c @@ -1,7 +1,7 @@ -$OpenBSD: patch-platform_x11_pdfapp_c,v 1.2 2015/04/25 23:04:54 sthen Exp $ ---- platform/x11/pdfapp.c.orig Thu Apr 16 09:57:45 2015 -+++ platform/x11/pdfapp.c Sat Apr 25 23:35:23 2015 -@@ -28,8 +28,18 @@ enum +$OpenBSD: patch-platform_x11_pdfapp_c,v 1.3 2015/11/12 17:26:54 sthen Exp $ +--- platform/x11/pdfapp.c.orig Tue Nov 10 16:19:51 2015 ++++ platform/x11/pdfapp.c Thu Nov 12 16:42:07 2015 +@@ -26,8 +26,18 @@ enum static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int repaint, int transition, int searching); static void pdfapp_updatepage(pdfapp_t *app); @@ -21,7 +21,7 @@ $OpenBSD: patch-platform_x11_pdfapp_c,v 1.2 2015/04/25 23:04:54 sthen Exp $ static int zoom_in(int oldres) { int i; -@@ -1502,9 +1512,9 @@ static void handlescroll(pdfapp_t *app, int modifiers, +@@ -1538,9 +1548,9 @@ static void handlescroll(pdfapp_t *app, int modifiers, { /* zoom in/out if ctrl is pressed */ if (dir < 0) diff --git a/textproc/mupdf/pkg/DESCR b/textproc/mupdf/pkg/DESCR index 0f83d557b54..4d35b95e7db 100644 --- a/textproc/mupdf/pkg/DESCR +++ b/textproc/mupdf/pkg/DESCR @@ -22,3 +22,6 @@ page into many tiles. The mudraw command line tool renders pages and outputs PGM/PPM/PAM/PNG image files. + +Flavors: + js - build with JavaScript support (using the MuJS interpreter) diff --git a/textproc/mupdf/pkg/PLIST b/textproc/mupdf/pkg/PLIST index 13b98d59142..2fb7188be8a 100644 --- a/textproc/mupdf/pkg/PLIST +++ b/textproc/mupdf/pkg/PLIST @@ -1,7 +1,7 @@ -@comment $OpenBSD: PLIST,v 1.15 2015/04/25 23:04:54 sthen Exp $ -@bin bin/mudraw +@comment $OpenBSD: PLIST,v 1.16 2015/11/12 17:26:54 sthen Exp $ @bin bin/mujstest bin/mupdf +@bin bin/mupdf-gl @bin bin/mupdf-x11 @bin bin/mupdf-x11-curl @bin bin/mutool @@ -38,6 +38,7 @@ include/mupdf/fitz/output-tga.h include/mupdf/fitz/output.h include/mupdf/fitz/path.h include/mupdf/fitz/pixmap.h +include/mupdf/fitz/separation.h include/mupdf/fitz/shade.h include/mupdf/fitz/store.h include/mupdf/fitz/stream.h @@ -47,7 +48,9 @@ include/mupdf/fitz/system.h include/mupdf/fitz/text.h include/mupdf/fitz/transition.h include/mupdf/fitz/tree.h +include/mupdf/fitz/ucdn.h include/mupdf/fitz/unzip.h +include/mupdf/fitz/util.h include/mupdf/fitz/version.h include/mupdf/fitz/write-document.h include/mupdf/fitz/xml.h @@ -77,7 +80,6 @@ include/mupdf/pdf/widget.h include/mupdf/pdf/xref.h include/mupdf/xps.h @lib lib/libmupdf.so.${LIBmupdf_VERSION} -@man man/man1/mudraw.1 @man man/man1/mupdf.1 @man man/man1/mutool.1 share/applications/mupdf.desktop