From 4b422ea44cd4d159f1b543d44c09399c10873585 Mon Sep 17 00:00:00 2001 From: Tom Callaway Date: Feb 27 2012 21:16:00 +0000 Subject: fix build against modern glib, libpng --- diff --git a/abiword-2.8.6-glib-header-fix.patch b/abiword-2.8.6-glib-header-fix.patch new file mode 100644 index 0000000..f8255e0 --- /dev/null +++ b/abiword-2.8.6-glib-header-fix.patch @@ -0,0 +1,35 @@ +diff -up abiword-2.8.6/goffice-bits/goffice/app/go-cmd-context.c.glibfix abiword-2.8.6/goffice-bits/goffice/app/go-cmd-context.c +--- abiword-2.8.6/goffice-bits/goffice/app/go-cmd-context.c.glibfix 2012-02-27 15:04:45.744812212 -0500 ++++ abiword-2.8.6/goffice-bits/goffice/app/go-cmd-context.c 2012-02-27 15:05:51.628239624 -0500 +@@ -10,7 +10,7 @@ + #include "go-cmd-context-impl.h" + #include + #include +-#include ++#include + + #define GCC_CLASS(o) (G_TYPE_INSTANCE_GET_INTERFACE ((o), GO_CMD_CONTEXT_TYPE, GOCmdContextClass)) + +diff -up abiword-2.8.6/goffice-bits/goffice/app/goffice-app.h.glibfix abiword-2.8.6/goffice-bits/goffice/app/goffice-app.h +--- abiword-2.8.6/goffice-bits/goffice/app/goffice-app.h.glibfix 2012-02-27 15:06:06.157113352 -0500 ++++ abiword-2.8.6/goffice-bits/goffice/app/goffice-app.h 2012-02-27 15:06:11.037070941 -0500 +@@ -22,7 +22,7 @@ + #ifndef GOFFICE_APP_H + #define GOFFICE_APP_H + +-#include ++#include + + G_BEGIN_DECLS + +diff -up abiword-2.8.6/src/af/util/xp/ut_go_file.h.glibfix abiword-2.8.6/src/af/util/xp/ut_go_file.h +--- abiword-2.8.6/src/af/util/xp/ut_go_file.h.glibfix 2012-02-27 15:07:23.222443598 -0500 ++++ abiword-2.8.6/src/af/util/xp/ut_go_file.h 2012-02-27 15:07:26.708413289 -0500 +@@ -31,7 +31,6 @@ + + #include + #include +-#include + #include + + G_BEGIN_DECLS diff --git a/abiword-2.8.6-png15.patch b/abiword-2.8.6-png15.patch new file mode 100644 index 0000000..9ec6ea3 --- /dev/null +++ b/abiword-2.8.6-png15.patch @@ -0,0 +1,111 @@ +diff -up abiword-2.8.6/plugins/bmp/xp/ie_impGraphic_BMP.cpp.png15 abiword-2.8.6/plugins/bmp/xp/ie_impGraphic_BMP.cpp +--- abiword-2.8.6/plugins/bmp/xp/ie_impGraphic_BMP.cpp.png15 2012-02-27 15:39:39.258617605 -0500 ++++ abiword-2.8.6/plugins/bmp/xp/ie_impGraphic_BMP.cpp 2012-02-27 15:48:37.830936901 -0500 +@@ -191,7 +191,14 @@ UT_Error IE_ImpGraphic_BMP::_convertGrap + + /* Clean Up Memory Used */ + ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ int num_palette; ++ png_colorp palette; ++ png_get_PLTE(m_pPNG, m_pPNGInfo, &palette, &num_palette); ++ FREEP(palette); ++#else + FREEP(m_pPNGInfo->palette); ++#endif + DELETEP(pBB); + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + +@@ -313,7 +320,11 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(m_pPNG))) ++#else + if (setjmp(m_pPNG->jmpbuf)) ++#endif + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -332,7 +343,11 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P + UT_Error IE_ImpGraphic_BMP::Convert_BMP_Pallet(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(m_pPNG))) ++#else + if (setjmp(m_pPNG->jmpbuf)) ++#endif + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; +@@ -372,7 +387,11 @@ UT_Error IE_ImpGraphic_BMP::Initialize_P + UT_Error IE_ImpGraphic_BMP::Convert_BMP(UT_ByteBuf* pBB) + { + /* Reset error handling for libpng */ ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(m_pPNG))) ++#else + if (setjmp(m_pPNG->jmpbuf)) ++#endif + { + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); + return UT_ERROR; +diff -up abiword-2.8.6/plugins/garble/xp/abiword-garble-png.cpp.png15 abiword-2.8.6/plugins/garble/xp/abiword-garble-png.cpp +--- abiword-2.8.6/plugins/garble/xp/abiword-garble-png.cpp.png15 2012-02-27 15:31:30.178868169 -0500 ++++ abiword-2.8.6/plugins/garble/xp/abiword-garble-png.cpp 2012-02-27 15:36:17.795368497 -0500 +@@ -79,7 +79,11 @@ bool abiword_document::garble_png( void* + png_set_strip_alpha( png_ptr ); + png_set_interlace_handling( png_ptr ); + png_set_bgr( png_ptr ); ++#if (PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4) && defined(PNG_EASY_ACCESS_SUPPORTED) ++ rowbytes = png_get_rowbytes( png_ptr, info_ptr ); ++#else + rowbytes = info_ptr->rowbytes; ++#endif + png_destroy_read_struct( &png_ptr, &info_ptr, NULL ); + } + +diff -up abiword-2.8.6/src/af/util/xp/ut_png.cpp.png15 abiword-2.8.6/src/af/util/xp/ut_png.cpp +--- abiword-2.8.6/src/af/util/xp/ut_png.cpp.png15 2012-02-27 15:11:18.599397989 -0500 ++++ abiword-2.8.6/src/af/util/xp/ut_png.cpp 2012-02-27 15:12:20.560859433 -0500 +@@ -71,7 +71,11 @@ bool UT_PNG_getDimensions(const UT_ByteB + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(png_ptr))) ++#else + if (setjmp(png_ptr->jmpbuf)) ++#endif + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_read_struct(&png_ptr, &info_ptr, static_cast(NULL)); +diff -up abiword-2.8.6/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp.png15 abiword-2.8.6/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp +--- abiword-2.8.6/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp.png15 2012-02-27 15:24:23.959572417 -0500 ++++ abiword-2.8.6/src/wp/impexp/gtk/ie_impGraphic_GdkPixbuf.cpp 2012-02-27 15:26:42.549367943 -0500 +@@ -185,7 +185,11 @@ UT_Error IE_ImpGraphic_GdkPixbuf::import + /** needed for the stejmp context */ + UT_Error IE_ImpGraphic_GdkPixbuf::_png_write(GdkPixbuf * pixbuf) + { ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(m_pPNG))) ++#else + if (setjmp(m_pPNG->jmpbuf)) ++#endif + { + DELETEP(m_pPngBB); + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); +@@ -446,7 +450,11 @@ UT_Error IE_ImpGraphic_GdkPixbuf::Initia + * the normal method of doing things with libpng). REQUIRED unless you + * set up your own error handlers in the png_create_read_struct() earlier. + */ ++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4 ++ if (setjmp(png_jmpbuf(m_pPNG))) ++#else + if (setjmp(m_pPNG->jmpbuf)) ++#endif + { + /* Free all of the memory associated with the png_ptr and info_ptr */ + png_destroy_write_struct(&m_pPNG, &m_pPNGInfo); diff --git a/abiword.spec b/abiword.spec index 73295c0..d7a3c88 100644 --- a/abiword.spec +++ b/abiword.spec @@ -5,7 +5,7 @@ Summary: The AbiWord word processor Name: abiword Version: %{majorversion}.%{minorversion}.%{microversion} -Release: 16%{?dist} +Release: 17%{?dist} Epoch: 1 Group: Applications/Editors License: GPLv2+ @@ -30,6 +30,8 @@ Patch2: abiword-2.6.0-boolean.patch Patch3: abiword-plugins-2.6.0-boolean.patch Patch103: abiword-2.8.6-libwpd.patch Patch104: abiword-2.8.6-no-undefined.patch +Patch105: abiword-2.8.6-glib-header-fix.patch +Patch106: abiword-2.8.6-png15.patch BuildRequires: autoconf, libtool BuildRequires: desktop-file-utils @@ -75,6 +77,8 @@ Includes and definitions for developing with libabiword. %endif %patch103 -p0 -b .libwpd %patch104 -p1 -b .no-undefined +%patch105 -p1 -b .glibfix +%patch106 -p1 -b .png15 # patch abiword plugins #%patch3 -p1 -b .boolean @@ -167,6 +171,9 @@ update-desktop-database %{_datadir}/applications > /dev/null 2>&1 || : %{_libdir}/pkgconfig/%{name}-%{majorversion}.%{minorversion}.pc %changelog +* Mon Feb 27 2012 Tom Callaway - 1:2.8.6-17 +- fix build against modern glib, libpng + * Thu Jan 12 2012 Fedora Release Engineering - 1:2.8.6-16 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild