aboutsummaryrefslogtreecommitdiffstats
path: root/community/tinyxml
diff options
context:
space:
mode:
Diffstat (limited to 'community/tinyxml')
-rw-r--r--community/tinyxml/APKBUILD45
-rw-r--r--community/tinyxml/tinyxml-2.6.1-entity.patch64
-rw-r--r--community/tinyxml/tinyxml-2.6.2-defineSTL.patch12
3 files changed, 121 insertions, 0 deletions
diff --git a/community/tinyxml/APKBUILD b/community/tinyxml/APKBUILD
new file mode 100644
index 00000000000..5d641ab5117
--- /dev/null
+++ b/community/tinyxml/APKBUILD
@@ -0,0 +1,45 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=tinyxml
+pkgver=2.6.2
+_realver=${pkgver//./_}
+pkgrel=1
+pkgdesc="A simple, small, C++ XML parser"
+url="http://www.grinninglizard.com/tinyxml/"
+arch="all"
+license="Zlib"
+subpackages="$pkgname-dev"
+source="https://downloads.sourceforge.net/tinyxml/tinyxml_$_realver.tar.gz
+ tinyxml-2.6.2-defineSTL.patch
+ tinyxml-2.6.1-entity.patch"
+
+builddir=$srcdir/$pkgname
+
+prepare() {
+ default_prepare
+ sed -i Makefile \
+ -e '/^TINYXML_USE_STL/ s|=.*|=YES|' \
+ -e "s|^RELEASE_CFLAGS.*|& $CXXFLAGS -fPIC|"
+}
+
+build() {
+ make
+ g++ -fPIC $CXXFLAGS -shared -o libtinyxml.so.0.$pkgver \
+ -Wl,-soname,libtinyxml.so.0 $(ls *.o | grep -v xmltest)
+}
+
+package() {
+ install -d -m 0755 "$pkgdir"/usr/lib \
+ "$pkgdir"/usr/include
+ install -m 0755 libtinyxml.so.0.2.6.2 \
+ "$pkgdir"/usr/lib/
+ install -m 0644 tinyxml.h tinystr.h \
+ "$pkgdir"/usr/include/
+ cd "$pkgdir"/usr/lib
+ ln -s libtinyxml.so.0.2.6.2 libtinyxml.so
+ ln -s libtinyxml.so.0.2.6.2 libtinyxml.so.0
+}
+
+sha512sums="133b5db06131a90ad0c2b39b0063f1c8e65e67288a7e5d67e1f7d9ba32af10dc5dfa0462f9723985ee27debe8f09a10a25d4b5a5aaff2ede979b1cebe8e59d56 tinyxml_2_6_2.tar.gz
+52cd82ef9e8f1783b3d6042551342a8c592c447e1da352d5d017db4211144bc0a908ddbfe2a4641b3108fb8e02dc47f385a851f920532d94178314255904a6ef tinyxml-2.6.2-defineSTL.patch
+47d582456c2e2ac51a186a4bd58ede4895586ed373b654b120b34bedc7c2e52ed291a3576a37420ea94a238a265d8e2d38de024e770144e465590718da245af3 tinyxml-2.6.1-entity.patch"
diff --git a/community/tinyxml/tinyxml-2.6.1-entity.patch b/community/tinyxml/tinyxml-2.6.1-entity.patch
new file mode 100644
index 00000000000..2ccbd701ac4
--- /dev/null
+++ b/community/tinyxml/tinyxml-2.6.1-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
+--- a/tinyxml.cpp 5 Jun 2010 19:06:57 -0000 1.105
++++ b/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
+--- a/xmltest.cpp 5 Jun 2010 17:41:52 -0000 1.89
++++ b/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.6.2-defineSTL.patch b/community/tinyxml/tinyxml-2.6.2-defineSTL.patch
new file mode 100644
index 00000000000..7bcde59ff94
--- /dev/null
+++ b/community/tinyxml/tinyxml-2.6.2-defineSTL.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 )