Update to MuPDF 1.3, and enable cURL support (separate binary, not subpackaged

here as cURL is a fairly common package).

Earlier version without cURL support ok rpe@, additional tests on various
arch from brett@, Florian Stinglmayr and Donovan Watteau (who also reminded
me about a change of name for mubusy needed in DESCR).
This commit is contained in:
sthen 2013-10-29 22:08:59 +00:00
parent 7473fe88f4
commit fff066bfb1
15 changed files with 165 additions and 197 deletions

View File

@ -1,12 +1,10 @@
# $OpenBSD: Makefile,v 1.42 2013/04/29 12:54:00 sthen Exp $
# $OpenBSD: Makefile,v 1.43 2013/10/29 22:08:59 sthen Exp $
COMMENT = graphic library, pdf parser, viewer and utilities
V = 1.2
V = 1.3
DISTNAME = mupdf-$V-source
EXTRACT_SUFX = .zip
PKGNAME = mupdf-${V:S/-rc/rc/}
REVISION = 2
CATEGORIES = textproc x11
@ -19,16 +17,17 @@ MAINTAINER = Stuart Henderson <sthen@openbsd.org>
# droid font: Apache.
PERMIT_PACKAGE_CDROM = Yes
WANTLIB = X11 Xext c freetype jbig2dec jpeg>=62 m openjpeg z
WANTLIB += X11 Xext c crypto curl freetype idn jbig2dec jpeg m
WANTLIB += openjp2 pthread ssl z
# http://git.ghostscript.com/?p=mupdf.git;a=summary
MASTER_SITES = ${HOMEPAGE}download/ \
${HOMEPAGE}download/archive/
MASTER_SITES = http://mupdf.googlecode.com/files/
RUN_DEPENDS = devel/desktop-file-utils
LIB_DEPENDS = graphics/jbig2dec \
graphics/jpeg \
graphics/openjpeg>=1.5.0
graphics/openjp2 \
net/curl
USE_GMAKE = Yes
NO_TEST = Yes
@ -38,25 +37,32 @@ CFLAGS += -ffunction-sections
.endif
# -I flags prepend mupdf's own, to allow building with previous ver installed
MAKE_ENV += CFLAGS="${CFLAGS} -I$(WRKSRC)/fitz -I$(WRKSRC)/pdf -I$(WRKSRC)/xps" \
LDFLAGS="${LDFLAGS}" CC=${CC} CXX=${CXX} build= verbose=1
MAKE_ENV += CFLAGS="${CFLAGS} -I$(WRKSRC)/fitz -I$(WRKSRC)/pdf -I$(WRKSRC)/xps"
FAKE_FLAGS = prefix=${PREFIX} mandir=${PREFIX}/man
MAKE_FLAGS = NOCURL= \
CC="${CC}" CXX="${CXX}" \
CURL_LIB="-lcurl" \
CURL_LIBS="-lpthread -lidn -lssl -lcurl" \
SYS_OPENSSL_LIBS="-lssl -lcrypto" \
LDFLAGS="${LDFLAGS}" \
build= verbose=1
FAKE_FLAGS = NOCURL= prefix=${PREFIX} mandir=${PREFIX}/man
pre-configure:
${SUBST_CMD} ${WRKSRC}/debian/mupdf.pc
cd ${WRKSRC}/; ${SUBST_CMD} Makerules platform/debian/mupdf.pc
rm -rf ${WRKSRC}/thirdparty
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/share/applications/ \
${PREFIX}/share/application-registry/ ${PREFIX}/share/pixmaps \
${PREFIX}/lib/pkgconfig/
${INSTALL_DATA} ${WRKSRC}/debian/mupdf.xpm ${PREFIX}/share/pixmaps/
${INSTALL_DATA} ${WRKSRC}/debian/mupdf.applications \
${PREFIX}/share/application-registry/
${INSTALL_DATA} ${WRKSRC}/debian/mupdf.desktop \
${PREFIX}/share/applications/
${INSTALL_DATA} ${WRKSRC}/debian/mupdf.pc \
${PREFIX}/lib/pkgconfig/mupdf.pc
.for a b in mupdf.xpm share/pixmaps \
mupdf.applications share/application-registry \
mupdf.desktop share/applications \
mupdf.pc lib/pkgconfig
${INSTALL_DATA} ${WRKSRC}/platform/debian/$a ${PREFIX}/$b
.endfor
cd ${PREFIX}/bin; ln -s mupdf-x11 mupdf
.include <bsd.port.mk>

View File

@ -1,2 +1,2 @@
SHA256 (mupdf-1.2-source.zip) = m8njHsJ8CR2tN/cJQL15nkarbaQpm8WOgDv/PbsH3Ds=
SIZE (mupdf-1.2-source.zip) = 13808821
SHA256 (mupdf-1.3-source.tar.gz) = q6izG+6cwKFqvtq14xyBxlmWy6VZHmKlCnm+oqY9RHg=
SIZE (mupdf-1.3-source.tar.gz) = 14594969

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-Makefile,v 1.6 2013/04/07 11:32:22 sthen Exp $
From 092461c105210cfc652984cd96e6c88aec545461 Mon Sep 17 00:00:00 2001
From: Robin Watts <robin.watts@artifex.com>
Date: Thu, 28 Feb 2013 10:57:24 +0000
Subject: [PATCH] Bug 693595: Fix typo in Makefile resulting in mutool not
being installed.
--- Makefile.orig Sun Apr 7 10:27:52 2013
+++ Makefile Sun Apr 7 10:28:15 2013
@@ -212,7 +212,7 @@ install: $(FITZ_LIB) $(MUVIEW) $(MUDRAW) $(MUTOOL)
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 ---

View File

@ -1,7 +1,7 @@
$OpenBSD: patch-Makerules,v 1.7 2013/03/21 01:26:03 sthen Exp $
--- Makerules.orig Wed Feb 13 14:25:07 2013
+++ Makerules Thu Mar 21 01:01:34 2013
@@ -5,6 +5,7 @@ OS := $(OS:MINGW%=MINGW)
$OpenBSD: patch-Makerules,v 1.8 2013/10/29 22:08:59 sthen Exp $
--- Makerules.orig Wed Aug 14 13:41:20 2013
+++ Makerules Tue Oct 29 21:29:54 2013
@@ -6,6 +6,7 @@ OS := $(OS:Windows_NT=MINGW)
CFLAGS += -Wall
@ -9,25 +9,30 @@ $OpenBSD: patch-Makerules,v 1.7 2013/03/21 01:26:03 sthen Exp $
ifeq "$(build)" "debug"
CFLAGS += -pipe -g -DDEBUG
else ifeq "$(build)" "profile"
@@ -22,6 +23,7 @@ CFLAGS += -pipe -g -DMEMENTO -DDEBUG
@@ -23,6 +24,7 @@ CFLAGS += -pipe -g -DMEMENTO -DDEBUG
else
$(error unknown build setting: '$(build)')
endif
+endif
ifeq "$(OS)" "Linux"
SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
@@ -39,6 +41,13 @@ ifeq "$(OS)" "SunOS"
SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
LDFLAGS += -L/usr/local/lib
X11_LIBS := -lX11 -lXext
+endif
+
+ifeq "$(OS)" "OpenBSD"
+SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
+CFLAGS += -I${LOCALBASE}/include
+LDFLAGS += `pkg-config --libs freetype2` -L${LOCALBASE}/lib
+X11_LIBS = -lX11 -lXext
# Windows (MINGW) build doesn't use system libraries.
ifeq "$(OS)" "MINGW"
@@ -55,15 +57,15 @@ SYS_OPENSSL_CFLAGS = -DHAVE_OPENSSL $(shell pkg-config
SYS_OPENSSL_LIBS = $(shell pkg-config --libs libcrypto)
endif
# Mac OS X build depends on some thirdparty libs
-SYS_CURL_DEPS = -lpthread -lrt
+SYS_CURL_DEPS = $(shell pkg-config --libs libcurl)
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_LIBS = $(shell pkg-config --libs freetype2)
-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjpeg1)
-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjpeg1)
+SYS_OPENJPEG_CFLAGS = -I${LOCALBASE}/include/openjp2 -I${LOCALBASE}/include
+SYS_OPENJPEG_LIBS = -L${LOCALBASE}/lib -lopenjp2
SYS_JBIG2DEC_LIBS = -ljbig2dec
SYS_JPEG_LIBS = -ljpeg
SYS_ZLIB_LIBS = -lz

View File

@ -1,12 +0,0 @@
$OpenBSD: patch-apps_man_mudraw_1,v 1.2 2013/03/21 01:26:03 sthen Exp $
--- apps/man/mudraw.1.orig Wed Feb 13 14:25:07 2013
+++ apps/man/mudraw.1 Thu Mar 21 01:19:12 2013
@@ -83,7 +83,6 @@ Invert the output image colors.
Comma separated list of ranges to render.
.SH SEE ALSO
.BR mupdf (1),
-.BR mupdfclean (1).
-.BR mupdfshow (1).
+.BR mutool (1).
.SH AUTHOR
MuPDF is Copyright 2006-2012 Artifex Software, Inc.

View File

@ -1,14 +0,0 @@
$OpenBSD: patch-apps_man_mupdf_1,v 1.2 2013/03/21 01:26:03 sthen Exp $
--- apps/man/mupdf.1.orig Wed Feb 13 14:25:07 2013
+++ apps/man/mupdf.1 Thu Mar 21 01:19:25 2013
@@ -85,8 +85,7 @@ Toggle between normal and inverted color rendering.
Sending a \fBSIGHUP\fR signal to the mupdf process will also cause the viewed
file to be reloaded automatically, for use in e.g. build scripts.
.SH SEE ALSO
-.BR mupdfclean (1),
-.BR mupdfdraw (1),
-.BR mupdfshow (1).
+.BR mutool (1),
+.BR mudraw (1).
.SH AUTHOR
MuPDF is Copyright 2006-2012 Artifex Software, Inc.

View File

@ -1,27 +0,0 @@
$OpenBSD: patch-apps_pdfapp_c,v 1.1 2013/04/29 12:54:00 sthen Exp $
From a20d6a58ebc6c60ff44f0f385cf399ee6fca55bf Mon Sep 17 00:00:00 2001
From: Robin Watts <Robin.Watts@artifex.com>
Date: Fri, 26 Apr 2013 12:21:17 +0100
Subject: [PATCH] Fix dirty flag handling bug in X11 event loop.
--- apps/pdfapp.c.orig Mon Apr 29 13:47:16 2013
+++ apps/pdfapp.c Mon Apr 29 13:47:53 2013
@@ -1688,7 +1688,6 @@ void pdfapp_postblit(pdfapp_t *app)
if (llama >= 256)
{
/* Completed. */
- app->in_transit = 0;
fz_drop_pixmap(app->ctx, app->image);
app->image = app->new_image;
app->new_image = NULL;
@@ -1700,4 +1699,9 @@ void pdfapp_postblit(pdfapp_t *app)
else
fz_generate_transition(app->image, app->old_image, app->new_image, llama, &app->transition);
winrepaint(app);
+ if (llama >= 256)
+ {
+ /* Completed. */
+ app->in_transit = 0;
+ }
}

View File

@ -1,52 +0,0 @@
$OpenBSD: patch-apps_x11_main_c,v 1.4 2013/04/29 12:54:00 sthen Exp $
From a20d6a58ebc6c60ff44f0f385cf399ee6fca55bf Mon Sep 17 00:00:00 2001
From: Robin Watts <Robin.Watts@artifex.com>
Date: Fri, 26 Apr 2013 12:21:17 +0100
Subject: [PATCH] Fix dirty flag handling bug in X11 event loop.
--- apps/x11_main.c.orig Mon Apr 29 13:48:12 2013
+++ apps/x11_main.c Mon Apr 29 13:49:12 2013
@@ -79,6 +79,7 @@ static int mapped = 0;
static Cursor xcarrow, xchand, xcwait, xccaret;
static int justcopied = 0;
static int dirty = 0;
+static int transition_dirty = 0;
static int dirtysearch = 0;
static char *password = "";
static XColor xbgcolor;
@@ -504,6 +505,8 @@ static void winblit(pdfapp_t *app)
void winrepaint(pdfapp_t *app)
{
dirty = 1;
+ if (app->in_transit)
+ transition_dirty = 1;
}
void winrepaintsearch(pdfapp_t *app)
@@ -779,7 +782,7 @@ int main(int argc, char **argv)
while (!closing)
{
- while (!closing && XPending(xdpy) && !dirty)
+ while (!closing && XPending(xdpy) && !transition_dirty)
{
XNextEvent(xdpy, &xevt);
@@ -886,6 +889,7 @@ int main(int argc, char **argv)
else if (dirtysearch)
winblitsearch(&gapp);
dirty = 0;
+ transition_dirty = 0;
dirtysearch = 0;
pdfapp_postblit(&gapp);
}
@@ -899,7 +903,7 @@ int main(int argc, char **argv)
timeradd(&now, &tmo, &tmo_at);
}
- if (XPending(xdpy) || dirty)
+ if (XPending(xdpy) || transition_dirty)
continue;
timeout = NULL;

View File

@ -1,11 +0,0 @@
$OpenBSD: patch-debian_mupdf_desktop,v 1.3 2011/03/22 23:40:46 sthen Exp $
--- debian/mupdf.desktop.orig Wed Mar 16 11:57:25 2011
+++ debian/mupdf.desktop Tue Mar 22 22:57:46 2011
@@ -10,6 +10,7 @@ Terminal=false
Type=Application
MimeType=application/pdf;application/x-pdf;
Categories=Viewer;Graphics;
+NoDisplay=true
[Desktop Action View]
Exec=mupdf %f

View File

@ -1,9 +0,0 @@
$OpenBSD: patch-debian_mupdf_pc,v 1.1 2010/06/03 19:38:34 sthen Exp $
--- debian/mupdf.pc.orig Thu Jun 3 06:56:21 2010
+++ debian/mupdf.pc Thu Jun 3 06:56:30 2010
@@ -1,4 +1,4 @@
-prefix=/usr
+prefix=${PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-platform_debian_mupdf_desktop,v 1.1 2013/10/29 22:08:59 sthen Exp $
--- platform/debian/mupdf.desktop.orig Wed Aug 14 13:41:20 2013
+++ platform/debian/mupdf.desktop Tue Oct 29 21:44:54 2013
@@ -1,14 +1,15 @@
[Desktop Entry]
Name=MuPDF
GenericName=PDF file viewer
-Exec=mupdf-select-file %f
-TryExec=mupdf-select-file
+Exec=mupdf %f
+TryExec=mupdf
Icon=mupdf
Terminal=false
Type=Application
MimeType=application/pdf;application/x-pdf;application/x-cbz;application/oxps;application/vnd.ms-xpsdocument;image/jpeg;image/pjpeg;image/png;image/tiff;image/x-tiff
Categories=Viewer;Graphics;
Actions=View
+NoDisplay=true
[Desktop Action View]
Name=View with mupdf

View File

@ -0,0 +1,9 @@
$OpenBSD: patch-platform_debian_mupdf_pc,v 1.1 2013/10/29 22:08:59 sthen Exp $
--- platform/debian/mupdf.pc.orig Wed Aug 14 13:41:20 2013
+++ platform/debian/mupdf.pc Tue Oct 29 21:28:07 2013
@@ -1,4 +1,4 @@
-prefix=/usr
+prefix=${PREFIX}
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

View File

@ -1,12 +1,12 @@
$OpenBSD: patch-scripts_fontdump_c,v 1.2 2012/04/25 13:55:12 sthen Exp $
--- scripts/fontdump.c.orig Thu Mar 29 11:46:53 2012
+++ scripts/fontdump.c Thu Apr 12 14:31:51 2012
$OpenBSD: patch-scripts_fontdump_c,v 1.3 2013/10/29 22:08:59 sthen Exp $
--- scripts/fontdump.c.orig Thu Aug 15 14:26:18 2013
+++ scripts/fontdump.c Thu Aug 15 14:25:32 2013
@@ -49,7 +49,7 @@ main(int argc, char **argv)
}
fprintf(fo, "#ifndef __STRICT_ANSI__\n");
- fprintf(fo, "#if defined(__linux__) || defined(__FreeBSD__)\n");
+ fprintf(fo, "#if defined(__linux__) || defined(__FreeBSD__) || defined(__OpenBSD__)\n");
fprintf(fo, "#ifndef __clang__\n");
fprintf(fo, "#define HAVE_INCBIN\n");
fprintf(fo, "#endif\n");
fprintf(fo, "#endif\n");

View File

@ -13,7 +13,7 @@ We don't support interactive features such as form filling, javascript
and transitions. MuPDF is written modularly, so such features can be
added on by integrators if they so desire.
The mubusy command line tool supports multiple arguments, including
The mutool command line tool supports multiple arguments, including
"show" to print and examine objects in a PDF file, "clean" to decompress
and pretty-print the streams and objects in PDF files and also to
extract individual pages, "info" to display information about objects,

View File

@ -1,13 +1,75 @@
@comment $OpenBSD: PLIST,v 1.9 2013/04/07 09:54:31 espie Exp $
@comment $OpenBSD: PLIST,v 1.10 2013/10/29 22:08:59 sthen Exp $
@bin bin/mudraw
@bin bin/mupdf
bin/mupdf
@bin bin/mupdf-x11
@bin bin/mupdf-x11-curl
@bin bin/mutool
include/fitz.h
include/memento.h
include/mucbz.h
include/mupdf.h
include/muxps.h
lib/libfitz.a
include/mupdf/
include/mupdf/cbz.h
include/mupdf/fitz/
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/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.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/write-document.h
include/mupdf/fitz/xml.h
include/mupdf/img.h
include/mupdf/memento.h
include/mupdf/pdf/
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/xps.h
lib/libmupdf-js-none.a
lib/libmupdf.a
lib/pkgconfig/
lib/pkgconfig/mupdf.pc
@man man/man1/mudraw.1
@ -16,6 +78,15 @@ lib/pkgconfig/mupdf.pc
share/application-registry/
share/application-registry/mupdf.applications
share/applications/mupdf.desktop
share/doc/mupdf/
share/doc/mupdf/CHANGES
share/doc/mupdf/COPYING
share/doc/mupdf/README
share/doc/mupdf/naming.txt
share/doc/mupdf/overview.txt
share/doc/mupdf/progressive.txt
share/doc/mupdf/refcount.txt
share/doc/mupdf/thirdparty.txt
share/pixmaps/
share/pixmaps/mupdf.xpm
@exec %D/bin/update-desktop-database