diff --git a/flam3-libpng15.patch b/flam3-libpng15.patch new file mode 100644 index 0000000..fd7a508 --- /dev/null +++ b/flam3-libpng15.patch @@ -0,0 +1,74 @@ +--- src/png.orig 2012-02-26 22:08:57.090323044 -0600 ++++ src/png.c 2012-02-26 22:23:29.920255239 -0600 +@@ -142,7 +142,7 @@ + } + if (setjmp(png_jmpbuf(png_ptr))) { + if (png_image) { +- for (y = 0 ; y < info_ptr->height ; y++) ++ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++) + free (png_image[y]); + free (png_image); + } +@@ -161,19 +161,19 @@ + png_set_sig_bytes (png_ptr, SIG_CHECK_SIZE); + png_read_info (png_ptr, info_ptr); + +- if (8 != info_ptr->bit_depth) { ++ if (8 != png_get_bit_depth(png_ptr, info_ptr)) { + fprintf(stderr, "bit depth type must be 8, not %d.\n", +- info_ptr->bit_depth); ++ png_get_bit_depth(png_ptr, info_ptr)); + return 0; + } + +- *width = info_ptr->width; +- *height = info_ptr->height; ++ *width = png_get_image_width(png_ptr, info_ptr); ++ *height = png_get_image_height(png_ptr, info_ptr); + p = q = malloc(4 * *width * *height); +- png_image = (png_byte **)malloc (info_ptr->height * sizeof (png_byte*)); ++ png_image = (png_byte **)malloc (png_get_image_height(png_ptr, info_ptr) * sizeof (png_byte*)); + +- linesize = info_ptr->width; +- switch (info_ptr->color_type) { ++ linesize = png_get_image_width(png_ptr, info_ptr); ++ switch (png_get_color_type(png_ptr, info_ptr)) { + case PNG_COLOR_TYPE_RGB: + linesize *= 3; + break; +@@ -182,21 +182,21 @@ + break; + default: + fprintf(stderr, "color type must be RGB or RGBA not %d.\n", +- info_ptr->color_type); ++ png_get_color_type(png_ptr, info_ptr)); + return 0; + } + +- for (y = 0 ; y < info_ptr->height ; y++) { ++ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++) { + png_image[y] = malloc (linesize); + } + png_read_image (png_ptr, png_image); + png_read_end (png_ptr, info_ptr); + +- for (y = 0 ; y < info_ptr->height ; y++) { ++ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++) { + unsigned char *s = png_image[y]; +- for (x = 0 ; x < info_ptr->width ; x++) { ++ for (x = 0 ; x < png_get_image_width(png_ptr, info_ptr) ; x++) { + +- switch (info_ptr->color_type) { ++ switch (png_get_color_type(png_ptr, info_ptr)) { + case PNG_COLOR_TYPE_RGB: + p[0] = s[0]; + p[1] = s[1]; +@@ -217,7 +217,7 @@ + } + } + +- for (y = 0 ; y < info_ptr->height ; y++) ++ for (y = 0 ; y < png_get_image_height(png_ptr, info_ptr) ; y++) + free (png_image[y]); + free (png_image); + png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); diff --git a/flam3.spec b/flam3.spec index c358041..d0c8af6 100644 --- a/flam3.spec +++ b/flam3.spec @@ -1,12 +1,13 @@ Name: flam3 Version: 3.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: Programs to generate and render cosmic recursive fractal flames Group: Applications/Multimedia License: GPLv2+ URL: http://www.flam3.com/ Source0: http://flam3.googlecode.com/files/%{name}-%{version}.tar.gz +Patch0: flam3-libpng15.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: libxml2-devel @@ -40,6 +41,7 @@ package contains a header file for C, a library, and a pkgconfig file. %prep %setup -qn %{name}-%{version}/src +%patch0 -p0 -b .libpng15 %build @@ -82,6 +84,9 @@ rm -rf %{buildroot} %changelog +* Sun Feb 26 2012 Bruno Wolff III - 3.0.1-3 +- Fix building with libpng 1.5 + * Thu Jan 26 2012 Ian Weller - 3.0.1-2 - Forgot to upload the new source