summaryrefslogtreecommitdiff
path: root/community/tinyxml
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-01-06 23:14:57 +0000
committerroot <root@rshg054.dnsready.net>2012-01-06 23:14:57 +0000
commitd7931e8fa49a4698ac8dbb1a155ca6b48f031828 (patch)
tree281739e3992b9ac2dbb722ea6f84d1015fe1a365 /community/tinyxml
parent817e58c278cb8ebee7743205877d0f67c431fcec (diff)
Fri Jan 6 23:14:57 UTC 2012
Diffstat (limited to 'community/tinyxml')
-rw-r--r--community/tinyxml/PKGBUILD48
-rw-r--r--community/tinyxml/entity.patch64
-rw-r--r--community/tinyxml/tinyxml-2.5.3-stl.patch12
3 files changed, 124 insertions, 0 deletions
diff --git a/community/tinyxml/PKGBUILD b/community/tinyxml/PKGBUILD
new file mode 100644
index 000000000..4c93beb72
--- /dev/null
+++ b/community/tinyxml/PKGBUILD
@@ -0,0 +1,48 @@
+# Maintainer: Bartłomiej Piotrowski <barthalion@gmail.com>
+# Contributor: Larry Hajali <larryhaja[at]gmail[dot]com>
+# Contributor: Hubert Grzeskowiak <arch at nemesis13 dot de>
+
+pkgname=tinyxml
+pkgver=2.6.2
+pkgrel=1
+pkgdesc="A simple, small, C++ XML parser that can be easily integrated into other programs."
+url='http://www.grinninglizard.com/tinyxml/'
+arch=('i686' 'x86_64')
+license=('zlib')
+depends=('gcc-libs')
+source=("http://downloads.sourceforge.net/${pkgname}/${pkgname}_${pkgver//./_}.tar.gz"
+ 'entity.patch'
+ 'tinyxml-2.5.3-stl.patch')
+md5sums=('c1b864c96804a10526540c664ade67f0'
+ 'b6cc2d9330707373d920f760793c6311'
+ '6db8334398e0cdad7e3c6406206ff42a')
+
+build() {
+ cd "$srcdir"/$pkgname
+
+ # Fix entity encoding.
+ patch -p0 < "$srcdir"/entity.patch
+
+ # Make TINYXML_USE_STL permanently defined in tinyxml.h
+ patch -p1 < "$srcdir"/$pkgname-2.5.3-stl.patch
+
+ # Fix Makefile
+ sed -i \
+ -e '/^TINYXML_USE_STL/ s|=.*|=YES|' \
+ -e "s|^RELEASE_CFLAGS.*|& ${CXXFLAGS} -fPIC|" Makefile
+
+ make
+ g++ -fPIC ${CXXFLAGS} -shared -o lib${pkgname}.so.0.$pkgver -Wl,-soname,lib${pkgname}.so.0 *.o
+}
+
+package()
+{
+ cd "$srcdir"/$pkgname
+ install -d -m 0755 "$pkgdir"/usr/{lib,include}
+ install -m 0755 lib${pkgname}.so.0.$pkgver "$pkgdir"/usr/lib/
+ install -m 0644 $pkgname.h tinystr.h "$pkgdir"/usr/include
+ (cd "$pkgdir"/usr/lib
+ ln -s lib${pkgname}.so.0.$pkgver lib${pkgname}.so.0
+ ln -s lib${pkgname}.so.0.$pkgver lib${pkgname}.so
+ )
+}
diff --git a/community/tinyxml/entity.patch b/community/tinyxml/entity.patch
new file mode 100644
index 000000000..66d89a617
--- /dev/null
+++ b/community/tinyxml/entity.patch
@@ -0,0 +1,64 @@
+? entity.patch
+Index: tinyxml.cpp
+===================================================================
+RCS file: /cvsroot/tinyxml/tinyxml/tinyxml.cpp,v
+retrieving revision 1.105
+diff -u -r1.105 tinyxml.cpp
+--- tinyxml.cpp 5 Jun 2010 19:06:57 -0000 1.105
++++ tinyxml.cpp 19 Jul 2010 21:24:16 -0000
+@@ -57,30 +57,7 @@
+ {
+ unsigned char c = (unsigned char) str[i];
+
+- if ( c == '&'
+- && i < ( (int)str.length() - 2 )
+- && str[i+1] == '#'
+- && str[i+2] == 'x' )
+- {
+- // Hexadecimal character reference.
+- // Pass through unchanged.
+- // &#xA9; -- copyright symbol, for example.
+- //
+- // The -1 is a bug fix from Rob Laveaux. It keeps
+- // an overflow from happening if there is no ';'.
+- // There are actually 2 ways to exit this loop -
+- // while fails (error case) and break (semicolon found).
+- // However, there is no mechanism (currently) for
+- // this function to return an error.
+- while ( i<(int)str.length()-1 )
+- {
+- outString->append( str.c_str() + i, 1 );
+- ++i;
+- if ( str[i] == ';' )
+- break;
+- }
+- }
+- else if ( c == '&' )
++ if ( c == '&' )
+ {
+ outString->append( entity[0].str, entity[0].strLength );
+ ++i;
+Index: xmltest.cpp
+===================================================================
+RCS file: /cvsroot/tinyxml/tinyxml/xmltest.cpp,v
+retrieving revision 1.89
+diff -u -r1.89 xmltest.cpp
+--- xmltest.cpp 5 Jun 2010 17:41:52 -0000 1.89
++++ xmltest.cpp 19 Jul 2010 21:24:16 -0000
+@@ -1340,6 +1340,16 @@
+ }*/
+ }
+
++ #ifdef TIXML_USE_STL
++ {
++ TiXmlDocument xml;
++ xml.Parse("<foo>foo&amp;#xa+bar</foo>");
++ std::string str;
++ str << xml;
++ XmlTest( "Entity escaping", "<foo>foo&amp;#xa+bar</foo>", str.c_str() );
++ }
++ #endif
++
+ /* 1417717 experiment
+ {
+ TiXmlDocument xml;
diff --git a/community/tinyxml/tinyxml-2.5.3-stl.patch b/community/tinyxml/tinyxml-2.5.3-stl.patch
new file mode 100644
index 000000000..7bcde59ff
--- /dev/null
+++ b/community/tinyxml/tinyxml-2.5.3-stl.patch
@@ -0,0 +1,12 @@
+diff -up tinyxml/tinyxml.h~ tinyxml/tinyxml.h
+--- tinyxml/tinyxml.h~ 2007-11-30 22:39:36.000000000 +0100
++++ tinyxml/tinyxml.h 2007-11-30 22:39:36.000000000 +0100
+@@ -26,6 +26,8 @@ distribution.
+ #ifndef TINYXML_INCLUDED
+ #define TINYXML_INCLUDED
+
++#define TIXML_USE_STL 1
++
+ #ifdef _MSC_VER
+ #pragma warning( push )
+ #pragma warning( disable : 4530 )