[packages/cinepaint] - updated to 1.3 - added am,configure,link patches (misc build fixes) - added lipng patch (libpng 1.

qboosh qboosh at pld-linux.org
Sun Mar 24 08:55:15 CET 2013


commit cbd6e1833e40a836e96f72cb495c5f22da4353fa
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Mar 24 08:55:11 2013 +0100

    - updated to 1.3
    - added am,configure,link patches (misc build fixes)
    - added lipng patch (libpng 1.5.x support taken from Arch Linux)
    - added paths patch (fix TTF fonts path), use system freefont
    - use GTK+ 2.x by default

 cinepaint-am.patch        |  39 ++++
 cinepaint-configure.patch |  11 ++
 cinepaint-libpng.patch    | 455 ++++++++++++++++++++++++++++++++++++++++++++++
 cinepaint-link.patch      |  12 ++
 cinepaint-paths.patch     |  20 ++
 cinepaint.spec            | 155 +++++++++++-----
 6 files changed, 647 insertions(+), 45 deletions(-)
---
diff --git a/cinepaint.spec b/cinepaint.spec
index 411c4f0..2ad99e6 100644
--- a/cinepaint.spec
+++ b/cinepaint.spec
@@ -3,38 +3,57 @@
 #      - Correct building with --with print
 #
 # Conditional build:
-%bcond_with   print	# build with libgutenprintui
+%bcond_with	print	# build with libgutenprintui
+%bcond_with	gtk1	# GTK+ 1.x instead of 2.x
 
-%define		subrel	1
-%define		rel	2
-%define		ver	0.21
-%define		src	%{ver}-%{rel}
-%define		fsrc	%{ver}-%{rel}-%{subrel}
 Summary:	CinePaint - a motion picture editing tool
 Summary(pl.UTF-8):	CinePaint - narzędzie do obróbki filmów
 Name:		cinepaint
-Version:	%{ver}_%{rel}
+Version:	1.3
 Release:	0.1
-License:	GPL
+License:	GPL v2+ (with LGPL v2.1+ and MIT parts)
 Group:		X11/Applications/Graphics
-Source0:	http://dl.sourceforge.net/cinepaint/%{name}-%{src}.tar.gz
-# Source0-md5:	2cc81ac4ea0f32b4af823e94fa2c7380
-%{?with_print:Patch0:		%{name}-gutenprintui.patch}
+Source0:	http://downloads.sourceforge.net/cinepaint/%{name}-%{version}.tgz
+# Source0-md5:	f8ecd5671662e71a3356213de371fee4
+Patch0:		%{name}-am.patch
+Patch1:		%{name}-configure.patch
+Patch2:		%{name}-libpng.patch
+Patch3:		%{name}-link.patch
+Patch4:		%{name}-paths.patch
 URL:		http://www.cinepaint.org/
-BuildRequires:	OpenEXR-devel
+BuildRequires:	OpenEXR-devel >= 1.0.0
+BuildRequires:	autoconf
 BuildRequires:	automake
+BuildRequires:	flex
 BuildRequires:	fltk-devel
-BuildRequires:	giflib-devel
-BuildRequires:	gtk+-devel
-BuildRequires:	lcms-devel
+BuildRequires:	lcms-devel >= 1.16
 BuildRequires:	libjpeg-devel
-BuildRequires:	libpng-devel
+BuildRequires:	libpng-devel >= 1.0.0
 BuildRequires:	libtiff-devel
+BuildRequires:	libtool
+#BuildRequires:	oyranos-devel
+BuildRequires:	pkgconfig
+BuildRequires:	python-devel
+BuildRequires:	rpmbuild(macros) >= 1.219
+BuildRequires:	xorg-lib-libICE-devel
+BuildRequires:	xorg-lib-libSM-devel
+BuildRequires:	xorg-lib-libXmu-devel
+BuildRequires:	xorg-lib-libXt-devel
 BuildRequires:	zlib-devel
-%{?with_print:BuildRequires:     libgutenprintui-devel}
+%{?with_print:BuildRequires:     libgutenprintui-devel >= 5.0.0}
+%if %{with gtk1}
+BuildRequires:	glib-devel
+BuildRequires:	gtk+-devel >= 1.2.8
+%else
+BuildRequires:	gtk+2-devel >= 2.0.0
+%endif
+# FreeSans.ttf
+Requires:	fonts-TTF-freefont
 Obsoletes:	filmgimp
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
+%define		abiver	1.3.0
+
 %description
 CinePaint is a motion picture editing tool primarily used for painting
 and retouching of movies. CinePaint is the most successful open source
@@ -74,13 +93,23 @@ Static CinePaint libraries.
 Statyczne biblioteki CinePainta.
 
 %prep
-%setup -q -n %{name}-%{src}
-%{?with_print:%patch0 -p1}
+%setup -q -n %{name}
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+# dead symlinks
+%{__rm} config.guess config.sub py-compile
 
 %build
-cp -f /usr/share/automake/config.sub .
+%{__libtoolize}
+%{__aclocal} -I aclocal
+%{__autoconf}
+%{__automake}
 %configure \
-	   %{!?with_print:--disable-print}
+	%{!?with_print:--disable-print}
 
 %{__make}
 
@@ -91,6 +120,13 @@ rm -rf $RPM_BUILD_ROOT
 	DESTDIR=$RPM_BUILD_ROOT \
 	m4datadir=%{_aclocaldir}
 
+%{__rm} $RPM_BUILD_ROOT%{py_sitedir}/gimpmodule.{la,a}
+# provided by fonts-TTF-freefont
+%{__rm} $RPM_BUILD_ROOT%{_fontsdir}/FreeSans.ttf
+
+%py_postclean
+
+# cinepaint,cinepaint-script-fu,cinepaint-std-plugins domains
 %find_lang cinepaint --all-name
 
 %clean
@@ -101,40 +137,69 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -f %{name}.lang
 %defattr(644,root,root,755)
-#%doc AUTHORS ChangeLog NEWS README
-%attr(755,root,root) %{_bindir}/*
-%attr(755,root,root) %{_libdir}/lib*.so.*.*
+# COPYING contains only license notes
+%doc AUTHORS BUGS COPYING ChangeLog NEWS README TODO
+%attr(755,root,root) %{_bindir}/cinepaint
+%attr(755,root,root) %{_bindir}/cinepaint-remote
+%attr(755,root,root) %{_libdir}/libcinepaint.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcinepaint.so.1
+%attr(755,root,root) %{_libdir}/libcinepaintHalf.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcinepaintHalf.so.1
+%attr(755,root,root) %{_libdir}/libcinepaint_fl_i18n.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libcinepaint_fl_i18n.so.1
 %dir %{_libdir}/%{name}
-%dir %{_libdir}/%{name}/%{src}
-%dir %{_libdir}/%{name}/%{src}/plug-ins
-%attr(755,root,root) %{_libdir}/%{name}/%{src}/plug-ins/*
+%dir %{_libdir}/%{name}/%{abiver}
+%dir %{_libdir}/%{name}/%{abiver}/extra
+%attr(755,root,root) %{_libdir}/%{name}/%{abiver}/extra/dcraw
+%attr(755,root,root) %{_libdir}/%{name}/%{abiver}/extra/jhead
+%dir %{_libdir}/%{name}/%{abiver}/plug-ins
+%attr(755,root,root) %{_libdir}/%{name}/%{abiver}/plug-ins/*
 # resource directories
 %dir %{_datadir}/%{name}
-%dir %{_datadir}/%{name}/%{src}
-%{_datadir}/%{name}/%{src}/brushes
-%{_datadir}/%{name}/%{src}/gradients
-%{_datadir}/%{name}/%{src}/palettes
-%{_datadir}/%{name}/%{src}/patterns
-%{_datadir}/%{name}/%{src}/curves
+%dir %{_datadir}/%{name}/%{abiver}
+%{_datadir}/%{name}/%{abiver}/brushes
+%{_datadir}/%{name}/%{abiver}/curves
+%{_datadir}/%{name}/%{abiver}/gradients
+%{_datadir}/%{name}/%{abiver}/iol
+%{_datadir}/%{name}/%{abiver}/palettes
+%{_datadir}/%{name}/%{abiver}/patterns
+%{_datadir}/%{name}/%{abiver}/scripts
 # default rc(?)
-%{_datadir}/%{name}/%{src}/gimprc*
-%{_datadir}/%{name}/%{src}/gtkrc*
-%{_datadir}/%{name}/%{src}/ps-menurc
-%attr(755,root,root) %{_datadir}/%{name}/%{src}/user_install
-# other
-%{_mandir}/man1/*.1*
+%{_datadir}/%{name}/%{abiver}/gimprc
+%{_datadir}/%{name}/%{abiver}/gimprc_user
+%{_datadir}/%{name}/%{abiver}/gtkrc
+%{_datadir}/%{name}/%{abiver}/gtkrc.forest2
+%{_datadir}/%{name}/%{abiver}/printrc_user
+%{_datadir}/%{name}/%{abiver}/ps-menurc
+%{_datadir}/%{name}/%{abiver}/spot.splash.ppm
+%{_datadir}/%{name}/%{abiver}/tips.txt
+%attr(755,root,root) %{_datadir}/%{name}/%{abiver}/user_install
+%attr(755,root,root) %{py_sitedir}/gimpmodule.so
+%{py_sitescriptdir}/gimpenums.py[co]
+%{py_sitescriptdir}/gimpfu.py[co]
+%{py_sitescriptdir}/gimpplugin.py[co]
+%{py_sitescriptdir}/gimpshelf.py[co]
+%{py_sitescriptdir}/gimpui.py[co]
+%{_mandir}/man1/cinepaint.1*
 %{_desktopdir}/cinepaint.desktop
 %{_pixmapsdir}/cinepaint.png
-%{_datadir}/%{name}/%{src}/*.ppm
 
 %files devel
 %defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/lib*.so
-%{_libdir}/lib*.la
-%{_includedir}/cinepaint/*
-%{_aclocaldir}/*.m4
+%attr(755,root,root) %{_bindir}/cinepainttool
+%attr(755,root,root) %{_libdir}/libcinepaint.so
+%attr(755,root,root) %{_libdir}/libcinepaintHalf.so
+%attr(755,root,root) %{_libdir}/libcinepaint_fl_i18n.so
+%{_libdir}/libcinepaint.la
+%{_libdir}/libcinepaintHalf.la
+%{_libdir}/libcinepaint_fl_i18n.la
+%{_includedir}/cinepaint
 %{_pkgconfigdir}/cinepaint-gtk.pc
+%{_aclocaldir}/cinepaint.m4
+%{_mandir}/man1/cinepainttool.1*
 
 %files static
 %defattr(644,root,root,755)
-%{_libdir}/lib*.a
+%{_libdir}/libcinepaint.a
+%{_libdir}/libcinepaintHalf.a
+%{_libdir}/libcinepaint_fl_i18n.a
diff --git a/cinepaint-am.patch b/cinepaint-am.patch
new file mode 100644
index 0000000..a770674
--- /dev/null
+++ b/cinepaint-am.patch
@@ -0,0 +1,39 @@
+--- cinepaint/configure.in.orig	2012-04-07 03:39:53.000000000 +0200
++++ cinepaint/configure.in	2013-03-22 22:29:57.734913770 +0100
+@@ -3,7 +3,7 @@
+ prefix=/usr/bin
+ 
+ AC_INIT(gimprc.in)
+-AM_CONFIG_HEADER(lib/config.h)
++AC_CONFIG_HEADERS(lib/config.h)
+ 
+ dnl Initialize automake stuff
+ dnl $Format: "MAJOR_VERSION=$ReleaseMajorVersion$" $
+@@ -22,7 +22,6 @@
+ AM_SANITY_CHECK
+ 
+ AC_PROG_CC
+-AM_PROG_CC_STDC
+ AC_PROG_CXX
+ AC_PROG_CPP
+ AC_PROG_INSTALL
+--- cinepaint/acinclude.m4.orig	2008-03-02 07:33:59.000000000 +0100
++++ cinepaint/acinclude.m4	2013-03-22 22:34:51.258234783 +0100
+@@ -5,7 +5,7 @@
+ 
+ dnl AM_PROG_LEX
+ dnl Look for flex, lex or missing, then run AC_PROG_LEX and AC_DECL_YYTEXT
+-AC_DEFUN(AM_PROG_LEX,
++AC_DEFUN([AM_PROG_LEX],
+ [missing_dir=ifelse([$1],,`cd $ac_aux_dir && pwd`,$1)
+ AC_CHECK_PROGS(LEX, flex lex, "$missing_dir/missing flex")
+ AC_PROG_LEX
+@@ -26,7 +26,7 @@
+ dnl OpenEXR
+ dnl
+ 
+-AC_DEFUN(AM_PATH_OPENEXR,
++AC_DEFUN([AM_PATH_OPENEXR],
+ [dnl 
+ dnl Get the cflags and libraries
+ dnl
diff --git a/cinepaint-configure.patch b/cinepaint-configure.patch
new file mode 100644
index 0000000..7726395
--- /dev/null
+++ b/cinepaint-configure.patch
@@ -0,0 +1,11 @@
+--- cinepaint/configure.in.orig	2013-03-22 22:35:07.518234103 +0100
++++ cinepaint/configure.in	2013-03-22 22:56:46.378179589 +0100
+@@ -514,7 +514,7 @@
+     fi
+     if test "x$FLTK_CONFIG" != "xno"; then
+       FLTK_CONFIG="$FLTK_CONFIG"
+-        FLTK_LDFLAGS="`$FLTK_CONFIG --use-images --ldflags | sed \"$STRIPOPT\"`"
++        FLTK_LDFLAGS="`$FLTK_CONFIG --use-images --ldflags`"
+         FLTK_LIBS_PURE="`echo $FLTK_LDFLAGS | sed  's/-O.// ; s/-isysroot /-L/ ; s/-arch ppc// ; s/-arch i386//'`"
+         FLTK_LIBS="\$(top_builddir)/lib/fl_i18n/libcinepaint_fl_i18n.la $FLTK_LIBS_PURE"
+         FLTK_CFLAGS=`$FLTK_CONFIG --cxxflags | sed  's/-O.// ; s/-isysroot /-L/ ; s/-arch ppc// ; s/-arch i386//'`
diff --git a/cinepaint-libpng.patch b/cinepaint-libpng.patch
new file mode 100644
index 0000000..0bdcf6d
--- /dev/null
+++ b/cinepaint-libpng.patch
@@ -0,0 +1,455 @@
+diff -Naur cinepaint1/plug-ins/png/png.c cinepaint/plug-ins/png/png.c
+--- cinepaint1/plug-ins/png/png.c	2006-11-24 21:52:55.000000000 +0100
++++ cinepaint/plug-ins/png/png.c	2012-02-04 01:51:10.141016081 +0100
+@@ -390,7 +390,16 @@
+   gchar		*progress;	/* Title for progress display... */
+   guchar	alpha[256],	/* Index -> Alpha */
+   		*alpha_ptr;	/* Temporary pointer */
+-
++  png_byte     color_type;
++  png_byte     bit_depth;
++  png_colorp palette;
++  int num_palette;
++  png_charpp iccp_name;
++  int compression_type;
++  png_bytepp iccp_profile;
++  png_uint_32 iccp_proflen;
++  png_uint_32 width, height;
++  png_byte channels;
+  /*
+   * PNG 0.89 and newer have a sane, forwards compatible constructor.
+   * Some SGI IRIX users will not have a new enough version though
+@@ -405,7 +414,7 @@
+   info = (png_infop)calloc(sizeof(png_info), 1);
+ #endif /* PNG_LIBPNG_VER > 88 */
+ 
+-  if (setjmp (pp->jmpbuf))
++  if (setjmp (png_jmpbuf(pp)))
+   {
+     g_message ("%s\nPNG error. File corrupted?", filename);
+     return image;
+@@ -442,21 +451,23 @@
+   */
+ 
+   png_read_info(pp, info);
+-
++  color_type = png_get_color_type(pp, info);
++  width=png_get_image_width(pp, info);
++  height=png_get_image_height(pp, info);
+  /*
+   * Latest attempt, this should be my best yet :)
+   */
+-
++  bit_depth = png_get_bit_depth(pp, info);
+ #ifndef WORDS_BIGENDIAN
+-  if(info->bit_depth == 16)
+-	  png_set_swap(pp);
++  if(bit_depth == 16)
++    png_set_swap(pp);
+ #endif
+ 
+-  if (info->color_type == PNG_COLOR_TYPE_GRAY && info->bit_depth < 8) {
++  if (color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
+     png_set_expand(pp);
+   }
+ 
+-  if (info->color_type == PNG_COLOR_TYPE_PALETTE && info->bit_depth < 8) {
++  if (color_type == PNG_COLOR_TYPE_PALETTE && bit_depth < 8) {
+     png_set_packing(pp);
+   }
+ 
+@@ -464,8 +475,8 @@
+   * Expand G+tRNS to GA, RGB+tRNS to RGBA
+   */
+ 
+-  if (info->color_type != PNG_COLOR_TYPE_PALETTE &&
+-                       (info->valid & PNG_INFO_tRNS)) {
++  if (color_type != PNG_COLOR_TYPE_PALETTE &&
++      (png_get_valid(pp, info, PNG_INFO_tRNS))) {
+     png_set_expand(pp);
+   }
+ 
+@@ -482,7 +493,7 @@
+ 
+ #if PNG_LIBPNG_VER > 99
+   if (png_get_valid(pp, info, PNG_INFO_tRNS) &&
+-      info->color_type == PNG_COLOR_TYPE_PALETTE)
++      color_type == PNG_COLOR_TYPE_PALETTE)
+   {
+     png_get_tRNS(pp, info, &alpha_ptr, &num, NULL);
+     /* Copy the existing alpha values from the tRNS chunk */
+@@ -505,12 +516,12 @@
+ 
+   png_read_update_info(pp, info);
+   
+-  if(info->bit_depth==16)
++  if(bit_depth==16)
+   {
+-	  switch (info->color_type)
++	  switch (color_type)
+ 	  {
+ 		  case PNG_COLOR_TYPE_RGB :		/* RGB */
+-			  bpp        = 6;
++                          bpp        = 6;
+ 			  image_type = U16_RGB;
+ 			  layer_type = U16_RGB_IMAGE;
+ 			  break;
+@@ -545,10 +556,10 @@
+   }
+   else
+   {
+-	  switch (info->color_type)
++	  switch (color_type)
+ 	  {
+ 		  case PNG_COLOR_TYPE_RGB :		/* RGB */
+-			  bpp        = 3;
++                          bpp        = 3;
+ 			  image_type = RGB;
+ 			  layer_type = RGB_IMAGE;
+ 			  break;
+@@ -582,7 +593,7 @@
+ 	  };
+   }
+ 
+-  image = gimp_image_new(info->width, info->height, image_type);
++  image = gimp_image_new(width, height, image_type);
+   if (image == -1)
+   {
+     g_message("Can&#x27;t allocate new image\n%s", filename);
+@@ -595,7 +606,7 @@
+   * Create the "background" layer to hold the image...
+   */
+ 
+-  layer = gimp_layer_new(image, _("Background"), info->width, info->height,
++  layer = gimp_layer_new(image, _("Background"), width, height,
+                          layer_type, 100, NORMAL_MODE);
+   gimp_image_add_layer(image, layer, 0);
+ 
+@@ -627,20 +638,21 @@
+ 
+   empty= 0; /* by default assume no full transparent palette entries */
+ 
+-  if (info->color_type & PNG_COLOR_MASK_PALETTE) {
++  if (color_type & PNG_COLOR_MASK_PALETTE) {
+ 
+ #if PNG_LIBPNG_VER > 99
++    png_get_PLTE(pp, info, &palette, &num_palette);
+     if (png_get_valid(pp, info, PNG_INFO_tRNS)) {
+       for (empty= 0; empty < 256 && alpha[empty] == 0; ++empty);
+         /* Calculates number of fully transparent "empty" entries */
+ 
+-      gimp_image_set_cmap(image, (guchar *) (info->palette + empty),
+-                          info->num_palette - empty);
++      gimp_image_set_cmap(image, (guchar *) (palette + empty),
++                          num_palette - empty);
+     } else {
+-      gimp_image_set_cmap(image, (guchar *)info->palette, info->num_palette);
++      gimp_image_set_cmap(image, (guchar *)palette, num_palette);
+     }
+ #else
+-    gimp_image_set_cmap(image, (guchar *)info->palette, info->num_palette);
++    gimp_image_set_cmap(image, (guchar *)palette, num_palette);
+ #endif /* PNG_LIBPNG_VER > 99 */
+ 
+   }
+@@ -659,18 +671,19 @@
+   */
+ 
+   tile_height = gimp_tile_height ();
+-  pixel       = g_new(guchar, tile_height * info->width * bpp);
++  pixel       = g_new(guchar, tile_height * width * bpp);
+   pixels      = g_new(guchar *, tile_height);
++  channels=png_get_channels(pp, info);
+ 
+-  if(info->bit_depth==16)
++  if(bit_depth==16)
+   {
+ 	  for (i = 0; i < tile_height; i ++)
+-		  pixels[i] = pixel + info->width * info->channels * i * 2;
++		  pixels[i] = pixel + width * channels * i * 2;
+   }
+   else
+   {
+ 	  for (i = 0; i < tile_height; i ++)
+-		  pixels[i] = pixel + info->width * info->channels * i;
++		  pixels[i] = pixel + width * channels * i;
+   }
+ 
+   for (pass = 0; pass < num_passes; pass ++)
+@@ -680,11 +693,11 @@
+ 	   */
+ 
+ 	  for (begin = 0, end = tile_height;
+-			  begin < info->height;
++			  begin < height;
+ 			  begin += tile_height, end += tile_height)
+ 	  {
+-		  if (end > info->height)
+-			  end = info->height;
++		  if (end > height)
++			  end = height;
+ 
+ 		  num = end - begin;
+ 
+@@ -697,20 +710,21 @@
+ 		  gimp_pixel_rgn_set_rect(&pixel_rgn, pixel, 0, begin,
+ 				  drawable->width, num);
+ 
+-		  gimp_progress_update(((double)pass + (double)end / (double)info->height) /
++		  gimp_progress_update(((double)pass + (double)end / (double)height) /
+ 				  (double)num_passes);
+ 	  };
+   };
+ 
+ #if defined(PNG_iCCP_SUPPORTED)
+   /* set icc profile */
+-  if (info->iccp_proflen > 0) {
+-    gimp_image_set_icc_profile_by_mem (image, info->iccp_proflen,
+-                                              info->iccp_profile,
+-                                              ICC_IMAGE_PROFILE);
++  png_get_iCCP(pp, info,  (png_charpp)iccp_name, &compression_type, iccp_profile, &iccp_proflen);
++  if (iccp_proflen > 0) {
++    gimp_image_set_icc_profile_by_mem (image, iccp_proflen,
++				       (gchar *)iccp_profile,
++				       ICC_IMAGE_PROFILE);
+     printf ("%s:%d %s() set embedded profile \"%s\"\n",
+              __FILE__,__LINE__,__func__,
+-                                              info->iccp_name);
++	    (char *)iccp_name);
+   }
+ #endif
+ 
+@@ -809,6 +823,15 @@
+   time_t	cutime;         /* Time since epoch */
+   struct tm	*gmt;		/* GMT broken down */
+ 
++  png_byte     color_type;
++  png_byte     bit_depth;
++  int filter_method=0;
++  png_colorp palette;
++  int num_palette;
++  png_charpp iccp_name;
++  png_uint_32 height;
++  int compression_type;
++
+  /*
+   * PNG 0.89 and newer have a sane, forwards compatible constructor.
+   * Some SGI IRIX users will not have a new enough version though
+@@ -824,7 +847,7 @@
+   info = (png_infop)calloc(sizeof(png_info), 1);
+ #endif /* PNG_LIBPNG_VER > 88 */
+ 
+-  if (setjmp (pp->jmpbuf))
++  if (setjmp (png_jmpbuf(pp)))
+   {
+     g_message ("%s\nPNG error. Couldn&#x27;t save image", filename);
+     return 0;
+@@ -858,87 +881,75 @@
+   type     = gimp_drawable_type (drawable_ID);
+ 
+  /*
+-  * Set the image dimensions, bit depth, interlacing and compression
+-  */
+-
+-  png_set_compression_level (pp, pngvals.compression_level);
+-
+-  info->width          = drawable->width;
+-  info->height         = drawable->height;
+-  info->interlace_type = pngvals.interlaced;
+-
+- /*
+   * Set color type and remember bytes per pixel count 
+   */
+ 
+   switch (type)
+   {
+     case RGB_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_RGB;
+-	info->bit_depth      = 8;
++        color_type = PNG_COLOR_TYPE_RGB;
++	bit_depth      = 8;
+         bpp              = 3;
+         break;
+     case RGBA_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+-	info->bit_depth      = 8;
++        color_type = PNG_COLOR_TYPE_RGB_ALPHA;
++	bit_depth      = 8;
+         bpp              = 4;
+         break;
+     case GRAY_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_GRAY;
+-	info->bit_depth      = 8;
++        color_type = PNG_COLOR_TYPE_GRAY;
++	bit_depth      = 8;
+         bpp              = 1;
+         break;
+     case GRAYA_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
+-	info->bit_depth      = 8;
++        color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
++	bit_depth      = 8;
+         bpp              = 2;
+         break;
+     case INDEXED_IMAGE :
+ 	bpp		 = 1;
+-	info->bit_depth      = 8;
+-        info->color_type = PNG_COLOR_TYPE_PALETTE;
+-	info->valid      |= PNG_INFO_PLTE;
+-        info->palette= (png_colorp) gimp_image_get_cmap(image_ID, &num_colors);
+-        info->num_palette= num_colors;
++	bit_depth      = 8;
++        color_type = PNG_COLOR_TYPE_PALETTE;
++	png_get_valid(pp, info, PNG_INFO_PLTE);
++	png_set_PLTE(pp, info, (png_colorp) gimp_image_get_cmap(image_ID, &num_colors), num_colors);
+         break;
+     case INDEXEDA_IMAGE :
+ 	bpp		 = 2;
+-	info->bit_depth      = 8;
+-	info->color_type = PNG_COLOR_TYPE_PALETTE;
++	bit_depth      = 8;
++	color_type = PNG_COLOR_TYPE_PALETTE;
+ 	respin_cmap (pp, info, image_ID); /* fix up transparency */
+ 	break;
+     case U16_RGB_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_RGB;
+-	info->bit_depth      = 16;
++        color_type = PNG_COLOR_TYPE_RGB;
++	bit_depth      = 16;
+         bpp              = 6;
+         break;
+     case U16_RGBA_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_RGB_ALPHA;
+-	info->bit_depth      = 16;
++        color_type = PNG_COLOR_TYPE_RGB_ALPHA;
++	bit_depth      = 16;
+         bpp              = 8;
+         break;
+     case U16_GRAY_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_GRAY;
+-	info->bit_depth      = 16;
++        color_type = PNG_COLOR_TYPE_GRAY;
++	bit_depth      = 16;
+         bpp              = 2;
+         break;
+     case U16_GRAYA_IMAGE :
+-        info->color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
+-	info->bit_depth      = 16;
++        color_type = PNG_COLOR_TYPE_GRAY_ALPHA;
++	bit_depth      = 16;
+         bpp              = 4;
+         break;
+     case U16_INDEXED_IMAGE :
+ 	bpp		 = 2;
+-	info->bit_depth      = 16;
+-        info->color_type = PNG_COLOR_TYPE_PALETTE;
+-	info->valid      |= PNG_INFO_PLTE;
+-        info->palette= (png_colorp) gimp_image_get_cmap(image_ID, &num_colors);
+-        info->num_palette= num_colors;
++	bit_depth      = 16;
++        color_type = PNG_COLOR_TYPE_PALETTE;
++	png_get_valid(pp, info, PNG_INFO_PLTE);
++	png_set_PLTE(pp, info, (png_colorp) gimp_image_get_cmap(image_ID, &num_colors), num_colors);
+         break;
+     case U16_INDEXEDA_IMAGE :
+ 	bpp		 = 4;
+-	info->bit_depth      = 16;
+-	info->color_type = PNG_COLOR_TYPE_PALETTE;
++	bit_depth      = 16;
++	color_type = PNG_COLOR_TYPE_PALETTE;
+ 	respin_cmap (pp, info, image_ID); /* fix up transparency */
+ 	break;
+     default:
+@@ -950,16 +961,21 @@
+   * Fix bit depths for (possibly) smaller colormap images
+   */
+   
+-  if (info->valid & PNG_INFO_PLTE) {
+-    if (info->num_palette <= 2)
+-      info->bit_depth= 1;
+-    else if (info->num_palette <= 4)
+-      info->bit_depth= 2;
+-    else if (info->num_palette <= 16)
+-      info->bit_depth= 4;
++  if (png_get_valid(pp, info, PNG_INFO_PLTE)) {
++    png_get_PLTE(pp, info, &palette, &num_palette);
++    if (num_palette <= 2)
++      bit_depth= 1;
++    else if (num_palette <= 4)
++      bit_depth= 2;
++    else if (num_palette <= 16)
++      bit_depth= 4;
+     /* otherwise the default is fine */
+   }
+ 
++ png_set_compression_level (pp, pngvals.compression_level);
++ png_set_IHDR(pp, info, drawable->width, drawable->height,
++	      bit_depth, color_type, pngvals.interlaced, compression_type, filter_method);
++
+   // write icc profile
+ #if defined(PNG_iCCP_SUPPORTED)
+   if (gimp_image_has_icc_profile (image_ID, ICC_IMAGE_PROFILE)) {
+@@ -970,10 +986,10 @@
+                                                 ICC_IMAGE_PROFILE);
+     png_set_iCCP (pp, info,
+            gimp_image_get_icc_profile_description (image_ID, ICC_IMAGE_PROFILE),
+-                  0, buffer, size);
++                  0, (png_const_bytep)buffer, size);
+     printf ("%s:%d %s() embedd icc profile \"%s\"\n",
+              __FILE__,__LINE__,__func__,
+-                                              info->iccp_name);
++	    (char *)iccp_name);
+   }
+ #endif
+ 
+@@ -1039,13 +1055,13 @@
+   * Convert unpacked pixels to packed if necessary
+   */
+ 
+-  if (info->color_type == PNG_COLOR_TYPE_PALETTE && info->bit_depth < 8)
++  if (color_type == PNG_COLOR_TYPE_PALETTE && bit_depth < 8)
+     png_set_packing(pp);
+ 
+   /* Set swapping for 16 bit per sample images */
+   
+ #ifndef WORDS_BIGENDIAN
+-  if (info->bit_depth == 16)
++  if (bit_depth == 16)
+ 	  png_set_swap(pp);
+ #endif
+   
+@@ -1063,6 +1079,7 @@
+ 
+   gimp_pixel_rgn_init(&pixel_rgn, drawable, 0, 0, drawable->width,
+                       drawable->height, FALSE, FALSE);
++  height=png_get_image_height(pp, info);
+ 
+   for (pass = 0; pass < num_passes; pass ++)
+   {
+@@ -1077,7 +1094,7 @@
+ 	num = end - begin;
+ 	
+ 	gimp_pixel_rgn_get_rect (&pixel_rgn, pixel, 0, begin, drawable->width, num);
+-        if (info->valid & PNG_INFO_tRNS) {
++        if (png_get_valid(pp, info, PNG_INFO_tRNS)) {
+           for (i = 0; i < num; ++i) {
+ 	    fixed= pixels[i];
+             for (k = 0; k < drawable->width; ++k) {
+@@ -1085,7 +1102,7 @@
+             }
+           }
+        /* Forgot this case before, what if there are too many colors? */
+-        } else if (info->valid & PNG_INFO_PLTE && bpp == 2) {
++        } else if (png_get_valid(pp, info, PNG_INFO_PLTE) && bpp == 2) {
+           for (i = 0; i < num; ++i) {
+ 	    fixed= pixels[i];
+             for (k = 0; k < drawable->width; ++k) {
+@@ -1097,7 +1114,7 @@
+ 	png_write_rows (pp, pixels, num);
+ 	
+ 	gimp_progress_update (((double)pass + (double)end /
+-                    (double)info->height) / (double)num_passes);
++                    (double)height) / (double)num_passes);
+       };
+   };
+ 
diff --git a/cinepaint-link.patch b/cinepaint-link.patch
new file mode 100644
index 0000000..c8daeb6
--- /dev/null
+++ b/cinepaint-link.patch
@@ -0,0 +1,12 @@
+--- cinepaint/lib/Makefile.am.orig	2007-10-25 12:17:36.000000000 +0200
++++ cinepaint/lib/Makefile.am	2013-03-23 21:27:13.098112559 +0100
+@@ -18,7 +18,8 @@
+ 
+ libcinepaint_la_LIBADD = \
+ 	./wire/libwire.la \
+-	$(top_builddir)/libhalf/libcinepaintHalf.la
++	$(top_builddir)/libhalf/libcinepaintHalf.la \
++	$(GTK_LIBS) -lm
+ 
+ libcinepaint_la_SOURCES = \
+ 	chain.xpm \
diff --git a/cinepaint-paths.patch b/cinepaint-paths.patch
new file mode 100644
index 0000000..4c599b8
--- /dev/null
+++ b/cinepaint-paths.patch
@@ -0,0 +1,20 @@
+--- cinepaint/plug-ins/icc_examin/icc_examin/icc_gl.cpp.orig	2008-08-22 20:11:18.000000000 +0200
++++ cinepaint/plug-ins/icc_examin/icc_examin/icc_gl.cpp	2013-03-24 07:44:09.889892447 +0100
+@@ -697,7 +697,7 @@
+   if(font) delete font;
+   if(ortho_font) delete ortho_font;
+ 
+-  const char* font_name = "/usr/X11R6/lib/X11/fonts/truetype/FreeSans.ttf";
++  const char* font_name = "/usr/share/fonts/TTF/FreeSans.ttf";
+ # if APPLE
+   std::string f_n;
+   if(getenv("RESOURCESPATH"))
+@@ -714,7 +714,7 @@
+ # endif
+   if(!holeDateiModifikationsZeit(font_name)) {
+     DBG_S( _("Could not open font in:") << font_name )
+-    font_name = "/usr/X11R6/lib/X11/fonts/truetype/arial.ttf";
++    font_name = "/usr/share/fonts/TTF/arial.ttf";
+     if(!holeDateiModifikationsZeit(font_name)) {
+       DBG_S( _("Could not open font in:") << font_name )
+ #ifdef  WIN32
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/cinepaint.git/commitdiff/cbd6e1833e40a836e96f72cb495c5f22da4353fa



More information about the pld-cvs-commit mailing list