[amanith] build against libpng15

Tom Callaway spot at fedoraproject.org
Tue Dec 6 18:18:48 UTC 2011


commit d4275e3ae789a91e4b6fa469788ded33d0894b18
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Tue Dec 6 13:18:36 2011 -0500

    build against libpng15

 amanith-0.3-libpng15-fix.patch       |   15 ++++++++
 amanith-0.3-nothirdpartystatic.patch |   62 ++++++++++++++++++---------------
 amanith.spec                         |    9 ++++-
 3 files changed, 56 insertions(+), 30 deletions(-)
---
diff --git a/amanith-0.3-libpng15-fix.patch b/amanith-0.3-libpng15-fix.patch
new file mode 100644
index 0000000..7ff23f4
--- /dev/null
+++ b/amanith-0.3-libpng15-fix.patch
@@ -0,0 +1,15 @@
+diff -up amanith/plugins/png/gpngimpexp.cpp.pngfix amanith/plugins/png/gpngimpexp.cpp
+--- amanith/plugins/png/gpngimpexp.cpp.pngfix	2011-12-06 13:08:47.321866882 -0500
++++ amanith/plugins/png/gpngimpexp.cpp	2011-12-06 13:09:30.297453723 -0500
+@@ -366,7 +366,11 @@ GError GPngImpExp::RawPngSave(const GCha
+ 	/* Set error handling.  REQUIRED if you aren't supplying your own
+ 	* error handling functions in the png_create_write_struct() call.
+ 	*/
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++        if (setjmp(png_jmpbuf(png_ptr))) {
++#else
+ 	if (setjmp(png_ptr->jmpbuf)) {
++#endif
+ 		/* If we get here, we had a problem reading the file */
+ 		std::fclose(fp);
+ 		png_destroy_write_struct(&png_ptr, (png_infopp)info_ptr);
diff --git a/amanith-0.3-nothirdpartystatic.patch b/amanith-0.3-nothirdpartystatic.patch
index 09a9c98..f25c294 100644
--- a/amanith-0.3-nothirdpartystatic.patch
+++ b/amanith-0.3-nothirdpartystatic.patch
@@ -1,14 +1,35 @@
---- amanith/amanith.pro.BAD	2007-05-26 18:03:40.000000000 -0500
-+++ amanith/amanith.pro	2007-05-26 18:03:48.000000000 -0500
+diff -up amanith/amanith.pro.system amanith/amanith.pro
+--- amanith/amanith.pro.system	2005-12-06 05:43:12.000000000 -0500
++++ amanith/amanith.pro	2011-12-06 13:13:16.310280875 -0500
 @@ -1,4 +1,4 @@
  TEMPLATE     = subdirs
  CONFIG      += ordered
  
 -SUBDIRS += 3rdpart build plugins examples
 +SUBDIRS += build plugins examples
---- amanith/plugins/jpeg/build.conf.BAD	2007-05-26 18:03:57.000000000 -0500
-+++ amanith/plugins/jpeg/build.conf	2007-05-26 18:04:09.000000000 -0500
-@@ -25,7 +25,7 @@ contains(DEFINES, _JPEG_PLUGIN) {
+diff -up amanith/plugins/fonts/build.conf.system amanith/plugins/fonts/build.conf
+--- amanith/plugins/fonts/build.conf.system	2005-09-26 04:18:52.000000000 -0400
++++ amanith/plugins/fonts/build.conf	2011-12-06 13:13:16.314280835 -0500
+@@ -40,7 +40,7 @@ DEFINES -= FT_DEBUG_LEVEL_ERROR FT_DEBUG
+ 
+ INCLUDEPATH += $$(AMANITHDIR)/3rdpart/freetype2/include
+ 
+-unix: LIBS += $$(AMANITHDIR)/lib/libfreetype2.a $$(AMANITHDIR)/lib/libzlib.a
++unix: LIBS += -lfreetype -lz
+ win32: {
+ 
+     !contains(DEFINES, WIN32_MINGW) {
+@@ -51,4 +51,4 @@ win32: {
+     contains(DEFINES, WIN32_MINGW) {
+         LIBS += $$(AMANITHDIR)/lib/libfreetype2.a $$(AMANITHDIR)/lib/libzlib.a
+     }
+-}
+\ No newline at end of file
++}
+diff -up amanith/plugins/jpeg/build.conf.system amanith/plugins/jpeg/build.conf
+--- amanith/plugins/jpeg/build.conf.system	2005-09-26 04:19:04.000000000 -0400
++++ amanith/plugins/jpeg/build.conf	2011-12-06 13:13:16.311280865 -0500
+@@ -25,7 +25,7 @@ contains(DEFINES, _JPEG_PLUGIN) {
      }
  }
  
@@ -17,35 +38,20 @@
  win32: {
  
      !contains(DEFINES, WIN32_MINGW) {
---- amanith/plugins/png/build.conf.BAD	2007-05-26 18:04:21.000000000 -0500
-+++ amanith/plugins/png/build.conf	2007-05-26 18:04:33.000000000 -0500
-@@ -25,9 +25,7 @@ contains(DEFINES, _PNG_PLUGIN) {
+diff -up amanith/plugins/png/build.conf.system amanith/plugins/png/build.conf
+--- amanith/plugins/png/build.conf.system	2005-09-26 04:19:14.000000000 -0400
++++ amanith/plugins/png/build.conf	2011-12-06 13:14:28.079590898 -0500
+@@ -25,9 +25,10 @@ contains(DEFINES, _PNG_PLUGIN) {
      }
  }
  
 -INCLUDEPATH += $$(AMANITHDIR)/3rdpart/zlib
 -
 -unix: LIBS += $$(AMANITHDIR)/lib/libpng.a $$(AMANITHDIR)/lib/libzlib.a
-+unix: LIBS += -lpng -lz
- win32: {
- 
-     !contains(DEFINES, WIN32_MINGW) {
-diff -up amanith/plugins/fonts/build.conf.orig amanith/plugins/fonts/build.conf
---- amanith/plugins/fonts/build.conf.orig	2005-09-26 04:18:52.000000000 -0400
-+++ amanith/plugins/fonts/build.conf	2008-09-26 15:52:14.000000000 -0400
-@@ -40,7 +40,7 @@ DEFINES -= FT_DEBUG_LEVEL_ERROR FT_DEBUG
- 
- INCLUDEPATH += $$(AMANITHDIR)/3rdpart/freetype2/include
- 
--unix: LIBS += $$(AMANITHDIR)/lib/libfreetype2.a $$(AMANITHDIR)/lib/libzlib.a
-+unix: LIBS += -lfreetype -lz
++unix: { 
++    LIBS += `libpng-config --libs`
++    LIBS += -lz
++}
  win32: {
  
      !contains(DEFINES, WIN32_MINGW) {
-@@ -51,4 +51,4 @@ win32: {
-     contains(DEFINES, WIN32_MINGW) {
-         LIBS += $$(AMANITHDIR)/lib/libfreetype2.a $$(AMANITHDIR)/lib/libzlib.a
-     }
--}
-\ No newline at end of file
-+}
diff --git a/amanith.spec b/amanith.spec
index fb2bf93..ca0f642 100644
--- a/amanith.spec
+++ b/amanith.spec
@@ -1,6 +1,6 @@
 Name:          amanith
 Version:       0.3
-Release:       18%{?dist}
+Release:       19%{?dist}
 Summary:       Crossplatform framework for 2d/3d vector graphics
 Group:         Development/Libraries
 License:       QPL
@@ -23,6 +23,7 @@ Patch8:        amanith-0.3-gcc43.patch
 Patch9:        amanith-0.3-gcc44.patch
 Patch10:       amanith-0.3-fix-DSO.patch
 Patch11:       amanith-0.3-gcc-constructor-fix.patch
+Patch12:       amanith-0.3-libpng15-fix.patch
 
 %description
 Amanith is an OpenSource C++ CrossPlatform framework designed for 2d & 3d 
@@ -40,7 +41,7 @@ Development libraries and headers for developing programs that use amanith.
 
 %prep
 %setup -q -n %{name}
-%patch0 -p1
+%patch0 -p1 -b .system
 %patch1 -p1
 %patch3 -p1
 %patch4 -p1
@@ -51,6 +52,7 @@ Development libraries and headers for developing programs that use amanith.
 %patch9 -p1
 %patch10 -p1 -b .DSO
 %patch11 -p1 -b .constructor
+%patch12 -p1 -b .pngfix
 # Boo. Hiss. SGI Free B and GLX files.
 rm -rf include/GL/
 # Don't need the 3rdpart stuff either.
@@ -107,6 +109,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_includedir}/amanith/
 
 %changelog
+* Tue Dec 06 2011 Tom Callaway <spot at fedoraproject.org> - 0.3-19
+- fix code to use modern libpng
+
 * Tue Dec 06 2011 Adam Jackson <ajax at redhat.com> - 0.3-18
 - Rebuild for new libpng
 


More information about the scm-commits mailing list