add tinyxml need for older games who works not with tinyxml2

This commit is contained in:
groni
2018-05-08 12:06:08 +02:00
parent cc9310e7e4
commit 996ec56d2a
11 changed files with 481 additions and 4 deletions
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/copyleft/gpl.txt
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import shelltools
from pisi.actionsapi import get
major, minor = get.srcVERSION().split(".", 1)
def setup():
shelltools.system("setconf Makefile TINYXML_USE_STL YES")
shelltools.system('setconf Makefile RELEASE_CFLAGS "$CXXFLAGS -fPIC"')
#pisitools.dosed("Makefile", "@MAJOR_V@", "%s" % major)
#pisitools.dosed("Makefile", "@MINOR_V@", "%s" % minor)
def build():
autotools.make()
shelltools.system('g++ -fPIC "$CXXFLAGS" -shared -o "libtinyxml.so.0.2.6.2" \
-Wl,-soname,"libtinyxml.so.0" $(ls *.o | grep -v xmltest)')
def install():
pisitools.insinto("/usr/include", "*.h")
# pisi dolib does not care for symlinks
# pisitools.dolib("libtinyxml.so*")
for i in shelltools.ls("libtinyxml.so*"):
pisitools.insinto("/usr/lib/", i)
pisitools.dosym("/usr/lib/libtinyxml.so.0.2.6.2", "usr/lib/libtinyxml.so.0")
pisitools.dosym("/usr/lib/libtinyxml.so.0.2.6.2", "usr/lib/libtinyxml.so")
pisitools.dodoc("changes.txt", "readme.txt")
pisitools.dohtml("docs/*")
@@ -0,0 +1,164 @@
--- Makefile.orig 2010-08-21 20:52:22.923386908 +0000
+++ Makefile 2010-08-21 14:29:13.000000000 +0000
@@ -1,130 +1,33 @@
-#****************************************************************************
-#
-# Makefile for TinyXml test.
-# Lee Thomason
-# www.grinninglizard.com
-#
-# This is a GNU make (gmake) makefile
-#****************************************************************************
-
-# DEBUG can be set to YES to include debugging info, or NO otherwise
-DEBUG := NO
-
-# PROFILE can be set to YES to include profiling info, or NO otherwise
-PROFILE := NO
-
-# TINYXML_USE_STL can be used to turn on STL support. NO, then STL
-# will not be used. YES will include the STL files.
-TINYXML_USE_STL := NO
-
-#****************************************************************************
-
-CC := gcc
-CXX := g++
-LD := g++
-AR := ar rc
-RANLIB := ranlib
-
-DEBUG_CFLAGS := -Wall -Wno-format -g -DDEBUG
-RELEASE_CFLAGS := -Wall -Wno-unknown-pragmas -Wno-format -O3
-
-LIBS :=
-
-DEBUG_CXXFLAGS := ${DEBUG_CFLAGS}
-RELEASE_CXXFLAGS := ${RELEASE_CFLAGS}
-
-DEBUG_LDFLAGS := -g
-RELEASE_LDFLAGS :=
-
-ifeq (YES, ${DEBUG})
- CFLAGS := ${DEBUG_CFLAGS}
- CXXFLAGS := ${DEBUG_CXXFLAGS}
- LDFLAGS := ${DEBUG_LDFLAGS}
-else
- CFLAGS := ${RELEASE_CFLAGS}
- CXXFLAGS := ${RELEASE_CXXFLAGS}
- LDFLAGS := ${RELEASE_LDFLAGS}
-endif
-
-ifeq (YES, ${PROFILE})
- CFLAGS := ${CFLAGS} -pg -O3
- CXXFLAGS := ${CXXFLAGS} -pg -O3
- LDFLAGS := ${LDFLAGS} -pg
-endif
-
-#****************************************************************************
-# Preprocessor directives
-#****************************************************************************
-
-ifeq (YES, ${TINYXML_USE_STL})
- DEFS := -DTIXML_USE_STL
-else
- DEFS :=
-endif
-
-#****************************************************************************
-# Include paths
-#****************************************************************************
-
-#INCS := -I/usr/include/g++-2 -I/usr/local/include
-INCS :=
-
-
-#****************************************************************************
-# Makefile code common to all platforms
-#****************************************************************************
-
-CFLAGS := ${CFLAGS} ${DEFS}
-CXXFLAGS := ${CXXFLAGS} ${DEFS}
-
-#****************************************************************************
-# Targets of the build
-#****************************************************************************
-
-OUTPUT := xmltest
-
-all: ${OUTPUT}
-
-
-#****************************************************************************
-# Source files
-#****************************************************************************
-
-SRCS := tinyxml.cpp tinyxmlparser.cpp xmltest.cpp tinyxmlerror.cpp tinystr.cpp
-
-# Add on the sources for libraries
-SRCS := ${SRCS}
-
-OBJS := $(addsuffix .o,$(basename ${SRCS}))
-
-#****************************************************************************
-# Output
-#****************************************************************************
-
-${OUTPUT}: ${OBJS}
- ${LD} -o $@ ${LDFLAGS} ${OBJS} ${LIBS} ${EXTRA_LIBS}
-
-#****************************************************************************
-# common rules
-#****************************************************************************
-
-# Rules for compiling source files to object files
-%.o : %.cpp
- ${CXX} -c ${CXXFLAGS} ${INCS} $< -o $@
-
-%.o : %.c
- ${CC} -c ${CFLAGS} ${INCS} $< -o $@
-
-dist:
- bash makedistlinux
+AR ?= ar
+CXX ?= g++
+CXXFLAGS += -Wall
+RANLIB ?= ranlib
+
+name = libtinyxml
+major = @MAJOR_V@
+minor = @MINOR_V@
+version = $(major).$(minor)
+
+src = tinyxml.cpp tinyxmlparser.cpp tinyxmlerror.cpp tinystr.cpp
+lo = $(addsuffix .lo,$(basename ${src}))
+o = $(addsuffix .o,$(basename ${src}))
+
+all: $(name).a $(name).so
+
+%.o: %.cpp
+ $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) $< -o $@
+
+$(name).a: $(o)
+ $(AR) rc $(name).a $(o)
+ $(RANLIB) $(name).a
+
+%.lo: %.cpp
+ $(CXX) -c $(CXXFLAGS) $(CPPFLAGS) -fPIC $< -o $@
+
+$(name).so: $(lo)
+ $(CXX) $(LDFLAGS) -fPIC -shared $(lo) -Wl,-soname,$(name).so.$(major) -o $(name).so.$(version)
+ ln -s $(name).so.$(version) $(name).so.$(major)
+ ln -s $(name).so.$(version) $(name).so
clean:
- -rm -f core ${OBJS} ${OUTPUT}
-
-depend:
- #makedepend ${INCS} ${SRCS}
-
-tinyxml.o: tinyxml.h tinystr.h
-tinyxmlparser.o: tinyxml.h tinystr.h
-xmltest.o: tinyxml.h tinystr.h
-tinyxmlerror.o: tinyxml.h tinystr.h
+ -rm -f *.o *.lo *.so* *.a
@@ -0,0 +1,18 @@
Description: TinyXml is built with TIXML_USE_STL, so we have to
enforce it when the library is used.
Author: Felix Geyer <debfx-pkg@fobos.de>
diff -Nur tinyxml-2.5.3/tinyxml.h tinyxml-2.5.3.patch/tinyxml.h
--- tinyxml-2.5.3/tinyxml.h 2007-05-07 00:41:23.000000000 +0200
+++ tinyxml-2.5.3.patch/tinyxml.h 2009-07-08 22:32:03.000000000 +0200
@@ -26,6 +26,10 @@
#ifndef TINYXML_INCLUDED
#define TINYXML_INCLUDED
+#ifndef TIXML_USE_STL
+ #define TIXML_USE_STL
+#endif
+
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4530 )
@@ -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;
+10
View File
@@ -0,0 +1,10 @@
prefix=/usr
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}
+83
View File
@@ -0,0 +1,83 @@
<?xml version="1.0" ?>
<!DOCTYPE PISI SYSTEM "http://www.pisilinux.org/projeler/pisi/pisi-spec.dtd">
<PISI>
<Source>
<Name>tinyxml</Name>
<Homepage>http://www.grinninglizard.com/tinyxml</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
</Packager>
<License>ZLIB</License>
<IsA>library</IsA>
<Summary>A simple, small, C++ XML parser</Summary>
<Description>TinyXML is a simple, small, C++ XML parser that can be easily integrating into other programs.</Description>
<Archive sha1sum="a425a22ff331dafa570b2a508a37a85a4eaa4127" type="zip">mirrors://sourceforge/tinyxml/tinyxml/2.6.2/tinyxml_2_6_2.zip</Archive>
<Patches>
<!--<Patch>Makefile.patch</Patch>-->
<Patch level="1">enforce-use-stl.patch</Patch>
<Patch>entity.patch</Patch>
</Patches>
<BuildDependencies>
<Dependency>setconf</Dependency>
</BuildDependencies>
</Source>
<Package>
<Name>tinyxml</Name>
<RuntimeDependencies>
<Dependency>libgcc</Dependency>
</RuntimeDependencies>
<Files>
<Path fileType="library">/usr/lib</Path>
<Path fileType="doc">/usr/share/doc</Path>
<Path fileType="doc">/usr/share/doc/tinyxml/html</Path>
</Files>
</Package>
<Package>
<Name>tinyxml-devel</Name>
<Summary>Development files for tinyxml</Summary>
<RuntimeDependencies>
<Dependency release="current">tinyxml</Dependency>
</RuntimeDependencies>
<AdditionalFiles>
<AdditionalFile owner="root" permission="0644" target="/usr/lib/pkgconfig/tinyxml.pc">tinyxml.pc</AdditionalFile>
</AdditionalFiles>
<Files>
<Path fileType="header">/usr/include</Path>
<Path fileType="library">/usr/lib/pkgconfig</Path>
</Files>
</Package>
<History>
<Update release="4">
<Date>2018-05-06</Date>
<Version>2.6.2</Version>
<Comment>Rebuild for Pisi Linux 2.0</Comment>
<Name>Stefan Gronewold</Name>
<Email>groni@pisilinux.org</Email>
</Update>
<Update release="3">
<Date>2014-07-04</Date>
<Version>2.6.2</Version>
<Comment>version bump</Comment>
<Name>Kamil Atlı</Name>
<Email>suvarice@gmail.com</Email>
</Update>
<Update release="2">
<Date>2014-03-09</Date>
<Version>2.6.1</Version>
<Comment>Rebuild</Comment>
<Name>Varol Maksutoğlu</Name>
<Email>waroi@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2011-01-19</Date>
<Version>2.6.1</Version>
<Comment>First release</Comment>
<Name>Pisi Linux Admins</Name>
<Email>admins@pisilinux.org</Email>
</Update>
</History>
</PISI>
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" ?>
<PISI>
<Source>
<Name>tinyxml</Name>
<Summary xml:lang="tr">Basit ve hafif bir XML ayrıştırıcı</Summary>
<Description xml:lang="tr">TinyXML, C++ için basit ve hafif bir XML ayrıştırıcıdır. Diğer programlara kolayca entegre edilebilir.</Description>
</Source>
<Package>
<Name>tinyxml-devel</Name>
<Summary xml:lang="tr">tinyxml için geliştirme başlıkları</Summary>
</Package>
</PISI>