diff --git a/amanith-0.3-freetype-fix.patch b/amanith-0.3-freetype-fix.patch new file mode 100644 index 0000000..fd6e052 --- /dev/null +++ b/amanith-0.3-freetype-fix.patch @@ -0,0 +1,54 @@ +diff -up amanith/plugins/fonts/gfontsimpexp.cpp.BAD amanith/plugins/fonts/gfontsimpexp.cpp +--- amanith/plugins/fonts/gfontsimpexp.cpp.BAD 2007-11-15 10:02:49.000000000 -0500 ++++ amanith/plugins/fonts/gfontsimpexp.cpp 2007-11-15 10:05:59.000000000 -0500 +@@ -34,7 +34,6 @@ + + #include + #include FT_FREETYPE_H +-#include + + namespace Amanith { + +@@ -197,8 +196,9 @@ static void LoadGlyph(GFont2D& Font, con + GFontChar2D *c; + GGlyphMetrics tmpMetrics; + FT_Error error; ++ FT_Matrix subGlyphMatrix; ++ FT_Int subGlyphArg1, subGlyphArg2; + GInt32 i, j, k0, k1, numVert; +- FT_SubGlyphRec subGlyph; + GPoint2 p; + GReal x, y; + GVect v; +@@ -223,19 +223,22 @@ static void LoadGlyph(GFont2D& Font, con + GDynArray subChars(Face->glyph->num_subglyphs); + + for (i = 0; i < (GInt32)Face->glyph->num_subglyphs; i++) { +- subGlyph = Face->glyph->subglyphs[i]; +- subChars[i].GlyphIndex = subGlyph.index; +- subChars[i].Flags = subGlyph.flags; ++ FT_Get_SubGlyph_Info(Face->glyph, i, ++ &subChars[i].GlyphIndex, ++ (FT_UInt*)&subChars[i].Flags, ++ &subGlyphArg1, ++ &subGlyphArg2, ++ &subGlyphMatrix); + // rotation and scale +- subChars[i].Transformation[G_X][G_X] = Fixed1616ToReal(subGlyph.transform.xx); +- subChars[i].Transformation[G_X][G_Y] = Fixed1616ToReal(subGlyph.transform.xy); ++ subChars[i].Transformation[G_X][G_X] = Fixed1616ToReal(subGlyphMatrix.xx); ++ subChars[i].Transformation[G_X][G_Y] = Fixed1616ToReal(subGlyphMatrix.xy); + // x position +- subChars[i].Transformation[G_X][G_Z] = subGlyph.arg1 * Scale; ++ subChars[i].Transformation[G_X][G_Z] = subGlyphArg1 * Scale; + // rotation and scale +- subChars[i].Transformation[G_Y][G_X] = Fixed1616ToReal(subGlyph.transform.yx); +- subChars[i].Transformation[G_Y][G_Y] = Fixed1616ToReal(subGlyph.transform.yy); ++ subChars[i].Transformation[G_Y][G_X] = Fixed1616ToReal(subGlyphMatrix.yx); ++ subChars[i].Transformation[G_Y][G_Y] = Fixed1616ToReal(subGlyphMatrix.yy); + // y position +- subChars[i].Transformation[G_Y][G_Z] = subGlyph.arg2 * Scale; ++ subChars[i].Transformation[G_Y][G_Z] = subGlyphArg2 * Scale; + // last row is an identity + subChars[i].Transformation[G_Z][G_X] = 0; + subChars[i].Transformation[G_Z][G_Y] = 0; diff --git a/amanith-0.3-gcc-C++fix.patch b/amanith-0.3-gcc-C++fix.patch new file mode 100644 index 0000000..e7b2f41 --- /dev/null +++ b/amanith-0.3-gcc-C++fix.patch @@ -0,0 +1,12 @@ +diff -up amanith/examples/opengl/vectorizer/drawer.h.BAD amanith/examples/opengl/vectorizer/drawer.h +--- amanith/examples/opengl/vectorizer/drawer.h.BAD 2007-11-14 17:52:37.000000000 -0500 ++++ amanith/examples/opengl/vectorizer/drawer.h 2007-11-14 17:53:07.000000000 -0500 +@@ -71,7 +71,7 @@ public: + #endif + // destructor + ~QGLWidgetTest(); +- void QGLWidgetTest::timerEvent(QTimerEvent *e); ++ void timerEvent(QTimerEvent *e); + }; + + diff --git a/amanith-0.3-nothirdpartystatic.patch b/amanith-0.3-nothirdpartystatic.patch new file mode 100644 index 0000000..1634234 --- /dev/null +++ b/amanith-0.3-nothirdpartystatic.patch @@ -0,0 +1,45 @@ +--- amanith/amanith.pro.BAD 2007-05-26 18:03:40.000000000 -0500 ++++ amanith/amanith.pro 2007-05-26 18:03:48.000000000 -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) { + } + } + +-unix: LIBS += $$(AMANITHDIR)/lib/libjpeg.a ++unix: LIBS += -ljpeg + 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) { + } + } + +-INCLUDEPATH += $$(AMANITHDIR)/3rdpart/zlib +- +-unix: LIBS += $$(AMANITHDIR)/lib/libpng.a $$(AMANITHDIR)/lib/libzlib.a ++unix: LIBS += -lpng -lz + win32: { + + !contains(DEFINES, WIN32_MINGW) { +--- amanith/plugins/fonts/build.conf.BAD 2007-05-26 18:04:44.000000000 -0500 ++++ amanith/plugins/fonts/build.conf 2007-05-26 18:05:08.000000000 -0500 +@@ -38,9 +38,9 @@ contains(DEFINES, _FONTS_PLUGIN) { + # take into account compilation mode (debug or release) + DEFINES -= FT_DEBUG_LEVEL_ERROR FT_DEBUG_LEVEL_TRACE + + INCLUDEPATH += $$(AMANITHDIR)/3rdpart/freetype2/include + +-unix: LIBS += $$(AMANITHDIR)/lib/libfreetype2.a $$(AMANITHDIR)/lib/libzlib.a ++unix: LIBS += -lfreetype -lz + win32: { + + !contains(DEFINES, WIN32_MINGW) { diff --git a/amanith-0.3-system-freetype.patch b/amanith-0.3-system-freetype.patch new file mode 100644 index 0000000..45158cf --- /dev/null +++ b/amanith-0.3-system-freetype.patch @@ -0,0 +1,19 @@ +diff -up amanith/plugins/fonts/build.conf.BAD amanith/plugins/fonts/build.conf +--- amanith/plugins/fonts/build.conf.BAD 2007-11-15 10:18:43.000000000 -0500 ++++ amanith/plugins/fonts/build.conf 2007-11-15 10:19:10.000000000 -0500 +@@ -38,7 +38,7 @@ contains(DEFINES, _FONTS_PLUGIN) { + # take into account compilation mode (debug or release) + DEFINES -= FT_DEBUG_LEVEL_ERROR FT_DEBUG_LEVEL_TRACE + +-INCLUDEPATH += $$(AMANITHDIR)/3rdpart/freetype2/include ++QMAKE_CXXFLAGS += `pkg-config --cflags freetype2` + + unix: LIBS += -lfreetype -lz + win32: { +@@ -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-0.3-system-glew.patch b/amanith-0.3-system-glew.patch new file mode 100644 index 0000000..ab9d439 --- /dev/null +++ b/amanith-0.3-system-glew.patch @@ -0,0 +1,26 @@ +diff -up amanith/build/build.pro.BAD amanith/build/build.pro +--- amanith/build/build.pro.BAD 2007-11-14 17:41:00.000000000 -0500 ++++ amanith/build/build.pro 2007-11-14 17:41:41.000000000 -0500 +@@ -69,8 +69,9 @@ SOURCES = gelement.cpp \ + # + #********************************************************* + contains(DEFINES, _OPENGLEXT_PLUGIN) { +- SOURCES += support/glew.c gopenglext.cpp ++ SOURCES += gopenglext.cpp + CONFIG += opengl ++ LIBS += -lGLEW + + # Qt4 syntax + contains(DEFINES, USE_QT4) { +diff -up amanith/include/amanith/gopenglext.h.BAD amanith/include/amanith/gopenglext.h +--- amanith/include/amanith/gopenglext.h.BAD 2007-11-14 17:42:28.000000000 -0500 ++++ amanith/include/amanith/gopenglext.h 2007-11-14 17:42:52.000000000 -0500 +@@ -29,7 +29,7 @@ + #ifndef GOPENGLEXT_H + #define GOPENGLEXT_H + +-#include "GL/glew.h" ++#include + // this inclusion to make glew linking working with some platforms (ex: Mac) + #include "amanith/gelement.h" + #ifdef G_OS_WIN diff --git a/amanith-0.3-system-libjpeg.patch b/amanith-0.3-system-libjpeg.patch new file mode 100644 index 0000000..de6bd33 --- /dev/null +++ b/amanith-0.3-system-libjpeg.patch @@ -0,0 +1,12 @@ +diff -up amanith/plugins/jpeg/gjpegimpexp.cpp.BAD amanith/plugins/jpeg/gjpegimpexp.cpp +--- amanith/plugins/jpeg/gjpegimpexp.cpp.BAD 2007-11-14 22:06:33.000000000 -0500 ++++ amanith/plugins/jpeg/gjpegimpexp.cpp 2007-11-14 22:07:15.000000000 -0500 +@@ -36,7 +36,7 @@ + #include + + G_EXTERN_C { +- #include "../../3rdpart/libjpeg/jpeglib.h" ++ #include + }; + + /**************************************************************************** diff --git a/amanith-0.3-system-libpng.patch b/amanith-0.3-system-libpng.patch new file mode 100644 index 0000000..c6a9ad8 --- /dev/null +++ b/amanith-0.3-system-libpng.patch @@ -0,0 +1,12 @@ +diff -up amanith/plugins/png/gpngimpexp.cpp.BAD amanith/plugins/png/gpngimpexp.cpp +--- amanith/plugins/png/gpngimpexp.cpp.BAD 2007-11-14 22:09:31.000000000 -0500 ++++ amanith/plugins/png/gpngimpexp.cpp 2007-11-14 22:10:11.000000000 -0500 +@@ -35,7 +35,7 @@ + //#include + + G_EXTERN_C { +- #include "../../3rdpart/libpng/png.h" ++ #include + }; + + /**************************************************************************** diff --git a/amanith.spec b/amanith.spec new file mode 100644 index 0000000..7b1ec91 --- /dev/null +++ b/amanith.spec @@ -0,0 +1,115 @@ +Name: amanith +Version: 0.3 +Release: 5%{?dist} +Summary: Crossplatform framework for 2d/3d vector graphics +Group: Development/Libraries +License: QPL +URL: http://www.amanith.org +Source0: http://www.amanith.org/download/files/amanith_03.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: qt-devel, freetype-devel, libjpeg-devel, libpng-devel, zlib-devel +BuildRequires: libXmu-devel, glew-devel, mesa-libGLU-devel +BuildRequires: mesa-libGL-devel, pkgconfig +Patch0: amanith-0.3-nothirdpartystatic.patch +Patch1: amanith-0.3-system-glew.patch +Patch3: amanith-0.3-gcc-C++fix.patch +Patch4: amanith-0.3-system-libjpeg.patch +Patch5: amanith-0.3-system-libpng.patch +Patch6: amanith-0.3-freetype-fix.patch +Patch7: amanith-0.3-system-freetype.patch + +%description +Amanith is an OpenSource C++ CrossPlatform framework designed for 2d & 3d +vector graphics. All the framework is heavily based on a light plug-in +system. + +%package devel +Summary: Development files for amanith +Group: Development/Libraries +Requires: glew-devel +Requires: %{name} = %{version}-%{release} + +%description devel +Development libraries and headers for developing programs that use amanith. + +%prep +%setup -q -n %{name} +%patch0 -p1 +%patch1 -p1 +%patch3 -p1 +%patch4 -p1 +%patch5 -p1 +%patch6 -p1 +%patch7 -p1 +# Boo. Hiss. SGI Free B and GLX files. +rm -rf include/GL/ +# Don't need the 3rdpart stuff either. +rm -rf 3rdpart/ +chmod -x include/amanith/*.h include/amanith/1d/*.h \ + include/amanith/2d/*.h include/amanith/lang/*.h \ + include/amanith/numerics/*.h include/amanith/geometry/*.h \ + include/amanith/rendering/*.h include/amanith/support/*.h \ + FAQ CHANGELOG INSTALL README LICENSE.QPL doc/amanith.chm \ + src/1d/*.cpp src/2d/*.cpp src/support/*.cpp src/rendering/*.cpp \ + src/*.cpp src/geometry/*.cpp plugins/jpeg/*.cpp src/numerics/*.cpp \ + plugins/fonts/*.cpp plugins/png/*.cpp \ + plugins/jpeg/*.h plugins/png/*.h plugins/fonts/*.h +# convert to utf-8, fix end of line encoding +for i in FAQ CHANGELOG INSTALL README LICENSE.QPL; do + sed -i -e 's|\r||g' $i + iconv -f iso-8859-1 -t utf-8 -o $i{.utf8,} + mv $i{.utf8,} +done + +%build +export AMANITHDIR=$(pwd) +export LD_LIBRARY_PATH=$AMANITHDIR/lib:$LD_LIBRARY_PATH +source %{_sysconfdir}/profile.d/qt.sh +qmake amanith.pro +make %{?_smp_mflags} + +%install +rm -rf $RPM_BUILD_ROOT +mkdir -p $RPM_BUILD_ROOT%{_libdir} +mkdir -p $RPM_BUILD_ROOT%{_includedir} + +# We're using cp instead of install because the symlinks are already +# created correctly. +cp -a lib/*.so* $RPM_BUILD_ROOT%{_libdir} +cp -a plugins/*.so* $RPM_BUILD_ROOT%{_libdir} +cp -a include/amanith $RPM_BUILD_ROOT%{_includedir} + +%clean +rm -rf $RPM_BUILD_ROOT + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%files +%defattr(-,root,root,-) +%doc CHANGELOG FAQ LICENSE.QPL README doc/* +%{_libdir}/*.so.* + +%files devel +%defattr(-,root,root,-) +%{_libdir}/*.so +%{_includedir}/amanith/ + +%changelog +* Thu Dec 20 2007 Tom "spot" Callaway 0.3-5 +- use macros when we source qt.sh + +* Wed Dec 19 2007 Tom "spot" Callaway 0.3-4 +- source /etc/profile/qt.sh so qmake is in the path + +* Wed Dec 19 2007 Tom "spot" Callaway 0.3-3 +- Add glew-devel as explicit Requires for amanith-devel +- change AMANITHDIR to use pwd rather than a macro combo +- drop INSTALL from %%doc + +* Thu Nov 15 2007 Tom "spot" Callaway 0.3-2 +- fix freetype plugin to properly use system includes + +* Sat May 26 2007 Tom "spot" Callaway 0.3-1 +- initial Fedora package diff --git a/sources b/sources index e69de29..ce6fc52 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +392e79d36cc2d57921c7fefacbc4d4a3 amanith_03.tar.gz