diff --git a/mingw-w64-tinyxml/PKGBUILD b/mingw-w64-tinyxml/PKGBUILD new file mode 100644 index 0000000000..cf5d01bfa0 --- /dev/null +++ b/mingw-w64-tinyxml/PKGBUILD @@ -0,0 +1,51 @@ +# Maintainer: Alexey Pavlov + +_realname=tinyxml +_mingw_suff=mingw-w64-${CARCH} +pkgname="${_mingw_suff}-${_realname}" +pkgver=2.6.2 +pkgrel=1 +pkgdesc="Simple, small, C++ XML parser that can be easily integrated into other programs (mingw-w64)" +arch=('any') +url="http://www.grinninglizard.com/tinyxml" +license=("zlib") +makedepends=("${_mingw_suff}-gcc") +depends=("${_mingw_suff}-crt") +options=('strip' 'staticlibs') +source=("http://downloads.sourceforge.net/tinyxml/tinyxml_${pkgver//./_}.tar.gz" +"entity.patch" +"tinyxml-2.5.3-stl.patch" +"tinyxml.pc") +sha256sums=('15bdfdcec58a7da30adc87ac2b078e4417dbe5392f3afb719f9ba6d062645593' + 'ef493209b0a51160171fd834a7ecdddd02679463b85fb89a2ea254213e47f99b' + '3baf2c4dbc2c8f54a151dac8860113d2f549174f83ed85d552b094dfaebb52af' + '60bcff16486698f4d2f076f5a3c6e5566e098e3d0d30f1bdbbe7012d3d36c095') + +prepare() { + cd "$srcdir/tinyxml" + patch -p0 -i "$srcdir"/entity.patch + patch -p1 -i "$srcdir"/tinyxml-2.5.3-stl.patch +} + +build() { + mkdir -p "${srcdir}/${_realname}-${pkgver}-build-${MINGW_CHOST}" + cp -r "${srcdir}/tinyxml/"* "${srcdir}/${_realname}-${pkgver}-build-${MINGW_CHOST}" + cd "${srcdir}/${_realname}-${pkgver}-build-${MINGW_CHOST}" + for file in $(ls *.cpp | grep -v xmltest); do + g++ -c -Wall -Wno-unknown-pragmas -Wno-format -O3 $file + done + ar rcs -o libtinyxml.a $(ls *.o) + g++ -shared -o libtinyxml-0.dll -Xlinker --out-implib -Xlinker libtinyxml.dll.a $(ls *.o) +} + +package() { + cd "${srcdir}/${_realname}-${pkgver}-build-${MINGW_CHOST}" + install -Dm644 libtinyxml.a "${pkgdir}${MINGW_PREFIX}/lib/libtinyxml.a" + install -Dm644 libtinyxml-0.dll "${pkgdir}${MINGW_PREFIX}/bin/libtinyxml-0.dll" + install -m644 libtinyxml.dll.a "${pkgdir}${MINGW_PREFIX}/lib/" + install -Dm644 "$srcdir/tinyxml.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/tinyxml.pc" + install -Dm644 tinyxml.h "${pkgdir}${MINGW_PREFIX}/include/tinyxml.h" + install -m644 tinystr.h "${pkgdir}${MINGW_PREFIX}/include/" + sed -i "s,@PREFIX@,${MINGW_PREFIX}," "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/tinyxml.pc" + find "${pkgdir}${MINGW_PREFIX}" -name '*.def' -o -name '*.exp' | xargs -rtl1 rm +} diff --git a/mingw-w64-tinyxml/entity.patch b/mingw-w64-tinyxml/entity.patch new file mode 100644 index 0000000000..66d89a6174 --- /dev/null +++ b/mingw-w64-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. +- // © -- 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&#xa+bar"); ++ std::string str; ++ str << xml; ++ XmlTest( "Entity escaping", "foo&#xa+bar", str.c_str() ); ++ } ++ #endif ++ + /* 1417717 experiment + { + TiXmlDocument xml; diff --git a/mingw-w64-tinyxml/tinyxml-2.5.3-stl.patch b/mingw-w64-tinyxml/tinyxml-2.5.3-stl.patch new file mode 100644 index 0000000000..7bcde59ff9 --- /dev/null +++ b/mingw-w64-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 ) diff --git a/mingw-w64-tinyxml/tinyxml.pc b/mingw-w64-tinyxml/tinyxml.pc new file mode 100644 index 0000000000..740f2166a3 --- /dev/null +++ b/mingw-w64-tinyxml/tinyxml.pc @@ -0,0 +1,10 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${exec_prefix}/lib +includedir=${prefix}/include + +Name: TinyXml +Description: simple, small, C++ XML parser +Version: 2.6.2 +Libs: -L${libdir} -ltinyxml +Cflags: -I${includedir}