update to MuPDF 0.8.165, now also supporting XPS documents.

- drop fontres.c and switch to upstream's standard method of embedding fonts;
with gcc4 this is now able to build on arm without running out of RAM (this is
fortunate because it avoids reworking fontres for changes to MuPDF).
This commit is contained in:
sthen 2011-07-13 21:48:48 +00:00
parent 169abbf37c
commit 0627763e83
7 changed files with 57 additions and 204 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.25 2011/03/25 21:13:16 sthen Exp $
# $OpenBSD: Makefile,v 1.26 2011/07/13 21:48:48 sthen Exp $
COMMENT = graphic library, pdf parser, viewer and utilities
V = 0.8.15
REVISION = 0
V = 0.8.165
DISTNAME = mupdf-$V-source
PKGNAME = mupdf-$V
WRKDIST = ${WRKDIR}/mupdf-$V
@ -22,6 +21,7 @@ PERMIT_DISTFILES_FTP = Yes
WANTLIB = X11 Xext c freetype jbig2dec jpeg>=62 m openjpeg z
# http://git.ghostscript.com/?p=mupdf.git;a=summary
MASTER_SITES = ${HOMEPAGE}download/ \
${HOMEPAGE}download/archive/
@ -38,19 +38,13 @@ NO_REGRESS = Yes
MAKE_ENV += CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" CC=${CC} CXX=${CXX} \
MANDIR="${WRKINST}${PREFIX}/man/man1" build= verbose=1
CFLAGS += -Ifitz -Imupdf -I${LOCALBASE}/include
LDFLAGS += -L${LOCALBASE}/lib
FAKE_FLAGS = prefix=${WRKINST}${PREFIX}
FAKE_FLAGS = prefix=${WRKINST}${PREFIX} mandir=${WRKINST}${PREFIX}/man
# 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}/mupdf/
${SUBST_CMD} ${WRKSRC}/debian/mupdf.pc
post-install:
# don't want to conflict with xpdf's pdfinfo
# don't 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 \

View File

@ -1,5 +1,5 @@
MD5 (mupdf-0.8.15-source.tar.gz) = umFZ+rgpmVmdNlNM2geVfw==
RMD160 (mupdf-0.8.15-source.tar.gz) = C9fkk/GT9EqWPjDlfUSeNQPr98c=
SHA1 (mupdf-0.8.15-source.tar.gz) = Lg+By5kkZjhJmZXrznmr18B1Bhw=
SHA256 (mupdf-0.8.15-source.tar.gz) = yeesyGwgioVORgzQfBEyA5qV3wwhqlBSxEgftUCw4D4=
SIZE (mupdf-0.8.15-source.tar.gz) = 3837265
MD5 (mupdf-0.8.165-source.tar.gz) = qVgTc3kk5g2HqUTVK2pRIA==
RMD160 (mupdf-0.8.165-source.tar.gz) = L7TGrU6aTdAMxg/WNTd8NTgj5Wk=
SHA1 (mupdf-0.8.165-source.tar.gz) = FyIuvICkgu982xkNAVzv1IIQKN0=
SHA256 (mupdf-0.8.165-source.tar.gz) = z6AIcO+Ffe9d4ajSDlogsh1ypdMc5HRpU1OdIpnLxZ4=
SIZE (mupdf-0.8.165-source.tar.gz) = 3775041

View File

@ -1,95 +0,0 @@
/*
* Copyright (c) 2009 Roberto Fernandez
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <stdio.h>
#include <string.h>
int
main(int argc, char **argv)
{
FILE *fi, *fo;
char name[256], *basename, *p;
int i;
long len;
if (argc < 3)
{
fprintf(stderr, "usage: %s output.s input.dat [input2.dat ...]\n",
argv[0]);
return 1;
}
fo = fopen(argv[1], "wb");
if (!fo)
{
fprintf(stderr, "%s: could not open output file \"%s\"\n",
argv[0], argv[1]);
return 1;
}
for (i = 2; i < argc; i++)
{
fi = fopen(argv[i], "rb");
if (!fi)
{
fprintf(stderr, "%s: could not open input file \"%s\"\n",
argv[0], argv[i]);
return 1;
}
basename = strrchr(argv[i], '/');
#ifdef WIN32
if (!basename)
basename = strrchr(argv[i], '\\');
#endif
if (basename)
basename++;
else
basename = argv[i];
#ifdef WIN32
strncpy(name, "_pdf_font_", 255);
strncat(name, basename, 245);
#else
strncpy(name, "pdf_font_", 255);
strncat(name, basename, 246);
#endif
p = name;
while (*p)
{
if ((*p == '.') || (*p == '\\') || (*p == '-'))
*p = '_';
p ++;
}
fseek(fi, 0, SEEK_END);
len = ftell(fi);
fprintf(fo, "\t.globl %s_buf\n", name);
fprintf(fo, "\t.balign 8\n");
fprintf(fo, "%s_buf:\n", name);
fprintf(fo, "\t.incbin \"%s\"\n\n", argv[i]);
fprintf(fo, "\t.globl %s_len\n", name);
fprintf(fo, "\t.balign 4\n");
fprintf(fo, "%s_len:\n", name);
fprintf(fo, "\t.long %d\n\n\n", len);
fclose(fi);
}
return 0;
}

View File

@ -1,64 +0,0 @@
$OpenBSD: patch-Makefile,v 1.3 2011/03/22 23:40:46 sthen Exp $
--- Makefile.orig Wed Mar 16 11:57:24 2011
+++ Makefile Tue Mar 22 22:56:25 2011
@@ -44,13 +44,15 @@ CFLAGS += $(THIRD_INCS) $(SYS_FREETYPE_INC)
ifneq "$(verbose)" ""
GENFILE_CMD = $(firstword $^) $@ $(wordlist 2, 999, $^)
+AS_CMD = $(AS) -o $@ $<
CC_CMD = $(CC) -o $@ -c $< $(CFLAGS)
LD_CMD = $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
-AR_CMD = rm -f $@ && $(AR) cru $@ $^
+AR_CMD = $(AR) cru $@ $^
else
GENFILE_CMD = @ echo GENFILE $@ && $(firstword $^) $@ $(wordlist 2, 999, $^)
+AS_CMD = @ echo AS $@ && $(AS) -o $@ $<
CC_CMD = @ echo CC $@ && $(CC) -o $@ -c $< $(CFLAGS)
LD_CMD = @ echo LD $@ && $(CC) -o $@ $^ $(LDFLAGS) $(LIBS)
AR_CMD = @ echo AR $@ && rm -f $@ && $(AR) cru $@ $^
@@ -65,6 +67,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)
@@ -180,6 +186,8 @@ $(OBJDIR)/%.o: mupdf/%.c
$(CC_CMD)
$(OBJDIR)/%.o: $(GENDIR)/%.c
$(CC_CMD)
+$(OBJDIR)/%.o: $(GENDIR)/%.s
+ $(AS_CMD)
#
# Generated font file dumps
@@ -207,18 +215,18 @@ CJKFONT_FILES := \
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)
#

View File

@ -1,19 +1,33 @@
$OpenBSD: patch-Makerules,v 1.3 2011/03/22 23:40:46 sthen Exp $
--- Makerules.orig Wed Mar 16 11:57:24 2011
+++ Makerules Tue Mar 22 23:02:07 2011
@@ -55,6 +55,15 @@ LDFLAGS += -m32
endif
endif
$OpenBSD: patch-Makerules,v 1.4 2011/07/13 21:48:48 sthen Exp $
--- Makerules.orig Fri Apr 29 20:06:09 2011
+++ Makerules Wed Jul 13 21:37:52 2011
@@ -5,6 +5,7 @@ OS := $(OS:MINGW%=MINGW)
+ifeq "$(OS)" "OpenBSD"
+ifeq "$(freetype_dir)" ""
+CFLAGS += `pkg-config --cflags freetype2`
+LDFLAGS += `pkg-config --libs freetype2`
CFLAGS += -Wall
+ifneq "$(OS)" "OpenBSD" # don't override C optimizer flags for ports builds
ifeq "$(build)" "debug"
CFLAGS += -pipe -g
else ifeq "$(build)" "profile"
@@ -17,6 +18,7 @@ CFLAGS += -pipe -O2 -DNDEBUG -fomit-frame-pointer -mar
else
$(error unknown build setting: '$(build)')
endif
+endif
+X11LIBS = -lX11 -lXext
+PDFVIEW_EXE = $(X11VIEW_EXE)
ifeq "$(OS)" "Linux"
SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
@@ -27,6 +29,13 @@ ifeq "$(OS)" "FreeBSD"
SYS_FREETYPE_INC := `pkg-config --cflags freetype2`
LDFLAGS += -L/usr/local/lib
X11_LIBS := -lX11 -lXext
+endif
+
# MinGW build depends on thirdparty libs
ifeq "$(OS)" "MINGW"
WINDRES ?= windres
+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
endif
# Mac OS X build depends on some thirdparty libs

View File

@ -1,20 +1,20 @@
MuPDF is a lightweight PDF viewer and toolkit written in portable C.
MuPDF is a lightweight PDF and XPS viewer.
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.
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.
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 also small, fast, and yet complete. It supports PDF 1.7 with
transparency, encryption, hyperlinks, annotations, searching and more.
It also reads OpenXPS documents.
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.
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.
Command line utilities are included: pdfdraw, to render pages and output
Command line utilities include: 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
pdfclean, to decompress and pretty-print the streams and objects in PDF
files and also to extract individual pages. pdfinfo_mupdf, to display
information about objects. pdfextract, to extract individual objects.

View File

@ -1,13 +1,17 @@
@comment $OpenBSD: PLIST,v 1.4 2010/09/03 12:38:19 sthen Exp $
@comment $OpenBSD: PLIST,v 1.5 2011/07/13 21:48:48 sthen Exp $
@bin bin/mupdf
@bin bin/pdfclean
@bin bin/pdfdraw
@bin bin/pdfextract
@bin bin/pdfinfo_mupdf
@bin bin/pdfshow
@bin bin/xpsdraw
include/fitz.h
include/mupdf.h
include/muxps.h
lib/libfitz.a
lib/libmupdf.a
lib/libmuxps.a
lib/pkgconfig/
lib/pkgconfig/mupdf.pc
@man man/man1/mupdf.1