https://mupdf.com/release_history.html lists a couple of bug fixes and
improvements.
Remove default ALL_TARGET and comment patches while here.
mupdf and mutool keep working for me on amd64, fine grained zoom still
works.
Can someone test this on other platforms and/or FLAVOR=js? The latter
is only built-tested by me on amd64.
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/mupdf/Makefile,v
retrieving revision 1.95
diff -u -p -r1.95 Makefile
--- Makefile 3 Jan 2020 16:29:25 -0000 1.95
+++ Makefile 13 Jun 2020 13:53:27 -0000
@@ -2,10 +2,9 @@
COMMENT = graphic library, pdf parser, viewer and utilities
-V = 1.16.1
+V = 1.17.0
DISTNAME = mupdf-$V-source
PKGNAME = mupdf-${V:S/-rc/rc/}
-REVISION = 1
CATEGORIES = textproc x11
@@ -43,8 +42,6 @@ LIB_DEPENDS = devel/harfbuzz \
USE_GMAKE = Yes
NO_TEST = Yes
-
-ALL_TARGET = all
MAKE_FLAGS = CC="${CC}" CXX="${CXX}" \
XCFLAGS="${CFLAGS} -fPIC -I$(WRKSRC)/fitz -I$(WRKSRC)/pdf
-I$(WRKSRC)/xps -I${X11BASE}/include" \
Index: distinfo
===================================================================
RCS file: /cvs/ports/textproc/mupdf/distinfo,v
retrieving revision 1.31
diff -u -p -r1.31 distinfo
--- distinfo 3 Aug 2019 19:16:22 -0000 1.31
+++ distinfo 13 Jun 2020 13:27:12 -0000
@@ -1,2 +1,2 @@
-SHA256 (mupdf-1.16.1-source.tar.gz) =
5x2nPdWT3XebjgmVl47AcROa5RynvMzQld2JIieL5Ec=
-SIZE (mupdf-1.16.1-source.tar.gz) = 60805318
+SHA256 (mupdf-1.17.0-source.tar.gz) =
AOM/qJy0Lx7547tzZxscttIQ9RWb1oFo+lyJzrJN1I4=
+SIZE (mupdf-1.17.0-source.tar.gz) = 65510829
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-Makefile,v
retrieving revision 1.17
diff -u -p -r1.17 patch-Makefile
--- patches/patch-Makefile 25 Jun 2019 22:03:46 -0000 1.17
+++ patches/patch-Makefile 13 Jun 2020 13:35:57 -0000
@@ -5,7 +5,7 @@ Index: Makefile
+++ Makefile
@@ -60,7 +60,7 @@ endif
LINK_CMD = $(QUIET_LINK) $(MKTGTDIR) ; $(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
- TAGS_CMD = $(QUIET_TAGS) ctags -R
+ TAGS_CMD = $(QUIET_TAGS) ctags -R --c-kinds=+p
WINDRES_CMD = $(QUIET_WINDRES) $(MKTGTDIR) ; $(WINDRES) $< $@
-OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) -r -b binary -o $@ $<
+OBJCOPY_CMD = $(QUIET_OBJCOPY) $(MKTGTDIR) ; $(LD) $(LLD_EMUL) -r -b binary
-o $@ $<
Index: patches/patch-Makerules
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-Makerules,v
retrieving revision 1.22
diff -u -p -r1.22 patch-Makerules
--- patches/patch-Makerules 30 Jul 2019 13:41:14 -0000 1.22
+++ patches/patch-Makerules 13 Jun 2020 13:35:57 -0000
@@ -3,7 +3,7 @@ $OpenBSD: patch-Makerules,v 1.22 2019/07
Index: Makerules
--- Makerules.orig
+++ Makerules
-@@ -24,8 +24,8 @@ ifeq ($(build),debug)
+@@ -26,8 +26,8 @@ ifeq ($(build),debug)
CFLAGS += -pipe -g
LDFLAGS += -g
else ifeq ($(build),release)
@@ -14,7 +14,7 @@ Index: Makerules
else ifeq ($(build),small)
CFLAGS += -pipe -Os -DNDEBUG -fomit-frame-pointer
LDFLAGS += $(LDREMOVEUNREACH) -Wl,-s
-@@ -85,8 +85,8 @@ else ifeq ($(OS),MACOS)
+@@ -91,8 +91,8 @@ else ifeq ($(OS),MACOS)
LD = xcrun ld
RANLIB = xcrun ranlib
@@ -25,7 +25,7 @@ Index: Makerules
ifeq ($(shell pkg-config --exists freetype2 && echo yes),yes)
SYS_FREETYPE_CFLAGS := $(shell pkg-config --cflags freetype2)
-@@ -131,10 +131,10 @@ else ifeq ($(OS),Linux)
+@@ -137,10 +137,10 @@ else ifeq ($(OS),Linux)
X11_LIBS := $(shell pkg-config --libs x11 xext)
endif
Index: patches/patch-Makethird
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-Makethird,v
retrieving revision 1.8
diff -u -p -r1.8 patch-Makethird
--- patches/patch-Makethird 30 Jul 2019 13:41:14 -0000 1.8
+++ patches/patch-Makethird 13 Jun 2020 13:49:31 -0000
@@ -1,9 +1,11 @@
$OpenBSD: patch-Makethird,v 1.8 2019/07/30 13:41:14 sthen Exp $
+Build MuJS only if ENABLE_MUJS is set.
+
Index: Makethird
--- Makethird.orig
+++ Makethird
-@@ -225,6 +225,7 @@ endif
+@@ -241,6 +241,7 @@ endif
# --- MuJS ---
@@ -11,7 +13,7 @@ Index: Makethird
ifeq ($(USE_SYSTEM_MUJS),yes)
THIRD_CFLAGS += $(SYS_MUJS_CFLAGS)
THIRD_LIBS += $(SYS_MUJS_LIBS)
-@@ -236,6 +237,7 @@ THIRD_CFLAGS += -Ithirdparty/mujs
+@@ -252,6 +253,7 @@ THIRD_CFLAGS += -Ithirdparty/mujs
$(OUT)/thirdparty/mujs/%.o: thirdparty/mujs/%.c
$(CC_CMD)
Index: patches/patch-docs_man_mupdf_1
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-docs_man_mupdf_1,v
retrieving revision 1.4
diff -u -p -r1.4 patch-docs_man_mupdf_1
--- patches/patch-docs_man_mupdf_1 30 Jul 2019 13:41:14 -0000 1.4
+++ patches/patch-docs_man_mupdf_1 13 Jun 2020 13:48:38 -0000
@@ -1,5 +1,7 @@
$OpenBSD: patch-docs_man_mupdf_1,v 1.4 2019/07/30 13:41:14 sthen Exp $
+Document fine grained zoom shortcuts.
+
Index: docs/man/mupdf.1
--- docs/man/mupdf.1.orig
+++ docs/man/mupdf.1
Index: patches/patch-platform_x11_pdfapp_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-platform_x11_pdfapp_c,v
retrieving revision 1.14
diff -u -p -r1.14 patch-platform_x11_pdfapp_c
--- patches/patch-platform_x11_pdfapp_c 17 Sep 2019 09:22:51 -0000 1.14
+++ patches/patch-platform_x11_pdfapp_c 13 Jun 2020 13:51:06 -0000
@@ -1,9 +1,12 @@
$OpenBSD: patch-platform_x11_pdfapp_c,v 1.14 2019/09/17 09:22:51 tb Exp $
+Add fine grained zoom levels.
+Recognise '\b' as <backspace> besides 'b'.
+
Index: platform/x11/pdfapp.c
--- platform/x11/pdfapp.c.orig
+++ platform/x11/pdfapp.c
-@@ -52,11 +52,21 @@ static void pdfapp_sleep(int ms)
+@@ -119,11 +119,21 @@ static void pdfapp_sleep(int ms)
static void pdfapp_showpage(pdfapp_t *app, int loadpage, int drawpage, int
repaint, int transition, int searching);
static const int zoomlist[] = {
@@ -28,24 +31,15 @@ Index: platform/x11/pdfapp.c
static int zoom_in(int oldres)
{
int i;
-@@ -1471,6 +1481,7 @@ void pdfapp_onkey(pdfapp_t *app, int c, int modifiers)
+@@ -1565,6 +1575,7 @@ void pdfapp_onkey(pdfapp_t *app, int c, int modifiers)
app->pageno++;
break;
+ case '\b': /* backspace */
case 'b':
- if (app->pany >= 0)
{
-@@ -1503,7 +1514,7 @@ void pdfapp_onkey(pdfapp_t *app, int c, int modifiers)
- {
- if (app->imgw + app->panx <= app->winw)
- {
-- if (app->pageno + 1 < app->pagecount)
-+ if (app->pageno < app->pagecount)
- {
- app->panx = 0;
- app->pany = 0;
-@@ -1613,9 +1624,9 @@ static void handlescroll(pdfapp_t *app, int modifiers,
+ int number = 1;
+@@ -1723,9 +1734,9 @@ static void handlescroll(pdfapp_t *app, int modifiers,
{
/* zoom in/out if ctrl is pressed */
if (dir > 0)
Index: patches/patch-platform_x11_x11_main_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-platform_x11_x11_main_c,v
retrieving revision 1.7
diff -u -p -r1.7 patch-platform_x11_x11_main_c
--- patches/patch-platform_x11_x11_main_c 30 Jul 2019 13:41:14 -0000
1.7
+++ patches/patch-platform_x11_x11_main_c 13 Jun 2020 13:35:57 -0000
@@ -15,7 +15,7 @@ Index: platform/x11/x11_main.c
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-@@ -733,7 +734,6 @@ void onselreq(Window requestor, Atom selection, Atom t
+@@ -734,7 +735,6 @@ static void onselreq(Window requestor, Atom selection,
void winreloadpage(pdfapp_t *app)
{
XEvent xev;
@@ -23,7 +23,7 @@ Index: platform/x11/x11_main.c
xev.xclient.type = ClientMessage;
xev.xclient.serial = 0;
-@@ -744,8 +744,7 @@ void winreloadpage(pdfapp_t *app)
+@@ -745,8 +745,7 @@ void winreloadpage(pdfapp_t *app)
xev.xclient.data.l[0] = 0;
xev.xclient.data.l[1] = 0;
xev.xclient.data.l[2] = 0;
@@ -33,7 +33,7 @@ Index: platform/x11/x11_main.c
}
void winopenuri(pdfapp_t *app, char *buf)
-@@ -934,6 +933,16 @@ int main(int argc, char **argv)
+@@ -935,6 +934,16 @@ int main(int argc, char **argv)
tmo_at.tv_sec = 0;
tmo_at.tv_usec = 0;
timeout = NULL;
Index: patches/patch-source_fitz_compress_c
===================================================================
RCS file: patches/patch-source_fitz_compress_c
diff -N patches/patch-source_fitz_compress_c
--- patches/patch-source_fitz_compress_c 12 May 2019 16:07:03 -0000
1.2
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-source_fitz_compress_c,v 1.2 2019/05/12 16:07:03 jca Exp $
-
-cope with old zlib
-
-Index: source/fitz/compress.c
---- source/fitz/compress.c.orig
-+++ source/fitz/compress.c
-@@ -1,5 +1,6 @@
- #include "mupdf/fitz.h"
-
-+#include <sys/limits.h>
- #include <zlib.h>
-
- #include <limits.h>
Index: patches/patch-source_fitz_list-device_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-source_fitz_list-device_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-source_fitz_list-device_c
--- patches/patch-source_fitz_list-device_c 23 Apr 2018 11:55:54 -0000
1.3
+++ patches/patch-source_fitz_list-device_c 13 Jun 2020 13:38:21 -0000
@@ -6,13 +6,13 @@ cast to pointer dereferences 8 byte alig
Index: source/fitz/list-device.c
--- source/fitz/list-device.c.orig
+++ source/fitz/list-device.c
-@@ -90,6 +90,9 @@ struct fz_display_node_s
+@@ -87,6 +87,9 @@ typedef struct
unsigned int ctm : 3;
unsigned int stroke : 1;
unsigned int flags : 6;
+#if defined(__alpha__) || defined(__mips64__) || defined(__sparc64__)
+ uint32_t pad;
+#endif
- };
+ } fz_display_node;
enum {
Index: patches/patch-source_fitz_load-jpx_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-source_fitz_load-jpx_c,v
retrieving revision 1.9
diff -u -p -r1.9 patch-source_fitz_load-jpx_c
--- patches/patch-source_fitz_load-jpx_c 30 Jul 2019 13:41:14 -0000
1.9
+++ patches/patch-source_fitz_load-jpx_c 13 Jun 2020 13:35:57 -0000
@@ -7,7 +7,7 @@ shared object")
Index: source/fitz/load-jpx.c
--- source/fitz/load-jpx.c.orig
+++ source/fitz/load-jpx.c
-@@ -587,6 +587,9 @@ void opj_free(void *ptr)
+@@ -584,6 +584,9 @@ void opj_free(void *ptr)
static void * opj_aligned_malloc_n(size_t alignment, size_t size)
{
@@ -15,17 +15,17 @@ Index: source/fitz/load-jpx.c
+ return opj_malloc(size);
+#else
uint8_t *ptr;
- int off;
+ size_t off;
-@@ -600,6 +603,7 @@ static void * opj_aligned_malloc_n(size_t alignment, s
+@@ -597,6 +600,7 @@ static void * opj_aligned_malloc_n(size_t alignment, s
off = alignment-(((int)(intptr_t)ptr) & (alignment - 1));
- ptr[off-1] = off;
+ ptr[off-1] = (uint8_t)off;
return ptr + off;
+#endif
}
void * opj_aligned_malloc(size_t size)
-@@ -614,6 +618,9 @@ void * opj_aligned_32_malloc(size_t size)
+@@ -611,6 +615,9 @@ void * opj_aligned_32_malloc(size_t size)
void opj_aligned_free(void* ptr_)
{
@@ -35,7 +35,7 @@ Index: source/fitz/load-jpx.c
uint8_t *ptr = (uint8_t *)ptr_;
uint8_t off;
if (ptr == NULL)
-@@ -621,6 +628,7 @@ void opj_aligned_free(void* ptr_)
+@@ -618,6 +625,7 @@ void opj_aligned_free(void* ptr_)
off = ptr[-1];
opj_free((void *)(((unsigned char *)ptr) - off));
Index: patches/patch-source_fitz_load-png_c
===================================================================
RCS file: patches/patch-source_fitz_load-png_c
diff -N patches/patch-source_fitz_load-png_c
--- patches/patch-source_fitz_load-png_c 23 Apr 2018 11:55:54 -0000
1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,12 +0,0 @@
-$OpenBSD: patch-source_fitz_load-png_c,v 1.1 2018/04/23 11:55:54 sthen Exp $
-
-Index: source/fitz/load-png.c
---- source/fitz/load-png.c.orig
-+++ source/fitz/load-png.c
-@@ -1,5 +1,6 @@
- #include "mupdf/fitz.h"
-
-+#include <sys/limits.h>
- #include <zlib.h>
-
- #include <limits.h>
Index: patches/patch-source_helpers_pkcs7_pkcs7-openssl_c
===================================================================
RCS file:
/cvs/ports/textproc/mupdf/patches/patch-source_helpers_pkcs7_pkcs7-openssl_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-source_helpers_pkcs7_pkcs7-openssl_c
--- patches/patch-source_helpers_pkcs7_pkcs7-openssl_c 30 Jul 2019 13:41:14
-0000 1.3
+++ patches/patch-source_helpers_pkcs7_pkcs7-openssl_c 13 Jun 2020 13:35:57
-0000
@@ -9,7 +9,7 @@ XXX source/helpers/pkcs7/pkcs7-openssl.c
Index: source/helpers/pkcs7/pkcs7-openssl.c
--- source/helpers/pkcs7/pkcs7-openssl.c.orig
+++ source/helpers/pkcs7/pkcs7-openssl.c
-@@ -473,6 +473,9 @@ enum pdf_signature_error pkcs7_openssl_check_certifica
+@@ -492,6 +492,9 @@ check_certificate(fz_context *ctx, pdf_pkcs7_verifier
}
}
@@ -19,7 +19,7 @@ Index: source/helpers/pkcs7/pkcs7-openss
res = pk7_verify_cert(st, pk7sig);
exit:
-@@ -521,7 +524,7 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPke
+@@ -533,7 +536,7 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPke
{
case NID_keyBag:
{
@@ -28,7 +28,7 @@ Index: source/helpers/pkcs7/pkcs7-openss
pkey = EVP_PKCS82PKEY(p8);
}
break;
-@@ -543,7 +546,7 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPke
+@@ -555,7 +558,7 @@ static void add_from_bag(X509 **pX509, EVP_PKEY **pPke
break;
case NID_safeContentsBag:
Index: patches/patch-source_tools_mudraw_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-source_tools_mudraw_c,v
retrieving revision 1.8
diff -u -p -r1.8 patch-source_tools_mudraw_c
--- patches/patch-source_tools_mudraw_c 30 Jul 2019 13:41:14 -0000 1.8
+++ patches/patch-source_tools_mudraw_c 13 Jun 2020 13:35:57 -0000
@@ -13,9 +13,9 @@ Index: source/tools/mudraw.c
+#include <errno.h>
+#include <unistd.h>
#include <string.h>
+ #include <limits.h>
#include <stdlib.h>
- #include <stdio.h>
-@@ -1542,6 +1544,23 @@ int mudraw_main(int argc, char **argv)
+@@ -1631,6 +1633,23 @@ int mudraw_main(int argc, char **argv)
if (fz_optind == argc)
usage();
Index: patches/patch-source_tools_pdfinfo_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-source_tools_pdfinfo_c,v
retrieving revision 1.5
diff -u -p -r1.5 patch-source_tools_pdfinfo_c
--- patches/patch-source_tools_pdfinfo_c 25 Jun 2019 22:03:46 -0000
1.5
+++ patches/patch-source_tools_pdfinfo_c 13 Jun 2020 13:35:57 -0000
@@ -14,7 +14,7 @@ Index: source/tools/pdfinfo.c
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-@@ -1029,6 +1031,12 @@ int pdfinfo_main(int argc, char **argv)
+@@ -1030,6 +1032,12 @@ int pdfinfo_main(int argc, char **argv)
if (fz_optind == argc)
infousage();
Index: patches/patch-source_tools_pdfposter_c
===================================================================
RCS file: /cvs/ports/textproc/mupdf/patches/patch-source_tools_pdfposter_c,v
retrieving revision 1.3
diff -u -p -r1.3 patch-source_tools_pdfposter_c
--- patches/patch-source_tools_pdfposter_c 23 Apr 2018 11:55:54 -0000
1.3
+++ patches/patch-source_tools_pdfposter_c 13 Jun 2020 13:35:57 -0000
@@ -14,7 +14,7 @@ Index: source/tools/pdfposter.c
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
-@@ -188,6 +190,12 @@ int pdfposter_main(int argc, char **argv)
+@@ -204,6 +206,12 @@ int pdfposter_main(int argc, char **argv)
(strstr(argv[fz_optind], ".pdf") || strstr(argv[fz_optind],
".PDF")))
{
outfile = argv[fz_optind++];
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/mupdf/pkg/PLIST,v
retrieving revision 1.25
diff -u -p -r1.25 PLIST
--- pkg/PLIST 1 Aug 2019 12:16:50 -0000 1.25
+++ pkg/PLIST 13 Jun 2020 13:43:16 -0000
@@ -31,6 +31,7 @@ include/mupdf/fitz/glyph.h
include/mupdf/fitz/hash.h
include/mupdf/fitz/image.h
include/mupdf/fitz/link.h
+include/mupdf/fitz/log.h
include/mupdf/fitz/outline.h
include/mupdf/fitz/output-svg.h
include/mupdf/fitz/output.h
@@ -74,8 +75,8 @@ include/mupdf/pdf/parse.h
include/mupdf/pdf/resource.h
include/mupdf/pdf/xref.h
include/mupdf/ucdn.h
-lib/libmupdf-third.a
-lib/libmupdf.a
+@static-lib lib/libmupdf-third.a
+@static-lib lib/libmupdf.a
@man man/man1/mupdf.1
@man man/man1/mutool.1
share/applications/mupdf.desktop