[libicns] Fixed FTBFS for new libpng

musuruan musuruan at fedoraproject.org
Sat Dec 10 10:06:23 UTC 2011


commit d01793dedd97a1dc7bb48fafe1299a3ccef5302e
Author: Andrea Musuruane <musuruan at gmail.com>
Date:   Sat Dec 10 11:06:08 2011 +0100

    Fixed FTBFS for new libpng

 libicns-0.7.1-libpng15.patch |   38 ++++++++++++++++++++++++++++++++++++++
 libicns.spec                 |    9 ++++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/libicns-0.7.1-libpng15.patch b/libicns-0.7.1-libpng15.patch
new file mode 100644
index 0000000..267e703
--- /dev/null
+++ b/libicns-0.7.1-libpng15.patch
@@ -0,0 +1,38 @@
+diff -durN libicns-0.7.1.orig/icnsutils/png2icns.c libicns-0.7.1/icnsutils/png2icns.c
+--- libicns-0.7.1.orig/icnsutils/png2icns.c	2009-05-11 08:17:16.000000000 +0200
++++ libicns-0.7.1/icnsutils/png2icns.c	2011-12-09 12:32:22.191980969 +0100
+@@ -31,6 +31,10 @@
+ #define	FALSE	0
+ #define	TRUE	1
+ 
++#if PNG_LIBPNG_VER > 10400
++#define PNG2ICNS_EXPAND_GRAY	1
++#endif
++
+ static int read_png(FILE *fp, png_bytepp buffer, int32_t *bpp, int32_t *width, int32_t *height)
+ {
+ 	png_structp png_ptr;
+@@ -70,7 +74,11 @@
+ 	switch (color_type)
+ 	{
+ 		case PNG_COLOR_TYPE_GRAY:
++			#ifdef PNG2ICNS_EXPAND_GRAY
++			png_set_expand_gray_1_2_4_to_8(png_ptr);
++			#else
+ 			png_set_gray_1_2_4_to_8(png_ptr);
++			#endif
+ 
+ 			if (bit_depth == 16) {
+ 				png_set_strip_16(png_ptr);
+@@ -82,7 +90,11 @@
+ 			break;
+ 
+ 		case PNG_COLOR_TYPE_GRAY_ALPHA:
++			#ifdef PNG2ICNS_EXPAND_GRAY
++			png_set_expand_gray_1_2_4_to_8(png_ptr);
++			#else
+ 			png_set_gray_1_2_4_to_8(png_ptr);
++			#endif
+ 
+ 			if (bit_depth == 16) {
+ 				png_set_strip_16(png_ptr);
diff --git a/libicns.spec b/libicns.spec
index f77006c..e7c36c7 100644
--- a/libicns.spec
+++ b/libicns.spec
@@ -1,6 +1,6 @@
 Name:           libicns
 Version:        0.7.1
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        Library for manipulating Macintosh icns files
 
 Group:          System Environment/Libraries
@@ -9,6 +9,9 @@ Group:          System Environment/Libraries
 License:        LGPLv2+ and GPLv2+
 URL:            http://icns.sourceforge.net/
 Source0:        http://downloads.sourceforge.net/icns/%{name}-%{version}.tar.gz
+# Fix build with libpng 1.5
+# http://sourceforge.net/tracker/?func=detail&aid=2991016&group_id=174339&atid=868841 
+Patch0:         %{name}-0.7.1-libpng15.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libpng-devel
@@ -43,6 +46,7 @@ icontainer2icns - extract icns files from icontainers
 
 %prep
 %setup -q
+%patch0 -p1
 
 
 %build
@@ -88,6 +92,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Fri Dec 09 2011 ndrea Musuruane <musuruan at gmail.com> - 0.7.1-4
+- Fixed FTBFS for new libpng
+
 * Tue Dec 06 2011 Adam Jackson <ajax at redhat.com> - 0.7.1-3
 - Rebuild for new libpng
 


More information about the scm-commits mailing list