[mathmap] fix building with libpng 1.5

Nils Philippsen nphilipp at fedoraproject.org
Fri Dec 16 19:10:55 UTC 2011


commit aca0c0c5b906d106926eefb4c548f73d7a438eaf
Author: Nils Philippsen <nils at redhat.com>
Date:   Fri Dec 16 20:10:47 2011 +0100

    fix building with libpng 1.5

 mathmap-1.3.5-libpng15.patch |   57 ++++++++++++++++++++++++++++++++++++++++++
 mathmap.spec                 |    7 +++-
 2 files changed, 62 insertions(+), 2 deletions(-)
---
diff --git a/mathmap-1.3.5-libpng15.patch b/mathmap-1.3.5-libpng15.patch
new file mode 100644
index 0000000..091ab07
--- /dev/null
+++ b/mathmap-1.3.5-libpng15.patch
@@ -0,0 +1,57 @@
+diff -up mathmap-1.3.5/rwimg/rwpng.c.libpng15 mathmap-1.3.5/rwimg/rwpng.c
+--- mathmap-1.3.5/rwimg/rwpng.c.libpng15	2009-08-23 13:56:14.000000000 +0200
++++ mathmap-1.3.5/rwimg/rwpng.c	2011-12-16 19:08:51.048762219 +0100
+@@ -58,7 +58,7 @@ open_png_file_reading (const char *filen
+     data->end_info = png_create_info_struct(data->png_ptr);
+     assert(data->end_info != 0);
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     png_init_io(data->png_ptr, data->file);
+@@ -105,7 +105,7 @@ png_read_lines (void *_data, unsigned ch
+     int bps, spp;
+     unsigned char *row;
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     if (data->info_ptr->color_type == PNG_COLOR_TYPE_GRAY)
+@@ -151,7 +151,7 @@ png_free_reader_data (void *_data)
+ {
+     png_data_t *data = (png_data_t*)_data;
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     if (data->have_read)
+@@ -180,7 +180,7 @@ open_png_file_writing (const char *filen
+     data->info_ptr = png_create_info_struct(data->png_ptr);
+     assert(data->info_ptr != 0);
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     if (pixel_stride == 4)
+@@ -216,7 +216,7 @@ png_write_lines (void *_data, unsigned c
+     unsigned char *packed_line;
+     int i;
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     if (data->pixel_stride != 3)
+@@ -257,7 +257,7 @@ png_free_writer_data (void *_data)
+ {
+     png_data_t *data = (png_data_t*)_data;
+ 
+-    if (setjmp(data->png_ptr->jmpbuf))
++    if (setjmp(png_get_jmpbuf(data->png_ptr)))
+ 	assert(0);
+ 
+     png_write_end(data->png_ptr, data->info_ptr);
diff --git a/mathmap.spec b/mathmap.spec
index 84b4e92..6cda37f 100644
--- a/mathmap.spec
+++ b/mathmap.spec
@@ -15,6 +15,7 @@ Source:         http://www.complang.tuwien.ac.at/schani/mathmap/files/%{name}-%{
 # libnoise.  Use the system version of libnoise.
 Patch0:         mathmap-system-libnoise.patch
 Patch1:         mathmap-vanilla-libnoise.patch
+Patch2:         mathmap-1.3.5-libpng15.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  libpng-devel
@@ -43,8 +44,9 @@ generate pixels completely independent of the source.
 
 %prep
 %setup -q
-%patch0 -p0
-%patch1 -p1
+%patch0 -p0 -b .system-libnoise
+%patch1 -p1 -b .vanilla-libnoise
+%patch2 -p2 -b .libpng15
 
 %build
 make %{?_smp_mflags}
@@ -73,6 +75,7 @@ rm -rf $RPM_BUILD_ROOT
 %changelog
 * Fri Dec 16 2011 Nils Philippsen <nils at redhat.com> - 1.3.5-4
 - rebuild for GIMP 2.7
+- fix building with libpng 1.5
 
 * Tue Dec 06 2011 Adam Jackson <ajax at redhat.com> - 1.3.5-3
 - Rebuild for new libpng


More information about the scm-commits mailing list