[grass] ADD LIBPNG API PATCH

Volker Fröhlich volter at fedoraproject.org
Wed Nov 23 23:13:26 UTC 2011


commit fbffd08fa7313996a74d79478f278613af1e49b1
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Thu Nov 24 00:12:53 2011 +0100

    ADD LIBPNG API PATCH

 grass-6.4.1-r.out.png.patch |   39 +++++++++++++++++++++++++++++++++++++++
 grass.spec                  |    8 +++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/grass-6.4.1-r.out.png.patch b/grass-6.4.1-r.out.png.patch
new file mode 100644
index 0000000..d7d63c8
--- /dev/null
+++ b/grass-6.4.1-r.out.png.patch
@@ -0,0 +1,39 @@
+diff -Nur grass-6.4.1/raster/r.out.png/r.out.png.c grass-6.4.1-r.out.png/raster/r.out.png/r.out.png.c
+--- grass-6.4.1/raster/r.out.png/r.out.png.c	2010-10-17 19:15:31.000000000 +0200
++++ grass-6.4.1-r.out.png/raster/r.out.png/r.out.png.c	2011-11-23 22:57:47.382158068 +0100
+@@ -261,9 +261,11 @@
+     png_info_init(info_ptr);
+ #endif
+     png_init_io(png_ptr, fp);
+-    info_ptr->width = win.cols;
+-    info_ptr->height = win.rows;
+-    info_ptr->bit_depth = depth;
++
++    png_set_IHDR(png_ptr, info_ptr, win.cols, win.rows, depth, 
++            do_alpha ? PNG_COLOR_TYPE_RGB_ALPHA : PNG_COLOR_TYPE_RGB, 
++            PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, 
++            PNG_FILTER_TYPE_DEFAULT); 
+ 
+     /* explicit filter-type (or none) required */
+     if ((filter >= 0) && (filter <= 4)) {
+@@ -272,7 +274,7 @@
+ 
+     png_set_compression_level(png_ptr, png_compr);
+ 
+-    if(do_alpha) {
++    if (do_alpha) {
+ 	png_color_16 background_color;
+ 	background_color.red = (png_uint_16)def_red;
+ 	background_color.green = (png_uint_16)def_grn;
+@@ -302,11 +304,6 @@
+ 	/*if(!gscale->answer){ *//* 24BIT COLOR IMAGE */
+ 
+ 	if (TRUE) {
+-	    if (do_alpha)
+-		info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+-	    else
+-		info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+-
+ 	    /* write the png-info struct */
+ 	    png_write_info(png_ptr, info_ptr);
+ 
diff --git a/grass.spec b/grass.spec
index 5525547..50fb6d8 100644
--- a/grass.spec
+++ b/grass.spec
@@ -49,6 +49,10 @@ Patch2:    %{name}-6.4.1-docfiles.patch
 # http://osgeo-org.1803224.n2.nabble.com/Error-with-GRASS-6-4-1-on-CentOS-5-td6270338.html
 Patch5:    %{name}-6.4.1-ternaryOp-python24.patch
 
+# Libpng API changed from 1.2 to 1.5
+#http://trac.osgeo.org/grass/ticket/1347
+Patch6:    %{name}-6.4.1-r.out.png.patch
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 Requires:  proj-nad proj-epsg wxPython
@@ -140,6 +144,7 @@ GRASS (Geographic Resources Analysis Support System) development headers.
 #%patch3 -p1 -b .pager
 #%patch4 -p1 -b .www-browser
 %patch5 -p0 -b .ternaryOp
+%patch6 -p1 -b .r.out.png
 
 # Correct mysql_config query
 sed -i 's|--libmysqld-libs|--libs|g' configure
@@ -384,9 +389,10 @@ rm -rf %{buildroot}
 
 
 %changelog
-* Wed Nov 02 2011 Volker Fröhlich <volker27 at gmx.at> - 6.4.1-5
+* Wed Nov 23 2011 Volker Fröhlich <volker27 at gmx.at> - 6.4.1-5
 - Move string substitution back to the install section, because
   it causes problems otherwise
+- Add patch for libpng API change
 
 * Wed Nov 02 2011 Volker Fröhlich <volker27 at gmx.at> - 6.4.1-4
 - Remove encoding from desktop file


More information about the scm-commits mailing list