[CableSwig/f14/master] Initial import (#540885).

mrceresa mrceresa at fedoraproject.org
Sun Oct 17 17:16:15 UTC 2010


commit 7d785b545ffe4e5f8ee0a2d40126dfb0e339b357
Author: Mario Ceresa <mrceresa at gmail.com>
Date:   Sun Oct 17 19:16:06 2010 +0200

    Initial import (#540885).

 .gitignore                           |    1 +
 CableSwig-Remove-bundled-expat.patch |  171 ++++++++++++++++++++++++++++++++++
 CableSwig.spec                       |   98 +++++++++++++++++++
 sources                              |    1 +
 4 files changed, 271 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..af9c3b5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/CableSwig-ITK-3.20.0.tar.gz
diff --git a/CableSwig-Remove-bundled-expat.patch b/CableSwig-Remove-bundled-expat.patch
new file mode 100644
index 0000000..6ac51cf
--- /dev/null
+++ b/CableSwig-Remove-bundled-expat.patch
@@ -0,0 +1,171 @@
+From 86a688302c15353c4fd2287d11df114919064f44 Mon Sep 17 00:00:00 2001
+From: Peter Lemenkov <lemenkov at gmail.com>
+Date: Wed, 22 Sep 2010 16:52:56 +0400
+Subject: [PATCH] Remove bundled expat
+
+---
+ CMakeLists.txt                   |    1 -
+ Cable/CMakeLists.txt             |    2 +-
+ Cable/Generators/CMakeLists.txt  |    2 +-
+ Cable/Parsers/CMakeLists.txt     |    2 +-
+ Cable/Parsers/cableXMLParser.cxx |   24 ++++++++++++------------
+ Executables/CMakeLists.txt       |    4 ++--
+ 6 files changed, 17 insertions(+), 18 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 6681ef4..8b46c1d 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -78,7 +78,6 @@ INCLUDE_DIRECTORIES(BEFORE
+         ${CABLE_BIN}
+         ${CABLE_SOURCE}/CxxTypes
+         ${CABLE_SOURCE}/Executables
+-        ${CABLE_SOURCE}/Expat
+         ${CABLE_SOURCE}/Generators
+         ${CABLE_SOURCE}/Parsers
+         ${CABLE_SOURCE}
+diff --git a/Cable/CMakeLists.txt b/Cable/CMakeLists.txt
+index d4ef449..8c84213 100644
+--- a/Cable/CMakeLists.txt
++++ b/Cable/CMakeLists.txt
+@@ -19,7 +19,7 @@ SET(CABLE_VERSION_STRING
+ INCLUDE_REGULAR_EXPRESSION ("^(cxx|cable|ct|CxxTypes).*$")
+ 
+ # Build the standard components.
+-SUBDIRS (Expat CxxTypes Parsers Generators )
++SUBDIRS (CxxTypes Parsers Generators )
+ 
+ 
+ # Configure the CABLE version number in the build.
+diff --git a/Cable/Generators/CMakeLists.txt b/Cable/Generators/CMakeLists.txt
+index 7b20d7c..85bcba4 100644
+--- a/Cable/Generators/CMakeLists.txt
++++ b/Cable/Generators/CMakeLists.txt
+@@ -9,4 +9,4 @@ ADD_LIBRARY(CableGenerators STATIC
+   cableSystemTools.cxx
+ )
+ 
+-TARGET_LINK_LIBRARIES(CableGenerators CableParsers CxxTypes CableExpat)
++TARGET_LINK_LIBRARIES(CableGenerators CableParsers CxxTypes expat)
+diff --git a/Cable/Parsers/CMakeLists.txt b/Cable/Parsers/CMakeLists.txt
+index b46ce0f..4595895 100644
+--- a/Cable/Parsers/CMakeLists.txt
++++ b/Cable/Parsers/CMakeLists.txt
+@@ -39,4 +39,4 @@ ADD_LIBRARY(CableParsers STATIC
+   cableXMLSourceParser.cxx
+ )
+ 
+-TARGET_LINK_LIBRARIES(CableParsers CxxTypes CableExpat)
++TARGET_LINK_LIBRARIES(CableParsers CxxTypes expat)
+diff --git a/Cable/Parsers/cableXMLParser.cxx b/Cable/Parsers/cableXMLParser.cxx
+index c30af8a..2a55651 100644
+--- a/Cable/Parsers/cableXMLParser.cxx
++++ b/Cable/Parsers/cableXMLParser.cxx
+@@ -16,7 +16,7 @@
+ =========================================================================*/
+ #include "cableXMLParser.h"
+ 
+-#include "../Expat/expat.h"
++#include <expat.h>
+ #include <string.h>
+ 
+ namespace cable
+@@ -59,12 +59,12 @@ bool XMLParser::Parse()
+   
+   // Create the expat XML parser.
+   m_Parser = XML_ParserCreate(0);
+-  XML_SetElementHandler(m_Parser,
++  XML_SetElementHandler((XML_ParserStruct*)m_Parser,
+                         &XMLParser::StartElementFunction,
+                         &XMLParser::EndElementFunction);
+-  XML_SetCharacterDataHandler(m_Parser,
++  XML_SetCharacterDataHandler((XML_ParserStruct*)m_Parser,
+                               &XMLParser::CharacterDataHandlerFunction);
+-  XML_SetUserData(m_Parser, this);
++  XML_SetUserData((XML_ParserStruct*)m_Parser, this);
+   
+   // Parse the input stream.
+   bool result = this->ParseStream();
+@@ -72,7 +72,7 @@ bool XMLParser::Parse()
+   if(result)
+     {
+     // Tell the expat XML parser about the end-of-input.
+-    if(!XML_Parse(m_Parser, "", 0, 1))
++    if(!XML_Parse((XML_ParserStruct*)m_Parser, "", 0, 1))
+       {
+       this->ReportXmlParseError();
+       result = false;
+@@ -80,7 +80,7 @@ bool XMLParser::Parse()
+     }
+   
+   // Clean up the parser.
+-  XML_ParserFree(m_Parser);
++  XML_ParserFree((XML_ParserStruct*)m_Parser);
+   m_Parser = 0;
+   
+   return result;
+@@ -171,33 +171,33 @@ void XMLParser::ReportUnknownElement(const char* element) const
+ void XMLParser::ReportXmlParseError() const
+ {
+   cableErrorMacro("Error parsing XML in stream at line "
+-                  << XML_GetCurrentLineNumber(m_Parser)
+-                  << ": " << XML_ErrorString(XML_GetErrorCode(m_Parser)));
++                  << XML_GetCurrentLineNumber((XML_ParserStruct*)m_Parser)
++                  << ": " << XML_ErrorString(XML_GetErrorCode((XML_ParserStruct*)m_Parser)));
+ }
+ 
+ //----------------------------------------------------------------------------
+ unsigned long XMLParser::GetXMLByteIndex() const
+ {
+-  return XML_GetCurrentByteIndex(m_Parser);
++  return XML_GetCurrentByteIndex((XML_ParserStruct*)m_Parser);
+ }
+ 
+ //----------------------------------------------------------------------------
+ unsigned long XMLParser::GetXMLLineNumber() const
+ {
+-  return XML_GetCurrentLineNumber(m_Parser);
++  return XML_GetCurrentLineNumber((XML_ParserStruct*)m_Parser);
+ }
+ 
+ //----------------------------------------------------------------------------
+ unsigned long XMLParser::GetXMLColumnNumber() const
+ {
+-  return XML_GetCurrentColumnNumber(m_Parser);
++  return XML_GetCurrentColumnNumber((XML_ParserStruct*)m_Parser);
+ }  
+ 
+ //----------------------------------------------------------------------------
+ bool XMLParser::ParseBuffer(const char* buffer, unsigned int count)
+ {
+   // Pass the buffer to the expat XML parser.
+-  if(!XML_Parse(m_Parser, buffer, count, 0))
++  if(!XML_Parse((XML_ParserStruct*)m_Parser, buffer, count, 0))
+     {
+     this->ReportXmlParseError();
+     return false;
+diff --git a/Executables/CMakeLists.txt b/Executables/CMakeLists.txt
+index de23744..a20b42e 100755
+--- a/Executables/CMakeLists.txt
++++ b/Executables/CMakeLists.txt
+@@ -5,7 +5,7 @@ TARGET_LINK_LIBRARIES(cswig
+         swigLib
+         CableGenerators
+         CableParsers
+-        CableExpat 
++	expat
+         CxxTypes 
+         )
+ ADD_DEFINITIONS(-D_cxx_STATIC)
+@@ -15,7 +15,7 @@ ADD_EXECUTABLE( cableidx cableidx.cxx)
+ TARGET_LINK_LIBRARIES(cableidx
+         CableGenerators
+         CableParsers
+-        CableExpat 
++        expat
+         CxxTypes 
+         )
+ 
+-- 
+1.7.2.3
+
diff --git a/CableSwig.spec b/CableSwig.spec
new file mode 100644
index 0000000..ae753d0
--- /dev/null
+++ b/CableSwig.spec
@@ -0,0 +1,98 @@
+Summary:        Create interfaces to interpreted languages for templated code
+Name:           CableSwig
+Version:        3.20.0
+Release:        3%{?dist}
+License:        BSD
+Group:          Development/Libraries
+URL:            http://www.itk.org/ITK/resources/CableSwig.html
+Source0:        http://download.sourceforge.net/project/itk/itk/3.20/CableSwig-ITK-3.20.0.tar.gz
+Patch0:		CableSwig-Remove-bundled-expat.patch
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+
+BuildRequires:  cmake
+BuildRequires:  gccxml
+BuildRequires:  expat-devel
+BuildRequires:  python-devel
+BuildRequires:  tcl-devel
+BuildRequires:  tk-devel
+
+Requires: gccxml
+
+%description
+CableSwig is used to create interfaces (i.e. "wrappers") to interpreted
+languages such as Tcl and Python. It was created to produce wrappers for ITK
+because the toolkit uses C++ structures that SWIG cannot parse (deeply nested
+template instantiations). CableSwig is a combination tool that uses  GCC_XML as
+the c++ parser. The input files are  Cable style input files. The XML produced
+from the Cable/GCC_XML input files are then parsed and feed into a modified
+version of  SWIG. SWIG is a software development tool that connects programs
+written in C and C++ with a variety of high-level programming languages. It is
+used to generate the language bindings to the target language. Currently, Tcl
+and Python are supported.
+
+%prep
+%setup -q
+rm -rf Cable/Expat
+rm -rf GCC
+rm -rf GCC_XML
+%patch0 -p1 -b .expat
+
+#Fix spurious executable permissions:
+chmod 644 SWIG/Source/Modules/ocaml.cxx
+chmod 644 Executables/CableSwig.h
+chmod 644 Executables/CableSwig.cxx
+chmod 644 Executables/cableidx.cxx
+chmod 644 Executables/cableSwigMain.cxx
+
+%build
+%cmake -DCMAKE_BUILD_TYPE:STRING=Release \
+       -DCMAKE_VERBOSE_MAKEFILE=ON \
+       -DBUILD_TESTING=ON . \
+       -DCSWIG_USE_SYSTEM_GCCXML=yes
+
+make %{?_smp_mflags}
+
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
+
+mkdir -p %{buildroot}%{_datadir}/CableSwig/
+# Move SWIGLib files:
+mv %{buildroot}/usr/lib/CableSwig/SWIGLib %{buildroot}%{_datadir}/CableSwig/
+# Move CableSwig CMake conf:
+mv %{buildroot}/usr/lib/CableSwig/CableSwigConfig.cmake %{buildroot}%{_datadir}/CableSwig/
+
+%clean
+rm -rf %{buildroot}
+
+%files
+%defattr(-,root,root)
+%{_bindir}/*
+%{_datadir}/CableSwig
+
+%changelog
+* Wed Sep 22 2010 Mario Ceresa <mrceresa at gmail.com> - 3.20.0-3
+- Thanks to Peter Lemenkov for:
+a) Removed bundled libraries GCC and GCC-XML
+b) Cleaned up the spec files
+c) Re-enabled the cmake verbose makefile switch
+d) Provided patch to remove Cable/expat utilities
+e) Figured out the correct BuildRequires
+f) Fixed spurious executable permissions
+
+* Sat Sep 18 2010 Mario Ceresa <mrceresa at gmail.com> - 3.20.0-2
+- Removed "dist" tag from changelog entries
+
+* Wed Sep 17 2010 Mario Ceresa <mrceresa at gmail.com> - 3.20.0-1
+- Updated to 3.20 release
+- Removed -ITK suffix from name as upstream refer to the package without it
+
+* Tue Mar 30 2010 Mario Ceresa <mrceresa at gmail.com> - 3.16.0-3
+- Fixed install paths
+
+* Wed Mar 03 2010 Mario Ceresa <mrceresa at gmail.com> - 3.16.0-2
+- Updated to 3.16 release
+
+* Fri Nov 20 2009 Mario Ceresa <mrceresa at gmail.com> - cvs20091120-1
+- Initial RPM Release
diff --git a/sources b/sources
index e69de29..db08668 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+893882bf8b4fbfbae3fe8c747a75f7a0  CableSwig-ITK-3.20.0.tar.gz


More information about the scm-commits mailing list