- update MuPDF to 0.6. (various improvements including copying text

from PDFs with the ight mouse button. no search yet though).
note that the command-line options have changed slightly and there
are new keybindings - see mupdf(1).

- only pdfinfo conflicts with other packages, so switch to the
standard names for the other tools

- install the new manpages from upstream (replacing our mupdf manpage),
library, headers, .pc and desktop integration files

thanks ajacoutot@ for checking and improvements for the desktop
integration files, and Roberto Fernandez for looking over the
fontres parts.
This commit is contained in:
sthen 2010-06-03 19:38:34 +00:00
parent 234aae7770
commit 434c46e65c
12 changed files with 213 additions and 238 deletions

View File

@ -1,8 +1,10 @@
# $OpenBSD: Makefile,v 1.15 2010/03/31 13:06:47 sthen Exp $
# $OpenBSD: Makefile,v 1.16 2010/06/03 19:38:34 sthen Exp $
COMMENT = graphic library, pdf parser, viewer and utilities
DISTNAME = mupdf-0.5
DISTNAME = mupdf-0.6-source
PKGNAME = ${DISTNAME:S/-source//}
WRKDIST = ${WRKDIR}/mupdf
CATEGORIES = textproc x11
@ -16,55 +18,50 @@ PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = X11 Xext c freetype m pthread z
WANTLIB = X11 Xext c freetype m z
MASTER_SITES = ${HOMEPAGE}download/
BUILD_DEPENDS = ::devel/jam
MASTER_SITES = ${HOMEPAGE}download/source/
RUN_DEPENDS = ::devel/desktop-file-utils
LIB_DEPENDS = jbig2dec::graphics/jbig2dec \
jpeg.>=62::graphics/jpeg \
openjpeg::graphics/openjpeg
USE_X11 = Yes
USE_X11 = Yes
USE_GMAKE = Yes
NO_REGRESS = Yes
NO_REGRESS = Yes
JAMDEBUG = -d x # display command-lines
JAMDEBUG += -q # die quickly on build failure
MAKE_ENV += CC=${CC} CXX=${CXX}
MAKE_ENV += CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=${CC} \
CXX=${CXX} build=
JAMFLAGS = \
-sALL_LOCATE_TARGET=${WRKBUILD} \
-sBUILD= \
-sHAVE_OPENJPEG=yes \
-sHAVE_JBIG2DEC=yes \
-sOPTIM="${CFLAGS}" \
-sOS=LINUX \
-sCXXFLAGS="${CXXFLAGS} `freetype-config --cflags` -I${LOCALBASE}/include -I${X11BASE}/include" \
-sLDFLAGS="${LDFLAGS} `freetype-config --libs` -L${LOCALBASE}/lib"
FLAVORS += no_cjk
FLAVOR ?=
.if ${FLAVOR:L:Mno_cjk}
JAMFLAGS += -sDEFINES=NOCJK
.endif
SEPARATE_BUILD = concurrent
CFLAGS += -I${LOCALBASE}/include
LDFLAGS += -L${LOCALBASE}/lib
FAKE_FLAGS = prefix=${WRKINST}${PREFIX}
# the normal build embeds fonts into c files which take gobs of ram to
# compile (too much for some arch, even with -O0). fontres pulls them in
# via the assember instead.
pre-configure:
cp ${FILESDIR}/fontres.c ${WRKSRC}/
${SUBST_CMD} ${WRKSRC}/Jamrules
cp ${FILESDIR}/fontres.c ${WRKSRC}/mupdf/
${SUBST_CMD} ${WRKSRC}/debian/mupdf.pc
do-build:
cd ${WRKSRC} && ${SETENV} ${MAKE_ENV} jam ${JAMDEBUG} ${JAMFLAGS}
do-install:
${INSTALL_MAN} ${FILESDIR}/mupdf.1 ${PREFIX}/man/man1
${INSTALL_PROGRAM} ${WRKBUILD}/mupdf ${PREFIX}/bin
.for x in pdfclean pdfdraw pdfextract pdfinfo pdfshow
${INSTALL_PROGRAM} ${WRKBUILD}/$x ${PREFIX}/bin/mu_$x
post-install:
${INSTALL_MAN} ${WRKSRC}/debian/mupdf.1 ${PREFIX}/man/man1
.for x in pdfclean pdfdraw pdfshow
${INSTALL_MAN} ${WRKSRC}/debian/$x.1 ${PREFIX}/man/man1/$x.1
.endfor
# don't want to conflict with xpdf's pdfinfo
mv ${PREFIX}/bin/pdfinfo ${PREFIX}/bin/pdfinfo_mupdf
${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
.include <bsd.port.mk>

View File

@ -1,5 +1,5 @@
MD5 (mupdf-0.5.tar.gz) = 6UkYWgg+YPZLERoXQx97+A==
RMD160 (mupdf-0.5.tar.gz) = i8igSg1zQ0eU9xxB3vdJtRt6vus=
SHA1 (mupdf-0.5.tar.gz) = cllvpP/fREL+zbl9IR4tm1j54+4=
SHA256 (mupdf-0.5.tar.gz) = /Gg/KkFprnqeZR7EyaDr95QKpZ3Y4Ir6yf8wPCkVHMI=
SIZE (mupdf-0.5.tar.gz) = 3608046
MD5 (mupdf-0.6-source.tar.gz) = 0eGh34+z5NHGAVBnl7dQNg==
RMD160 (mupdf-0.6-source.tar.gz) = ULHtHDwHYToduxnP5jy0fU8q4v4=
SHA1 (mupdf-0.6-source.tar.gz) = 3VAdpvUMaGxtUZ/mrnyVHS4tfhw=
SHA256 (mupdf-0.6-source.tar.gz) = b4fE8RPung9L39OjFu9EBS7cT+vI97UxxKP0T/4UlgU=
SIZE (mupdf-0.6-source.tar.gz) = 3607245

View File

@ -1,83 +0,0 @@
.\" $OpenBSD: mupdf.1,v 1.3 2010/03/21 00:05:33 sthen Exp $
.Dd $Mdocdate: March 21 2010 $
.Dt MUPDF 1
.Os
.Sh NAME
.Nm mupdf
.Nd "display PDF files"
.Sh SYNOPSIS
.Nm mupdf
.Bk -words
.Op Fl d Ar password
.Op Fl p Ar pagenumber
.Op Fl z Ar zoom
.Ar file.pdf
.Sh DESCRIPTION
.Nm
is a viewer for Portable Document Format (pdf) files.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d Ar password
Use
.Ar password
as the password to open the document.
.It Fl p Ar pagenumber
Open the document at page
.Ar pagenumber .
.It Fl z Ar zoom
Open the document zoomed by
.Ar zoom
percent.
Values less than 100 are silently ignored.
.El
.Sh KEY BINDINGS
The following key bindings are available.
.Pp
.Bl -tag -width xxxxxxxxxxxx -compact
.It l <
rotate anti-clockwise by 90 degrees
.It r >
rotate clockwise by 90 degrees
.It a
rotate anti-clockwise by 15 degrees
.It s
rotate clockwise by 15 degrees
.It u
scroll up
.\" .It up
.\" scroll up
.It d
scroll down
.\" .It down
.\" scroll down
.It + =
zoom in
.It -
zoom out
.It w
shrinkwrap
.It b backspace
previous page
.\" .It pgup left
.\" previous page
.It n space
next page
.\" .It pgdn right
.\" next page
.It N F
forward 10 pages
.It B
back 10 pages
.It m
mark page for snap back
.It t
pop back to last mark
.It 123g
move to page 123
.It P
display page number
.El
.Pp
.Sh SEE ALSO
.Xr xpdf 1

View File

@ -1,17 +0,0 @@
$OpenBSD: patch-Jamrules,v 1.3 2010/03/31 13:06:47 sthen Exp $
--- Jamrules.orig Thu Feb 18 21:33:09 2010
+++ Jamrules Wed Mar 31 13:51:54 2010
@@ -61,10 +61,10 @@ if $(OS) = LINUX
BUILD_X11APP = true ;
- CCFLAGS = -Wall -std=gnu99 -I/usr/include/freetype2 ;
- LINKFLAGS = -L/usr/X11R6/lib ;
+ CCFLAGS = -Wall -std=gnu99 $(CXXFLAGS) ;
+ LINKFLAGS = $(LDFLAGS) ;
LINKLIBS = -lfreetype -ljpeg -lz -lm ;
- APPLINKLIBS = -lX11 -lXext -lpthread ;
+ APPLINKLIBS = -lX11 -lXext -pthread ;
if $(BUILD) = debug { OPTIM = -g -O0 -fno-inline ; }
if $(BUILD) = release { OPTIM = -O3 ; }

View File

@ -0,0 +1,63 @@
$OpenBSD: patch-Makefile,v 1.1 2010/06/03 19:38:34 sthen Exp $
--- Makefile.orig Wed Jun 2 13:21:22 2010
+++ Makefile Thu Jun 3 11:46:32 2010
@@ -35,10 +35,11 @@ endif
# Build commands
#
-GENFILE_CMD = @ echo GENFILE $@ && $(firstword $^) $@ $(wordlist 2, 999, $^)
-CC_CMD = @ echo CC $@ && $(CC) -o $@ -c $< $(CFLAGS)
-LD_CMD = @ echo LD $@ && $(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
-AR_CMD = @ echo AR $@ && $(AR) cru $@ $^
+GENFILE_CMD = $(firstword $^) $@ $(wordlist 2, 999, $^)
+AS_CMD = $(AS) -o $@ $<
+CC_CMD = $(CC) -o $@ -c $< $(CFLAGS)
+LD_CMD = $(LD) -o $@ $^ $(LDFLAGS) $(LIBS)
+AR_CMD = $(AR) cru $@ $^
#
# Directories
@@ -57,6 +58,10 @@ FONTDUMP_EXE=$(OBJDIR)/fontdump
$(FONTDUMP_EXE): $(OBJDIR)/fontdump.o
$(LD_CMD)
+FONTRES_EXE=$(OBJDIR)/fontres
+$(FONTRES_EXE): $(OBJDIR)/fontres.o
+ $(LD_CMD)
+
CMAPDUMP_EXE=$(OBJDIR)/cmapdump
$(CMAPDUMP_EXE): $(OBJDIR)/cmapdump.o
$(LD_CMD)
@@ -110,6 +115,8 @@ $(OBJDIR)/%.o: mupdf/%.c
$(CC_CMD)
$(OBJDIR)/%.o: $(GENDIR)/%.c
$(CC_CMD)
+$(OBJDIR)/%.o: $(GENDIR)/%.s
+ $(AS_CMD)
#
# Generated font file dumps
@@ -129,18 +136,18 @@ CJKFONT_FILES=fonts/droid/DroidSansFallback.ttf
ifeq "$(pregen)" ""
-$(GENDIR)/font_base14.c: $(FONTDUMP_EXE) $(BASEFONT_FILES)
+$(GENDIR)/font_base14.s: $(FONTRES_EXE) $(BASEFONT_FILES)
$(GENFILE_CMD)
-$(GENDIR)/font_cjk.c: $(FONTDUMP_EXE) $(CJKFONT_FILES)
+$(GENDIR)/font_cjk.s: $(FONTRES_EXE) $(CJKFONT_FILES)
$(GENFILE_CMD)
endif
FONT_SRC=\
- $(GENDIR)/font_base14.c \
- $(GENDIR)/font_cjk.c
+ $(GENDIR)/font_base14.s \
+ $(GENDIR)/font_cjk.s
-FONT_OBJ=$(FONT_SRC:$(GENDIR)/%.c=$(OBJDIR)/%.o)
+FONT_OBJ=$(FONT_SRC:$(GENDIR)/%.s=$(OBJDIR)/%.o)
#
# Generated CMap file dumps

View File

@ -0,0 +1,32 @@
$OpenBSD: patch-Makerules,v 1.1 2010/06/03 19:38:34 sthen Exp $
--- Makerules.orig Tue Jun 1 20:11:36 2010
+++ Makerules Thu Jun 3 04:45:42 2010
@@ -4,9 +4,9 @@ OS := $(shell uname)
OS := $(OS:MINGW%=MINGW)
LIBS := -ljbig2dec -lopenjpeg -ljpeg -lz -lm
-CFLAGS := -Wall --std=gnu99 -Ifitz -Imupdf $(THIRD_INCS)
-LDFLAGS =
-CC = cc
+CFLAGS += -Wall --std=gnu99 -Ifitz -Imupdf $(THIRD_INCS)
+LDFLAGS ?=
+CC ?= cc
LD = $(CC)
AR = ar
@@ -29,6 +29,15 @@ ifeq "$(build)" "release"
CFLAGS += -mmmx -ftree-vectorize -msse -msse2 -march=k8 -DARCH_X86
ARCH_SRC = archx86.c
endif
+endif
+
+ifeq "$(OS)" "OpenBSD"
+ifeq "$(freetype_dir)" ""
+CFLAGS += `pkg-config --cflags freetype2`
+LDFLAGS += `pkg-config --libs freetype2`
+endif
+X11LIBS = -lX11 -lXext
+PDFVIEW_EXE = $(X11VIEW_EXE)
endif
ifeq "$(OS)" "Darwin"

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-debian_mupdf_desktop,v 1.1 2010/06/03 19:38:34 sthen Exp $
--- debian/mupdf.desktop.orig Thu Apr 29 21:26:43 2010
+++ debian/mupdf.desktop Thu Jun 3 11:32:28 2010
@@ -8,8 +8,9 @@ TryExec=mupdf
Icon=mupdf.xpm
Terminal=false
Type=Application
-MimeType=application/pdf;pplication/x-pdf;
+MimeType=application/pdf;application/x-pdf;
Categories=Viewer;Graphics;
+NoDisplay=true
[Desktop Action View]
Exec=mupdf %f

View File

@ -0,0 +1,9 @@
$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,14 @@
$OpenBSD: patch-fitz_fitz_base_h,v 1.1 2010/06/03 19:38:34 sthen Exp $
--- fitz/fitz_base.h.orig Mon May 31 15:16:48 2010
+++ fitz/fitz_base.h Thu Jun 3 04:13:00 2010
@@ -53,6 +53,10 @@ extern int gettimeofday(struct timeval *tv, struct tim
#else /* C99 or close enough */
+#ifndef restrict
+#define restrict
+#endif
+
#include <unistd.h>
#endif

View File

@ -1,66 +0,0 @@
$OpenBSD: patch-mupdf_Jamfile,v 1.4 2010/03/31 13:06:47 sthen Exp $
--- mupdf/Jamfile.orig Thu Feb 18 21:33:11 2010
+++ mupdf/Jamfile Wed Mar 31 13:51:54 2010
@@ -4,7 +4,7 @@
SubDir TOP mupdf ;
-Main fontdump : fontdump.c ;
+Main fontres : fontres.c ;
Main cmapdump : cmapdump.c ;
LinkLibraries cmapdump : libfitz ;
@@ -120,27 +120,27 @@ Library libcmaps :
SubDir TOP fonts ;
-GenFile font_misc.c : fontdump
+GenFile font_misc.s : fontres
Dingbats.cff
StandardSymL.cff
URWChanceryL-MediItal.cff
;
-GenFile font_mono.c : fontdump
+GenFile font_mono.s : fontres
NimbusMonL-Regu.cff
NimbusMonL-ReguObli.cff
NimbusMonL-Bold.cff
NimbusMonL-BoldObli.cff
;
-GenFile font_serif.c : fontdump
+GenFile font_serif.s : fontres
NimbusRomNo9L-Regu.cff
NimbusRomNo9L-ReguItal.cff
NimbusRomNo9L-Medi.cff
NimbusRomNo9L-MediItal.cff
;
-GenFile font_sans.c : fontdump
+GenFile font_sans.s : fontres
NimbusSanL-Bold.cff
NimbusSanL-BoldItal.cff
NimbusSanL-Regu.cff
@@ -148,15 +148,15 @@ GenFile font_sans.c : fontdump
;
Library libfonts :
- font_misc.c
- font_mono.c
- font_serif.c
- font_sans.c
+ font_misc.s
+ font_mono.s
+ font_serif.s
+ font_sans.s
;
if ! ( NOCJK in $(DEFINES) )
{
SubDir TOP fonts droid ;
- GenFile font_cjk.c : fontdump DroidSansFallback.ttf ;
- Library libfonts : font_cjk.c ;
+ GenFile font_cjk.s : fontres DroidSansFallback.ttf ;
+ Library libfonts : font_cjk.s ;
}

View File

@ -1,26 +1,20 @@
Fitz is a project to create a new and modern graphics library.
At the core of Fitz is the display tree: a scene graph of vector
graphics, images and text making up the contents of a page.
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
The standard components of Fitz are:
The renderer in MuPDF is tailored for high quality anti-aliased graphics.
It renders text with metrics and spacing accurate to within fractions of a
pixel for the highest fidelity in reproducing the look of a printed page
on screen.
* Base runtime (thin memory and error handling layer)
* Streams and filters (standard postscript, pdf and tiff filters)
* World model (display trees and resources)
* Drawing (draw the tree to a bitmap raster)
MuPDF has a small footprint. A binary that includes the standard Roman
fonts is only one megabyte. A build with full CJK support (including an
Asian font) is approximately five megabytes.
MuPDF is a PDF parser that reads PDF files and creates Fitz trees.
MuPDF has support for all non-interactive PDF 1.7 features, and the
toolkit provides a simple API for accessing the internal structures of the
PDF document.
MuPDF also has an API to modify internal objects in the PDF files
and write PDF files. For instance, it is possible to use the MuPDF
library to encrypt existing PDF files, or to rearrange the pages.
pdftool is a commandline demo of this functionality; it is a portable
pdf swiss army knife for fixing broken pdf files, changing permissions,
merging and extracting pages, and examining the internal object
structure of a PDF file.
The mupdf binary (aka pdfview) is a bare bones PDF viewer.
The optional no_cjk flavor disables CJK font metrics, giving a
smaller binary.
Command line utilities are included: pdfdraw, to render pages and output
PNM image files. pdfshow, to print and examine the objects in a PDF file.
pdfclean, to decompress and pretty print the streams and objects in PDF
files and also to extract individual pages. mu_pdfinfo, to display
information about objects. pdfextract, to extract individual objects.

View File

@ -1,8 +1,26 @@
@comment $OpenBSD: PLIST,v 1.2 2009/06/19 00:51:49 sthen Exp $
@bin bin/mu_pdfclean
@bin bin/mu_pdfdraw
@bin bin/mu_pdfextract
@bin bin/mu_pdfinfo
@bin bin/mu_pdfshow
@comment $OpenBSD: PLIST,v 1.3 2010/06/03 19:38:34 sthen Exp $
@bin bin/mupdf
@bin bin/pdfclean
@bin bin/pdfdraw
@bin bin/pdfextract
@bin bin/pdfinfo_mupdf
@bin bin/pdfshow
include/fitz.h
include/fitz_base.h
include/fitz_draw.h
include/fitz_stream.h
include/mupdf.h
lib/libmupdf.a
lib/pkgconfig/
lib/pkgconfig/mupdf.pc
@man man/man1/mupdf.1
@man man/man1/pdfclean.1
@man man/man1/pdfdraw.1
@man man/man1/pdfshow.1
share/application-registry/
share/application-registry/mupdf.applications
share/applications/mupdf.desktop
share/pixmaps/
share/pixmaps/mupdf.xpm
@exec %D/bin/update-desktop-database
@unexec-delete %D/bin/update-desktop-database