]> git.pld-linux.org Git - packages/gdal.git/commitdiff
upstream fixes for build with new jasper
authorJan Palus <atler@pld-linux.org>
Sun, 22 Nov 2020 11:11:42 +0000 (12:11 +0100)
committerJan Palus <atler@pld-linux.org>
Sun, 22 Nov 2020 11:11:42 +0000 (12:11 +0100)
gdal.spec
jasper.patch [new file with mode: 0644]

index 8d365f000e56f508261d28cfc9ce4e1e46d0fedc..4e33ac59e93003e0c09d675aa5c8bb612dd8ead3 100644 (file)
--- a/gdal.spec
+++ b/gdal.spec
@@ -63,6 +63,7 @@ Patch4:               %{name}-pluginsdir.patch
 Patch5:                libx32.patch
 Patch7:                decl.patch
 Patch8:                %{name}_tirpcinc.patch
+Patch9:                jasper.patch
 URL:           http://www.gdal.org/
 # 1.x or 2.x supported
 BuildRequires: CharLS-devel
@@ -275,6 +276,7 @@ ModuĊ‚ Pythona GDAL.
 %patch5 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p2
 
 # need to regenerate (old ones don't support perl 5.10)
 %{__rm} swig/perl/{gdal_wrap.cpp,gdalconst_wrap.c,ogr_wrap.cpp,osr_wrap.cpp}
diff --git a/jasper.patch b/jasper.patch
new file mode 100644 (file)
index 0000000..9a2aae6
--- /dev/null
@@ -0,0 +1,69 @@
+From 3c5cb6266a01a607ee7560807465bc833240d793 Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Mon, 10 Aug 2020 17:26:53 +0200
+Subject: [PATCH] JPEG2000: fix build with Jasper 2.0.17 (fixes #2844)
+
+---
+ gdal/frmts/jpeg2000/jpeg2000dataset.cpp | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
+index 3e668ffe503..2d3f4e46876 100644
+--- a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
++++ b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
+@@ -484,7 +484,7 @@ int JPEG2000Dataset::DecodeImage()
+     /* the JP2 boxes match the ones of the code stream */
+     if (nBands != 0)
+     {
+-        if (nBands != jas_image_numcmpts( psImage ))
++        if (nBands != static_cast<int>(jas_image_numcmpts( psImage )))
+         {
+             CPLError(CE_Failure, CPLE_AppDefined,
+                      "The number of components indicated in the IHDR box (%d) mismatch "
+@@ -595,7 +595,7 @@ GDALDataset *JPEG2000Dataset::Open( GDALOpenInfo * poOpenInfo )
+ {
+     int         iFormat;
+-    char        *pszFormatName = nullptr;
++    const char *pszFormatName = nullptr;
+     if (!Identify(poOpenInfo))
+         return nullptr;
+From e236eeaed1be45a4af457565085e3db1f2fc489f Mon Sep 17 00:00:00 2001
+From: Even Rouault <even.rouault@spatialys.com>
+Date: Tue, 11 Aug 2020 09:26:41 +0200
+Subject: [PATCH] JPEG2000: follow-up fix to build with Jasper 2.0.17 (fixes
+ #2844)
+
+---
+ gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
+index e780d2bcaed..10a4f96f0ee 100644
+--- a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
++++ b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
+@@ -94,13 +94,23 @@ typedef struct {
+ * File stream object.
+ \******************************************************************************/
++// PRIjas_seqent macro is defined since Jasper 2.0.17
++
++#ifndef PRIjas_seqent
+ static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt)
++#else
++static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, unsigned cnt)
++#endif
+ {
+     jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
+     return static_cast<int>(VSIFReadL(buf, 1, cnt, fileobj->fp));
+ }
++#ifndef PRIjas_seqent
+ static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt)
++#else
++static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
++#endif
+ {
+     jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
+     return static_cast<int>(VSIFWriteL(buf, 1, cnt, fileobj->fp));
This page took 0.20089 seconds and 4 git commands to generate.