diff --git a/xfig.3.2.5b-libpng14.dif b/xfig.3.2.5b-libpng14.dif new file mode 100644 index 0000000..08e0625 --- /dev/null +++ b/xfig.3.2.5b-libpng14.dif @@ -0,0 +1,14 @@ +--- f_readpng.c ++++ f_readpng.c 2010-04-20 15:45:02.627072958 +0000 +@@ -136,7 +136,11 @@ read_png(FILE *file, int filetype, F_pic + + if (png_get_PLTE(png_ptr, info_ptr, &palette, &num_palette)) { + png_get_hIST(png_ptr, info_ptr, &histogram); ++#if (PNG_LIBPNG_VER_MAJOR > 1 || (PNG_LIBPNG_VER_MAJOR == 1 && (PNG_LIBPNG_VER_MINOR > 4))) || defined(png_set_quantize) ++ png_set_quantize(png_ptr, palette, num_palette, 256, histogram, 0); ++#else + png_set_dither(png_ptr, palette, num_palette, 256, histogram, 0); ++#endif + } + } + if (color_type == PNG_COLOR_TYPE_GRAY || color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { diff --git a/xfig.changes b/xfig.changes index 865799d..54f8ce7 100644 --- a/xfig.changes +++ b/xfig.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Apr 20 17:24:01 CEST 2010 - werner@suse.de + +- Add compatibility switch for libpng 1.4 or higher + ------------------------------------------------------------------- Mon Apr 19 11:29:36 CEST 2010 - sndirsch@suse.de diff --git a/xfig.spec b/xfig.spec index 2eea191..56453d6 100644 --- a/xfig.spec +++ b/xfig.spec @@ -47,6 +47,7 @@ Patch5: xfig.3.2.5b-null.dif Patch6: xfig.3.2.5b-locale.dif Patch7: xfig.3.2.5b-fixes.dif Patch8: xfig.3.2.5b-pspdftex.dif +Patch9: xfig.3.2.5b-libpng14.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %{expand: %%global _exec_prefix %(type -p pkg-config &>/dev/null && pkg-config --variable prefix x11 || echo /usr/X11R6)} %if "%_exec_prefix" == "/usr/X11R6" @@ -92,6 +93,7 @@ find -type f | xargs -r chmod a-x,go-w %patch6 -p0 -b .locale %patch7 -p0 -b .fixes %patch8 -p0 -b .pspdftex +%patch9 -p0 -b .libpng14 cp %{S:1} . %build