Fix build with openjpeg-2.1. Bump PKGREVISION.diff -r1.23 -r1.24 pkgsrc/print/mupdf/Makefile
(wiz)
@@ -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 | |||
3 | DISTNAME= mupdf-1.4-source | 3 | DISTNAME= mupdf-1.4-source | |
4 | PKGNAME= ${DISTNAME:S/-source//} | 4 | PKGNAME= ${DISTNAME:S/-source//} | |
5 | PKGREVISION= 1 | 5 | PKGREVISION= 2 | |
6 | CATEGORIES= print | 6 | CATEGORIES= print | |
7 | MASTER_SITES= http://mupdf.com/downloads/ | 7 | MASTER_SITES= http://mupdf.com/downloads/ | |
8 | 8 | |||
9 | MAINTAINER= pkgsrc-users@NetBSD.org | 9 | MAINTAINER= pkgsrc-users@NetBSD.org | |
10 | HOMEPAGE= http://mupdf.com/ | 10 | HOMEPAGE= http://mupdf.com/ | |
11 | COMMENT= Lightweight PDF viewer and toolkit | 11 | COMMENT= Lightweight PDF viewer and toolkit | |
12 | LICENSE= gnu-agpl-v3 | 12 | LICENSE= gnu-agpl-v3 | |
13 | 13 | |||
14 | USE_LIBTOOL= yes | 14 | USE_LIBTOOL= yes | |
15 | USE_TOOLS+= pkg-config gmake | 15 | USE_TOOLS+= pkg-config gmake | |
16 | 16 | |||
17 | SUBST_CLASSES+= makerules | |||
18 | SUBST_STAGE.makerules= post-patch | |||
19 | SUBST_MESSAGE.makerules= Fixing CFLAGS for openjpeg in Makerules. | |||
20 | SUBST_FILES.makerules= Makerules | |||
21 | SUBST_VARS.makerules+= PREFIX | |||
22 | ||||
23 | INSTALLATION_DIRS+= bin include lib/pkgconfig | 17 | INSTALLATION_DIRS+= bin include lib/pkgconfig | |
24 | INSTALL_MAKE_FLAGS+= prefix=${PREFIX} | 18 | INSTALL_MAKE_FLAGS+= prefix=${PREFIX} | |
25 | INSTALL_MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR} | 19 | INSTALL_MAKE_FLAGS+= mandir=${PREFIX}/${PKGMANDIR} | |
26 | LDFLAGS= ${COMPILER_RPATH_FLAG}${X11BASE}/lib | 20 | LDFLAGS= ${COMPILER_RPATH_FLAG}${X11BASE}/lib | |
27 | MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q} | 21 | MAKE_FLAGS+= LDFLAGS=${LDFLAGS:Q} | |
28 | MAKE_FLAGS+= build=release | 22 | MAKE_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). | |
35 | post-extract: | 29 | post-extract: | |
@@ -43,15 +37,17 @@ post-extract: | @@ -43,15 +37,17 @@ post-extract: | |||
43 | 37 | |||
44 | post-build: | 38 | post-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 | |||
47 | post-install: | 41 | post-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" |
@@ -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 | |||
3 | SHA1 (mupdf-1.4-source.tar.gz) = 805f9b37de371638eddb2f964837fecec8b64b4a | 3 | SHA1 (mupdf-1.4-source.tar.gz) = 805f9b37de371638eddb2f964837fecec8b64b4a | |
4 | RMD160 (mupdf-1.4-source.tar.gz) = 368140a0f825483268faaf778328bc6c3f4d461f | 4 | RMD160 (mupdf-1.4-source.tar.gz) = 368140a0f825483268faaf778328bc6c3f4d461f | |
5 | Size (mupdf-1.4-source.tar.gz) = 13253644 bytes | 5 | Size (mupdf-1.4-source.tar.gz) = 13253644 bytes | |
6 | SHA1 (patch-Makethird) = 950daf9a235f0da97d6a20dedd59bc8bd1c3e274 | 6 | SHA1 (patch-Makethird) = 950daf9a235f0da97d6a20dedd59bc8bd1c3e274 | |
7 | SHA1 (patch-ab) = 896d37f15718fed8880b56643bb131406cfe6861 | 7 | SHA1 (patch-ab) = d2ad5e74e2649a1db6eb2d5d9c0ad0efe5206182 | |
8 | SHA1 (patch-ac) = 87c4dbd17ff737f5edcfcf41c97add12722456ee | 8 | SHA1 (patch-ac) = 87c4dbd17ff737f5edcfcf41c97add12722456ee | |
9 | SHA1 (patch-ae) = bad4b6b8c669c752c6318bb564d1176daac30d19 | 9 | SHA1 (patch-ae) = bad4b6b8c669c752c6318bb564d1176daac30d19 | |
10 | SHA1 (patch-source_fitz_load-jpx.c) = e5271cf60aff104e05ff60333be54712475d5a33 |
@@ -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 | |||
3 | o Handle the various operating systems in the same way avoiding hardcoding | 3 | o Handle the various operating systems in the same way avoiding hardcoding | |
4 | o Build and link with openjpeg-2.0 | 4 | o Build and link with openjpeg-2.1 | |
5 | o libcurl (www/curl) support | 5 | o 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. |
$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);