From c395446c0e36e7030539e8e984edd2b579115778 Mon Sep 17 00:00:00 2001 From: Willy Sudiarto Raharjo Date: Fri, 24 May 2024 00:02:51 +0700 Subject: [PATCH] tinyxml: Added. Needed by rarian. Signed-off-by: Willy Sudiarto Raharjo --- MATE-1.28-CHANGES.TXT | 1 + deps/tinyxml/README | 2 + deps/tinyxml/entity.patch | 64 +++++++++++++++ deps/tinyxml/slack-desc | 19 +++++ deps/tinyxml/tinyxml-2.5.3-stl.patch | 12 +++ deps/tinyxml/tinyxml.SlackBuild | 114 +++++++++++++++++++++++++++ deps/tinyxml/tinyxml.info | 10 +++ mate-build-deps.sh | 1 + 8 files changed, 223 insertions(+) create mode 100644 deps/tinyxml/README create mode 100644 deps/tinyxml/entity.patch create mode 100644 deps/tinyxml/slack-desc create mode 100644 deps/tinyxml/tinyxml-2.5.3-stl.patch create mode 100644 deps/tinyxml/tinyxml.SlackBuild create mode 100644 deps/tinyxml/tinyxml.info diff --git a/MATE-1.28-CHANGES.TXT b/MATE-1.28-CHANGES.TXT index 8d313b2..b6a7572 100644 --- a/MATE-1.28-CHANGES.TXT +++ b/MATE-1.28-CHANGES.TXT @@ -1,4 +1,5 @@ New Packages in MATE 1.28: +tinyxml (needed by rarian) Renamed Packages in MATE 1.28: diff --git a/deps/tinyxml/README b/deps/tinyxml/README new file mode 100644 index 0000000..93a1e26 --- /dev/null +++ b/deps/tinyxml/README @@ -0,0 +1,2 @@ +TinyXML is a simple, small, C++ XML parser that can be easily +integrating into other programs. diff --git a/deps/tinyxml/entity.patch b/deps/tinyxml/entity.patch new file mode 100644 index 0000000..66d89a6 --- /dev/null +++ b/deps/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/deps/tinyxml/slack-desc b/deps/tinyxml/slack-desc new file mode 100644 index 0000000..12e8069 --- /dev/null +++ b/deps/tinyxml/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +tinyxml: tinyxml (A small xml parser) +tinyxml: +tinyxml: TinyXML is a simple, small, C++ XML parser that can be easily +tinyxml: integrating into other programs. +tinyxml: +tinyxml: Homepage: http://www.grinninglizard.com/tinyxml/ +tinyxml: +tinyxml: +tinyxml: +tinyxml: +tinyxml: diff --git a/deps/tinyxml/tinyxml-2.5.3-stl.patch b/deps/tinyxml/tinyxml-2.5.3-stl.patch new file mode 100644 index 0000000..7bcde59 --- /dev/null +++ b/deps/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/deps/tinyxml/tinyxml.SlackBuild b/deps/tinyxml/tinyxml.SlackBuild new file mode 100644 index 0000000..9decffe --- /dev/null +++ b/deps/tinyxml/tinyxml.SlackBuild @@ -0,0 +1,114 @@ +#!/bin/bash + +# Slackware build script for tinyxml + +# Copyright 2010-2013 Larry Hajali +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# Modified for MSB Project + +cd $(dirname $0) ; CWD=$(pwd) + +PRGNAM=tinyxml +VERSION=${VERSION:-2.6.2} +BUILD=${BUILD:-2} +TAG=${TAG:-_msb} +PKGTYPE=${PKGTYPE:-txz} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + +wget -c http://downloads.sourceforge.net/tinyxml/tinyxml_2_6_2.tar.gz + +TMP=${TMP:-/tmp/msb} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM +tar xvf $CWD/${PRGNAM}_${VERSION//./_}.tar.gz +cd $PRGNAM +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# Define TINYXML_USE_STL to YES and use custom SLKCFLAGS. +sed -i -e '/^TINYXML_USE_STL/s|=.*|= YES|' -e "s|-O3|$SLKCFLAGS|" Makefile +# Permanently define TINYXML_USE_STL in tinyxml.h. +patch -p1 < $CWD/tinyxml-2.5.3-stl.patch +# Fix for bug +# http://trac.filezilla-project.org/ticket/5473 +# http://sourceforge.net/tracker/index.php?func=detail&aid=3031828&group_id=13559&atid=313559 +patch -p0 < $CWD/entity.patch + +make + +g++ -v $SLKCFLAGS -Wall -Wno-unknown-pragmas -Wno-format -shared -o \ + lib${PRGNAM}.so.0.${VERSION} -Wl,-soname,lib${PRGNAM}.so.0 $(ls *.o | grep -v xmltest) + +mkdir -p $PKG/usr/{include,lib${LIBDIRSUFFIX}} +install -m 0755 lib${PRGNAM}.so.0.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX} +ln -s lib${PRGNAM}.so.0.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX}/lib${PRGNAM}.so.${VERSION} +ln -s lib${PRGNAM}.so.0.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX}/lib${PRGNAM}.so.0 +ln -s lib${PRGNAM}.so.0.${VERSION} $PKG/usr/lib${LIBDIRSUFFIX}/lib${PRGNAM}.so +install -m 0644 $PRGNAM.h tinystr.h $PKG/usr/include + +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a changes.txt readme.txt $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE diff --git a/deps/tinyxml/tinyxml.info b/deps/tinyxml/tinyxml.info new file mode 100644 index 0000000..3beb97a --- /dev/null +++ b/deps/tinyxml/tinyxml.info @@ -0,0 +1,10 @@ +PRGNAM="tinyxml" +VERSION="2.6.2" +HOMEPAGE="http://www.grinninglizard.com/tinyxml/" +DOWNLOAD="http://downloads.sourceforge.net/tinyxml/tinyxml_2_6_2.tar.gz" +MD5SUM="c1b864c96804a10526540c664ade67f0" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Larry Hajali" +EMAIL="larryhaja[at]gmail[dot]com" diff --git a/mate-build-deps.sh b/mate-build-deps.sh index 2da33c8..b48f75e 100755 --- a/mate-build-deps.sh +++ b/mate-build-deps.sh @@ -42,6 +42,7 @@ CHECKDUPLICATE=0 # Loop for all dependency packages for dir in \ deps/zenity \ + deps/tinyxml \ deps/rarian \ deps/yelp-xsl \ deps/yelp-tools \