Gentoo Archives: gentoo-commits

From: Amy Winston <amynka@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-libs/gdal/files/, sci-libs/gdal/
Date: Sat, 03 Dec 2016 10:36:04
Message-Id: 1480760783.f6d0b15b0e40546b0cb66930e2cd8a95a4001d24.amynka@gentoo
1 commit: f6d0b15b0e40546b0cb66930e2cd8a95a4001d24
2 Author: Amy Winston <amynka <AT> gentoo <DOT> org>
3 AuthorDate: Sat Dec 3 10:26:23 2016 +0000
4 Commit: Amy Winston <amynka <AT> gentoo <DOT> org>
5 CommitDate: Sat Dec 3 10:26:23 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6d0b15b
7
8 sci-libs/gdal: add jasper patch bug #599626
9
10 Package-Manager: portage-2.3.0
11
12 sci-libs/gdal/files/gdal-2.0.2-jasper2.patch | 62 ++++++++++++++++++++++++++++
13 sci-libs/gdal/gdal-2.0.2-r3.ebuild | 1 +
14 2 files changed, 63 insertions(+)
15
16 diff --git a/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch b/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch
17 new file mode 100644
18 index 00000000..a418e41
19 --- /dev/null
20 +++ b/sci-libs/gdal/files/gdal-2.0.2-jasper2.patch
21 @@ -0,0 +1,62 @@
22 +diff -urN orig/frmts/jpeg2000/jpeg2000_vsil_io.cpp dwok/frmts/jpeg2000/jpeg2000_vsil_io.cpp
23 +--- orig/frmts/jpeg2000/jpeg2000_vsil_io.cpp 2016-01-26 16:21:48.000000000 +0100
24 ++++ dwok/frmts/jpeg2000/jpeg2000_vsil_io.cpp 2016-11-16 21:53:15.280302723 +0100
25 +@@ -179,40 +179,25 @@
26 + * Buffer initialization code.
27 + \******************************************************************************/
28 +
29 +-static void JPEG2000_VSIL_jas_stream_initbuf(jas_stream_t *stream, int bufmode, char *buf,
30 +- int bufsize)
31 ++static void JPEG2000_VSIL_jas_stream_initbuf(jas_stream_t *stream, int bufmode)
32 + {
33 + /* If this function is being called, the buffer should not have been
34 + initialized yet. */
35 + assert(!stream->bufbase_);
36 +
37 + if (bufmode != JAS_STREAM_UNBUF) {
38 +- /* The full- or line-buffered mode is being employed. */
39 +- if (!buf) {
40 +- /* The caller has not specified a buffer to employ, so allocate
41 +- one. */
42 +- if ((stream->bufbase_ = (unsigned char*)jas_malloc(JAS_STREAM_BUFSIZE +
43 +- JAS_STREAM_MAXPUTBACK))) {
44 +- stream->bufmode_ |= JAS_STREAM_FREEBUF;
45 +- stream->bufsize_ = JAS_STREAM_BUFSIZE;
46 +- } else {
47 +- /* The buffer allocation has failed. Resort to unbuffered
48 +- operation. */
49 +- stream->bufbase_ = stream->tinybuf_;
50 +- stream->bufsize_ = 1;
51 +- }
52 ++ if ((stream->bufbase_ = (unsigned char*)jas_malloc(JAS_STREAM_BUFSIZE +
53 ++ JAS_STREAM_MAXPUTBACK))) {
54 ++ stream->bufmode_ |= JAS_STREAM_FREEBUF;
55 ++ stream->bufsize_ = JAS_STREAM_BUFSIZE;
56 + } else {
57 +- /* The caller has specified a buffer to employ. */
58 +- /* The buffer must be large enough to accommodate maximum
59 +- putback. */
60 +- assert(bufsize > JAS_STREAM_MAXPUTBACK);
61 +- stream->bufbase_ = JAS_CAST(uchar *, buf);
62 +- stream->bufsize_ = bufsize - JAS_STREAM_MAXPUTBACK;
63 ++ /* The buffer allocation has failed. Resort to unbuffered
64 ++ operation. */
65 ++ stream->bufbase_ = stream->tinybuf_;
66 ++ stream->bufsize_ = 1;
67 + }
68 + } else {
69 + /* The unbuffered mode is being employed. */
70 +- /* A buffer should not have been supplied by the caller. */
71 +- assert(!buf);
72 + /* Use a trivial one-character buffer. */
73 + stream->bufbase_ = stream->tinybuf_;
74 + stream->bufsize_ = 1;
75 +@@ -282,7 +267,7 @@
76 + }
77 +
78 + /* By default, use full buffering for this type of stream. */
79 +- JPEG2000_VSIL_jas_stream_initbuf(stream, JAS_STREAM_FULLBUF, 0, 0);
80 ++ JPEG2000_VSIL_jas_stream_initbuf(stream, JAS_STREAM_FULLBUF);
81 +
82 + return stream;
83 + }
84
85 diff --git a/sci-libs/gdal/gdal-2.0.2-r3.ebuild b/sci-libs/gdal/gdal-2.0.2-r3.ebuild
86 index 2dae2cd..f8a672c 100644
87 --- a/sci-libs/gdal/gdal-2.0.2-r3.ebuild
88 +++ b/sci-libs/gdal/gdal-2.0.2-r3.ebuild
89 @@ -87,6 +87,7 @@ src_prepare() {
90
91 if use jpeg2k; then
92 epatch "${FILESDIR}"/${P}-jasper.patch
93 + epatch "${FILESDIR}"/${P}-jasper2.patch #bug 599626
94 fi
95
96 # -soname is only accepted by GNU ld/ELF