aboutsummaryrefslogtreecommitdiffstats
path: root/main/tinyxml
diff options
context:
space:
mode:
authorCarlo Landmeter <clandmeter@gmail.com>2013-01-07 23:05:03 +0100
committerCarlo Landmeter <clandmeter@gmail.com>2013-01-07 23:12:43 +0100
commit2894f0386e7df0287af18a3bf81771616a293347 (patch)
tree8dc75c915392bc7122fe506ebfb9b3e6d31d000d /main/tinyxml
parent1d7ace2e2dff105f4ba45a80ab9dc06a6a099d15 (diff)
downloadaports-2894f0386e7df0287af18a3bf81771616a293347.tar.bz2
aports-2894f0386e7df0287af18a3bf81771616a293347.tar.xz
testing/tinyxml: move to main
Diffstat (limited to 'main/tinyxml')
-rw-r--r--main/tinyxml/APKBUILD56
-rw-r--r--main/tinyxml/tinyxml-2.6.1-entity.patch64
-rw-r--r--main/tinyxml/tinyxml-2.6.2-defineSTL.patch12
3 files changed, 132 insertions, 0 deletions
diff --git a/main/tinyxml/APKBUILD b/main/tinyxml/APKBUILD
new file mode 100644
index 0000000000..ff3bd1b526
--- /dev/null
+++ b/main/tinyxml/APKBUILD
@@ -0,0 +1,56 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=tinyxml
+pkgver=2.6.2
+_realver=2_6_2
+pkgrel=0
+pkgdesc="A simple, small, C++ XML parser"
+url="http://www.grinninglizard.com/tinyxml/"
+arch="all"
+license="zlib"
+depends=""
+depends_dev=""
+makedepends="$depends_dev"
+install=""
+subpackages="$pkgname-dev"
+source="http://downloads.sourceforge.net/$pkgname/${pkgname}_$_realver.tar.gz
+ tinyxml-2.6.2-defineSTL.patch
+ tinyxml-2.6.1-entity.patch"
+
+_builddir=$srcdir/$pkgname
+
+prepare() {
+ local i
+ cd "$_builddir"
+ for i in $source; do
+ case $i in
+ *.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
+ esac
+ done
+ sed -i -e '/^TINYXML_USE_STL/ s|=.*|=YES|' \
+ -e "s|^RELEASE_CFLAGS.*|& ${CXXFLAGS} -fPIC|" Makefile
+}
+
+build() {
+ cd "$_builddir"
+ make || return 1
+ g++ -fPIC ${CXXFLAGS} -shared -o libtinyxml.so.0.$pkgver \
+ -Wl,-soname,libtinyxml.so.0 $(ls *.o | grep -v xmltest)
+}
+
+package() {
+ cd "$_builddir"
+ 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
+}
+
+md5sums="c1b864c96804a10526540c664ade67f0 tinyxml_2_6_2.tar.gz
+6db8334398e0cdad7e3c6406206ff42a tinyxml-2.6.2-defineSTL.patch
+5890558bca2e9763f0fdcbb94e90971e tinyxml-2.6.1-entity.patch"
diff --git a/main/tinyxml/tinyxml-2.6.1-entity.patch b/main/tinyxml/tinyxml-2.6.1-entity.patch
new file mode 100644
index 0000000000..2ccbd701ac
--- /dev/null
+++ b/main/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/main/tinyxml/tinyxml-2.6.2-defineSTL.patch b/main/tinyxml/tinyxml-2.6.2-defineSTL.patch
new file mode 100644
index 0000000000..7bcde59ff9
--- /dev/null
+++ b/main/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 )