[gdal] PATCH FOR LIBPNG 1.5
Volker Fröhlich
volter at fedoraproject.org
Tue Jan 10 09:38:14 UTC 2012
commit 68aad6a3348c86719ef376af5b46a975640ab2d0
Author: Volker Fröhlich <volker27 at gmx.at>
Date: Tue Jan 10 15:07:47 2012 +0530
PATCH FOR LIBPNG 1.5
gdal-1.7.3-png15.patch | 39 +++++++++++++++++++++++++++++++++++++++
gdal.spec | 19 ++++++++++++++++---
2 files changed, 55 insertions(+), 3 deletions(-)
---
diff --git a/gdal-1.7.3-png15.patch b/gdal-1.7.3-png15.patch
new file mode 100644
index 0000000..92c8533
--- /dev/null
+++ b/gdal-1.7.3-png15.patch
@@ -0,0 +1,39 @@
+diff -Nur gdal-1.7.3-fedora/frmts/png/pngdataset.cpp gdal-1.7.3-fedora-png15/frmts/png/pngdataset.cpp
+--- gdal-1.7.3-fedora/frmts/png/pngdataset.cpp 2010-11-07 23:58:47.000000000 +0530
++++ gdal-1.7.3-fedora-png15/frmts/png/pngdataset.cpp 2012-01-10 14:50:25.384124887 +0530
+@@ -1296,7 +1296,7 @@
+ * instead of an int, which is what fread() actually returns.
+ */
+ check = (png_size_t)VSIFReadL(data, (png_size_t)1, length,
+- (png_FILE_p)png_ptr->io_ptr);
++ (png_FILE_p)png_get_io_ptr(png_ptr));
+
+ if (check != length)
+ png_error(png_ptr, "Read Error");
+@@ -1311,7 +1311,7 @@
+ {
+ png_uint_32 check;
+
+- check = VSIFWriteL(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
++ check = VSIFWriteL(data, 1, length, (png_FILE_p)png_get_io_ptr(png_ptr));
+
+ if (check != length)
+ png_error(png_ptr, "Write Error");
+@@ -1322,7 +1322,7 @@
+ /************************************************************************/
+ static void png_vsi_flush(png_structp png_ptr)
+ {
+- VSIFFlushL( (png_FILE_p)(png_ptr->io_ptr) );
++ VSIFFlushL( (png_FILE_p)png_get_io_ptr(png_ptr) );
+ }
+
+ /************************************************************************/
+@@ -1338,7 +1338,7 @@
+ // libpng is generally not built as C++ and so won't honour unwind
+ // semantics. Ugg.
+
+- jmp_buf* psSetJmpContext = (jmp_buf*) png_ptr->error_ptr;
++ jmp_buf* psSetJmpContext = (jmp_buf*) png_get_error_ptr(png_ptr);
+ if (psSetJmpContext)
+ {
+ longjmp( *psSetJmpContext, 1 );
diff --git a/gdal.spec b/gdal.spec
index 150cf08..610ea80 100644
--- a/gdal.spec
+++ b/gdal.spec
@@ -18,9 +18,16 @@ Patch1: %{name}-mysql.patch
Patch2: %{name}-bindir.patch
Patch3: %{name}-AIS.patch
Patch4: %{name}-%{version}-xcompiler.patch
+
# https://bugzilla.redhat.com/show_bug.cgi?id=693952
# http://trac.osgeo.org/gdal/ticket/3694 -- Still present in 1.8 tarball
Patch5: %{name}-1.8.0-mitab.patch
+
+# Allow to use libpng 1.5
+# http://trac.osgeo.org/gdal/changeset/21526
+# Not necessary for 1.8 and later
+Patch6: %{name}-1.7.3-png15.patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libtool pkgconfig
BuildRequires: python-devel numpy xerces-c-devel
@@ -145,10 +152,15 @@ rm -rf frmts/gtiff/libgeotiff \
%patch1 -p0 -b .mysql~
%patch2 -p1 -b .bindir~
%patch3 -p1 -b .AIS~
-%patch4 -p1 -b .xcompiler
-%patch5 -p3 -b .mitab
+%patch4 -p1 -b .xcompiler~
+%patch5 -p3 -b .mitab~
+
+# Only F17 has libpng 1.5
+%if ! (0%{?fedora} < 17 || 0%{?rhel})
+%patch6 -p1 -b .png15~
+%endif
-# unpack test cases also.
+# Unpack test cases
tar -xzf %{SOURCE1}
set +x
@@ -620,6 +632,7 @@ rm -rf $RPM_BUILD_ROOT
- Remove elements for grass support --> Will be replaced by plug-in
- Remove unnecessary defattr
- Correct version number in POM
+- Allow for libpng 1.5
* Tue Dec 06 2011 Adam Jackson <ajax at redhat.com> - 1.7.3-11
- Rebuild for new libpng
More information about the scm-commits
mailing list