Sun May 18 08:12:22 2014 UTC ()
Fix build with openjpeg-2.1.
Bump PKGREVISION.


(wiz)
diff -r1.23 -r1.24 pkgsrc/print/mupdf/Makefile
diff -r1.13 -r1.14 pkgsrc/print/mupdf/distinfo
diff -r1.6 -r1.7 pkgsrc/print/mupdf/patches/patch-ab
diff -r0 -r1.1 pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c

cvs diff -r1.23 -r1.24 pkgsrc/print/mupdf/Makefile (expand / switch to unified diff)

--- pkgsrc/print/mupdf/Makefile 2014/05/15 14:41:58 1.23
+++ pkgsrc/print/mupdf/Makefile 2014/05/18 08:12:22 1.24
@@ -1,35 +1,29 @@ @@ -1,35 +1,29 @@
1# $NetBSD: Makefile,v 1.23 2014/05/15 14:41:58 adam Exp $ 1# $NetBSD: Makefile,v 1.24 2014/05/18 08:12:22 wiz Exp $
2 2
3DISTNAME= mupdf-1.4-source 3DISTNAME= mupdf-1.4-source
4PKGNAME= ${DISTNAME:S/-source//} 4PKGNAME= ${DISTNAME:S/-source//}
5PKGREVISION= 1 5PKGREVISION= 2
6CATEGORIES= print 6CATEGORIES= print
7MASTER_SITES= http://mupdf.com/downloads/ 7MASTER_SITES= http://mupdf.com/downloads/
8 8
9MAINTAINER= pkgsrc-users@NetBSD.org 9MAINTAINER= pkgsrc-users@NetBSD.org
10HOMEPAGE= http://mupdf.com/ 10HOMEPAGE= http://mupdf.com/
11COMMENT= Lightweight PDF viewer and toolkit 11COMMENT= Lightweight PDF viewer and toolkit
12LICENSE= gnu-agpl-v3 12LICENSE= gnu-agpl-v3
13 13
14USE_LIBTOOL= yes 14USE_LIBTOOL= yes
15USE_TOOLS+= pkg-config gmake 15USE_TOOLS+= pkg-config gmake
16 16
17SUBST_CLASSES+= makerules 
18SUBST_STAGE.makerules= post-patch 
19SUBST_MESSAGE.makerules= Fixing CFLAGS for openjpeg in Makerules. 
20SUBST_FILES.makerules= Makerules 
21SUBST_VARS.makerules+= PREFIX 
22 
23INSTALLATION_DIRS+= bin include lib/pkgconfig 17INSTALLATION_DIRS+= bin include lib/pkgconfig
24INSTALL_MAKE_FLAGS+= prefix=${PREFIX} 18INSTALL_MAKE_FLAGS+= prefix=${PREFIX}
25INSTALL_MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR} 19INSTALL_MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR}
26LDFLAGS= ${COMPILER_RPATH_FLAG}${X11BASE}/lib 20LDFLAGS= ${COMPILER_RPATH_FLAG}${X11BASE}/lib
27MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q} 21MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q}
28MAKE_FLAGS+= build=release 22MAKE_FLAGS+= build=release
29 23
30.include "options.mk" 24.include "options.mk"
31 25
32# Remove thirdparty directory in order to use the libraries provided by pkgsrc 26# Remove thirdparty directory in order to use the libraries provided by pkgsrc
33# mujs directory is an exception and should not be removed (MuJS is the 27# mujs directory is an exception and should not be removed (MuJS is the
34# default Javascript interpreter for mupdf). 28# default Javascript interpreter for mupdf).
35post-extract: 29post-extract:
@@ -43,15 +37,17 @@ post-extract: @@ -43,15 +37,17 @@ post-extract:
43 37
44post-build: 38post-build:
45 sed -e "s,@PREFIX@,${PREFIX}," ${FILESDIR}/mupdf.pc > ${WRKSRC}/mupdf.pc 39 sed -e "s,@PREFIX@,${PREFIX}," ${FILESDIR}/mupdf.pc > ${WRKSRC}/mupdf.pc
46 40
47post-install: 41post-install:
48 ${INSTALL_DATA} ${WRKSRC}/mupdf.pc ${DESTDIR}${PREFIX}/lib/pkgconfig 42 ${INSTALL_DATA} ${WRKSRC}/mupdf.pc ${DESTDIR}${PREFIX}/lib/pkgconfig
49 43
50.include "../../devel/zlib/buildlink3.mk" 44.include "../../devel/zlib/buildlink3.mk"
51.include "../../graphics/freetype2/buildlink3.mk" 45.include "../../graphics/freetype2/buildlink3.mk"
52.include "../../graphics/jbig2dec/buildlink3.mk" 46.include "../../graphics/jbig2dec/buildlink3.mk"
53.include "../../mk/jpeg.buildlink3.mk" 47.include "../../mk/jpeg.buildlink3.mk"
54.include "../../graphics/openjpeg/buildlink3.mk" 48.include "../../graphics/openjpeg/buildlink3.mk"
55.include "../../graphics/png/buildlink3.mk" 49.include "../../graphics/png/buildlink3.mk"
 50# what is it used for?
 51#.include "../../www/curl/buildlink3.mk"
56.include "../../x11/libXext/buildlink3.mk" 52.include "../../x11/libXext/buildlink3.mk"
57.include "../../mk/bsd.pkg.mk" 53.include "../../mk/bsd.pkg.mk"

cvs diff -r1.13 -r1.14 pkgsrc/print/mupdf/distinfo (expand / switch to unified diff)

--- pkgsrc/print/mupdf/distinfo 2014/04/21 16:14:40 1.13
+++ pkgsrc/print/mupdf/distinfo 2014/05/18 08:12:22 1.14
@@ -1,9 +1,10 @@ @@ -1,9 +1,10 @@
1$NetBSD: distinfo,v 1.13 2014/04/21 16:14:40 wiz Exp $ 1$NetBSD: distinfo,v 1.14 2014/05/18 08:12:22 wiz Exp $
2 2
3SHA1 (mupdf-1.4-source.tar.gz) = 805f9b37de371638eddb2f964837fecec8b64b4a 3SHA1 (mupdf-1.4-source.tar.gz) = 805f9b37de371638eddb2f964837fecec8b64b4a
4RMD160 (mupdf-1.4-source.tar.gz) = 368140a0f825483268faaf778328bc6c3f4d461f 4RMD160 (mupdf-1.4-source.tar.gz) = 368140a0f825483268faaf778328bc6c3f4d461f
5Size (mupdf-1.4-source.tar.gz) = 13253644 bytes 5Size (mupdf-1.4-source.tar.gz) = 13253644 bytes
6SHA1 (patch-Makethird) = 950daf9a235f0da97d6a20dedd59bc8bd1c3e274 6SHA1 (patch-Makethird) = 950daf9a235f0da97d6a20dedd59bc8bd1c3e274
7SHA1 (patch-ab) = 896d37f15718fed8880b56643bb131406cfe6861 7SHA1 (patch-ab) = d2ad5e74e2649a1db6eb2d5d9c0ad0efe5206182
8SHA1 (patch-ac) = 87c4dbd17ff737f5edcfcf41c97add12722456ee 8SHA1 (patch-ac) = 87c4dbd17ff737f5edcfcf41c97add12722456ee
9SHA1 (patch-ae) = bad4b6b8c669c752c6318bb564d1176daac30d19 9SHA1 (patch-ae) = bad4b6b8c669c752c6318bb564d1176daac30d19
 10SHA1 (patch-source_fitz_load-jpx.c) = e5271cf60aff104e05ff60333be54712475d5a33

cvs diff -r1.6 -r1.7 pkgsrc/print/mupdf/patches/patch-ab (expand / switch to unified diff)

--- pkgsrc/print/mupdf/patches/patch-ab 2014/04/21 16:14:40 1.6
+++ pkgsrc/print/mupdf/patches/patch-ab 2014/05/18 08:12:22 1.7
@@ -1,17 +1,17 @@ @@ -1,17 +1,17 @@
1$NetBSD: patch-ab,v 1.6 2014/04/21 16:14:40 wiz Exp $ 1$NetBSD: patch-ab,v 1.7 2014/05/18 08:12:22 wiz Exp $
2 2
3o Handle the various operating systems in the same way avoiding hardcoding 3o Handle the various operating systems in the same way avoiding hardcoding
4o Build and link with openjpeg-2.0 4o Build and link with openjpeg-2.1
5o libcurl (www/curl) support 5o libcurl (www/curl) support
6 6
7--- Makerules.orig 2014-04-11 15:10:41.000000000 +0000 7--- Makerules.orig 2014-04-11 15:10:41.000000000 +0000
8+++ Makerules 8+++ Makerules
9@@ -25,37 +25,6 @@ else 9@@ -25,37 +25,6 @@ else
10 $(error unknown build setting: '$(build)') 10 $(error unknown build setting: '$(build)')
11 endif 11 endif
12  12
13-# Windows (MINGW) build doesn't use system libraries. 13-# Windows (MINGW) build doesn't use system libraries.
14-ifeq "$(OS)" "MINGW" 14-ifeq "$(OS)" "MINGW"
15- 15-
16-# Mac OS X doesn't have pkg-config so we hard code paths. 16-# Mac OS X doesn't have pkg-config so we hard code paths.
17-else ifeq "$(OS)" "MACOS" 17-else ifeq "$(OS)" "MACOS"
@@ -50,24 +50,24 @@ o libcurl (www/curl) support @@ -50,24 +50,24 @@ o libcurl (www/curl) support
50  50
51-# TODO: use pkg-config for system CURL 51-# TODO: use pkg-config for system CURL
52+SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl) 52+SYS_CURL_CFLAGS = $(shell pkg-config --cflags libcurl)
53 SYS_CURL_DEPS = -lpthread -lrt 53 SYS_CURL_DEPS = -lpthread -lrt
54+SYS_CURL_LIBS = $(shell pkg-config --libs libcurl) 54+SYS_CURL_LIBS = $(shell pkg-config --libs libcurl)
55  55
56 SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext) 56 SYS_X11_CFLAGS = $(shell pkg-config --cflags x11 xext)
57 SYS_X11_LIBS = $(shell pkg-config --libs x11 xext) 57 SYS_X11_LIBS = $(shell pkg-config --libs x11 xext)
58  58
59 SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2) 59 SYS_FREETYPE_CFLAGS = $(shell pkg-config --cflags freetype2)
60 SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2) 60 SYS_FREETYPE_LIBS = $(shell pkg-config --libs freetype2)
61-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjpeg1) 61-SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjpeg1)
62-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjpeg1) 62-SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjpeg1)
63+SYS_OPENJPEG_CFLAGS = -I/usr/pkg/include/openjpeg-2.0 63+SYS_OPENJPEG_CFLAGS = $(shell pkg-config --cflags libopenjp2)
64+SYS_OPENJPEG_LIBS = -lopenjp2 64+SYS_OPENJPEG_LIBS = $(shell pkg-config --libs libopenjp2)
65 SYS_JBIG2DEC_LIBS = -ljbig2dec 65 SYS_JBIG2DEC_LIBS = -ljbig2dec
66 SYS_JPEG_LIBS = -ljpeg 66 SYS_JPEG_LIBS = -ljpeg
67 SYS_ZLIB_LIBS = -lz 67 SYS_ZLIB_LIBS = -lz
68  68
69-endif 69-endif
70- 70-
71 # The following section is an example of how to simply do cross-compilation 71 # The following section is an example of how to simply do cross-compilation
72 # using these Makefiles. It builds for a beagleboard running ARM linux, 72 # using these Makefiles. It builds for a beagleboard running ARM linux,
73 # compiling on windows with the CodeSourcery G++ compilers. 73 # compiling on windows with the CodeSourcery G++ compilers.

File Added: pkgsrc/print/mupdf/patches/patch-source_fitz_load-jpx.c
$NetBSD: patch-source_fitz_load-jpx.c,v 1.1 2014/05/18 08:12:22 wiz Exp $

Fix build with openjpeg-2.1.
I have misgivings about the code though.

--- source/fitz/load-jpx.c.orig	2014-04-11 15:10:41.000000000 +0000
+++ source/fitz/load-jpx.c
@@ -117,7 +117,8 @@ fz_load_jpx(fz_context *ctx, unsigned ch
 	opj_stream_set_read_function(stream, fz_opj_stream_read);
 	opj_stream_set_skip_function(stream, fz_opj_stream_skip);
 	opj_stream_set_seek_function(stream, fz_opj_stream_seek);
-	opj_stream_set_user_data(stream, &sb);
+	/* XXX: sb is on the stack, so no user data free-er needed; I'm not sure that placing it on the stack will work though? */
+	opj_stream_set_user_data(stream, &sb, NULL);
 	/* Set the length to avoid an assert */
 	opj_stream_set_user_data_length(stream, size);