Automatic import for version 2.0.3

This commit is contained in:
Rosa 2012-02-01 14:52:22 +04:00
commit 6b199e48be
5 changed files with 459 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"swig-2.0.3.tar.gz": da09610f0b925fae40b40186d262c46e3e1f2bf0

29
swig-1.3.23-pylib.patch Normal file
View file

@ -0,0 +1,29 @@
--- SWIG-1.3.23/configure.in.pylib 2004-11-02 00:45:57.000000000 +0100
+++ SWIG-1.3.23/configure.in 2004-11-23 12:20:12.552926982 +0100
@@ -574,9 +574,11 @@
# Set the include directory
+ PYLIB=`$PYTHON -c "import sys; print sys.path[[1]]"`
+
AC_MSG_CHECKING(for Python header files)
if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
- PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config"
+ PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYLIB/config"
fi
if test -z "$PYINCLUDE"; then
if test -r $PYPREFIX/include/Py/Python.h; then
@@ -587,13 +589,6 @@
# Set the library directory blindly. This probably won't work with older versions
AC_MSG_CHECKING(for Python library)
- dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR"
- for i in $dirs; do
- if test -d $PYEPREFIX/$PYLIBDIR/$i; then
- PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
- break
- fi
- done
if test -z "$PYLIB"; then
AC_MSG_RESULT(Not found)
else

269
swig.spec Normal file
View file

@ -0,0 +1,269 @@
%define _provides_exceptions perl(Test::\\(More\\|Builder\\))
%define with_guile 0
%{?_with_ruby: %{expand: %%global with_ruby 1}}
%define with_ocaml 0
%{?_with_ruby: %{expand: %%global with_ruby 1}}
%define with_mono 0
%{?_with_ruby: %{expand: %%global with_ruby 1}}
Name: swig
Version: 2.0.3
Release: %mkrel 1
Epoch: 1
Summary: Simplified Wrapper and Interface Generator (SWIG)
License: BSD-like
Group: Development/Other
URL: http://www.swig.org/
Source0: http://download.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
Patch0: swig-1.3.23-pylib.patch
Patch2: swig200-rh623854.patch
Patch3: swig200-rh666429.patch
BuildRequires: bison
BuildRequires: imake
%if %{with_guile}
BuildRequires: guile-devel
%endif
%if %{with_ocaml}
BuildRequires: ocaml
%endif
BuildRequires: lua-devel
%if %{with_mono}
BuildRequires: mono
BuildRequires: mono-devel
%endif
BuildRequires: pcre-devel
BuildRequires: libstdc++-devel
BuildRequires: boost-devel
BuildRequires: perl-devel
BuildRequires: php-devel
BuildRequires: python-devel
BuildRequires: ruby-devel
BuildRequires: tcl-devel
BuildRequires: automake
BuildRequires: autoconf2.5
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
Obsoletes: swig-devel
%description
SWIG takes an interface description file written in a combination of C/C++
and special directives and produces interfaces to Perl, Python, and Tcl.
It allows scripting languages to use C/C++ code with minimal effort.
%package doc
Summary: Documentation and examples for %{name}
Group: Development/C
Requires: %{name} = %{epoch}:%{version}-%{release}
%description doc
SWIG takes an interface description file written in a combination of C/C++
and special directives and produces interfaces to Perl, Python, and Tcl.
It allows scripting languages to use C/C++ code with minimal effort.
Install the %{name}-doc package if you want to look at example and
documentation.
%prep
%setup -q
%patch0 -p1 -b .pylib
%patch2 -p1 -b .rh623854
%patch3 -p1 -b .rh666429
%build
./autogen.sh
%configure2_5x
%make
%install
rm -rf %buildroot
%makeinstall_std
%if %mdkversion < 200900
%post -p /sbin/ldconfig
%endif
%if %mdkversion < 200900
%postun -p /sbin/ldconfig
%endif
%clean
%{__rm} -rf %{buildroot}
%files
%defattr(-,root,root)
%doc ANNOUNCE INSTALL CHANGES CHANGES.current LICENSE README TODO
%{_bindir}/swig
%{_bindir}/ccache-swig
%{_datadir}/swig
%{_mandir}/man1/*1*
%files doc
%defattr(-,root,root)
%doc Examples Doc/Manual
%changelog
* Tue May 03 2011 Funda Wang <fwang@mandriva.org> 1:2.0.3-1mdv2011.0
+ Revision: 663706
- new version 2.0.3
* Mon Jan 03 2011 Oden Eriksson <oeriksson@mandriva.com> 1:1.3.40-4mdv2011.0
+ Revision: 627727
- bump release
- don't force the usage of automake1.7
* Fri Dec 03 2010 Oden Eriksson <oeriksson@mandriva.com> 1:1.3.40-3mdv2011.0
+ Revision: 607760
- rebuild
* Mon Mar 15 2010 Oden Eriksson <oeriksson@mandriva.com> 1:1.3.40-2mdv2010.1
+ Revision: 520237
- rebuilt for 2010.1
* Sat Sep 26 2009 Tomasz Pawel Gajc <tpg@mandriva.org> 1:1.3.40-1mdv2010.0
+ Revision: 449494
- update to new version 1.3.40
* Fri Aug 07 2009 Frederik Himpe <fhimpe@mandriva.org> 1:1.3.39-1mdv2010.0
+ Revision: 411506
- Update to new version 1.3.39
- Remove patch integrated upstream
* Wed Mar 18 2009 Guillaume Rousse <guillomovitch@mandriva.org> 1:1.3.38-2mdv2009.1
+ Revision: 357221
- handle co option gracefully (patch stolen from fedora)
- spec cleanup
* Sun Feb 22 2009 Emmanuel Andry <eandry@mandriva.org> 1:1.3.38-1mdv2009.1
+ Revision: 343927
- New version 1.3.38
- drop P1, no more needed
- update files list
* Wed Dec 24 2008 Funda Wang <fwang@mandriva.org> 1:1.3.36-3mdv2009.1
+ Revision: 318392
- more patch
- fix code template
* Sat Dec 06 2008 Adam Williamson <awilliamson@mandriva.org> 1:1.3.36-2mdv2009.1
+ Revision: 311086
- buildrequires lua-devel not liblua-devel (breaks on x86-64)
- rebuild for new tcl
* Tue Aug 26 2008 Funda Wang <fwang@mandriva.org> 1:1.3.36-1mdv2009.0
+ Revision: 276099
- New version 1.3.36
* Thu Aug 07 2008 Thierry Vignaud <tv@mandriva.org> 1:1.3.35-3mdv2009.0
+ Revision: 265744
- rebuild early 2009.0 package (before pixel changes)
* Wed Jun 11 2008 Helio Chissini de Castro <helio@mandriva.com> 1:1.3.35-2mdv2009.0
+ Revision: 218193
- Added switchs for mono, ocaml and guile bindings with swig. Mono and guile fails with tests
- Obsoleted wrong devel package. Swig must be the only package
+ Pixel <pixel@mandriva.com>
- do not call ldconfig in %%post/%%postun, it is now handled by filetriggers
* Mon Apr 21 2008 Per Øyvind Karlsen <peroyvind@mandriva.org> 1:1.3.35-1mdv2009.0
+ Revision: 196249
- update to 1.3.35
- drop P1 & P2 (fixed upstream)
* Fri Jan 18 2008 Guillaume Rousse <guillomovitch@mandriva.org> 1:1.3.33-1mdv2008.1
+ Revision: 154641
- new version
+ Olivier Blin <oblin@mandriva.com>
- restore BuildRoot
+ Thierry Vignaud <tv@mandriva.org>
- kill re-definition of %%buildroot on Pixel's request
* Thu Jul 26 2007 Oden Eriksson <oeriksson@mandriva.com> 1:1.3.31-3mdv2008.0
+ Revision: 55912
- rule out some perl provides
* Thu May 03 2007 Per Øyvind Karlsen <peroyvind@mandriva.org> 1:1.3.31-2mdv2008.0
+ Revision: 22054
- build with java/gcj support
* Tue Nov 28 2006 David Walluck <walluck@mandriva.org> 1.3.31-1mdv2007.0
+ Revision: 87757
- 1.3.31
- Import swig
* Thu Apr 20 2006 Jerome Martin <jmartin@mandriva.org> 1:1.3.27-3mdk
- Fixed BuildRequires for 2006.0
* Sun Apr 09 2006 Christiaan Welvaart <cjw@daneel.dyndns.org> 1:1.3.27-2mdk
- drop BuildRequires: mono - in contrib
* Thu Apr 06 2006 Helio Chissini de Castro <helio@mandriva.com> 1:1.3.27-1mdk
- Revert to 1.3.27 release. No project is ready to compile against new swig.
Subversion bindings not compile against 1.3.28 or 1.3.29 yet.
* Sun Apr 02 2006 Oden Eriksson <oeriksson@mandriva.com> 1.3.29-1mdk
- 1.3.29
- fix deps
* Mon Mar 27 2006 Oden Eriksson <oeriksson@mandriva.com> 1.3.27-3mdk
- make it backportable
* Tue Jan 24 2006 Per Øyvind Karlsen <pkarlsen@mandriva.com> 1.3.27-2mdk
- remove kaffe-devel from buildrequires as it's not need nor in main anymore..
- %%mkrel
* Tue Oct 18 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1.3.27-1mdk
- 1.3.27
* Thu Oct 06 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1.3.25-1mdk
- 1.3.25
- Fix Group
* Tue Jul 19 2005 Rafael Garcia-Suarez <rgarciasuarez@mandriva.com> 1.3.24-2mdk
- Rebuild
* Fri Dec 24 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.3.24-1mdk
- 1.3.24
- do libtoolize again
- drop P0 (fixed upstream)
- libraries are no more
- pick up python libdir correctly (P1 from fedora)
* Mon Dec 20 2004 Rafael Garcia-Suarez <rgarciasuarez@mandrakesoft.com> 1.3.21-6mdk
- Rebuild for new perl
* Tue Jun 08 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 1.3.21-5mdk
- rebuilt with gcc v3.4.x
- use macros
* Fri Apr 16 2004 Michael Scherer <misc@mandrake.org> 1.3.21-4mdk
- moved .so to -devel, to remove useless dependencies
- split docs from main package
* Thu Jan 15 2004 Ben Reser <ben@reser.org> 1.3.21-3mdk
- Patch to fix python support on amd64.
* Wed Jan 14 2004 Ben Reser <ben@reser.org> 1.3.21-2mdk
- devel package should require the same version-release of the main
package.
* Wed Jan 14 2004 Ben Reser <ben@reser.org> 1.3.21-1mdk
- 1.3.21
- Remove the symlink that was causing it to ship the currently installed
binary on the build host. The 1.3.20 version actually had the 1.3.19
binary in it. And as such produced code that wouldn't build against
the headers.
- Drop the symlink to the binary in the doc dir.
- Ship CHANGES.current, ANNOUNCE, FUTURE, NEW and TODO in the doc dir.
* Sat Jan 03 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 1.3.20-1mdk
- 1.3.20

92
swig200-rh623854.patch Normal file
View file

@ -0,0 +1,92 @@
diff -up swig-2.0.0/Lib/python/pyrun.swg.rh623854 swig-2.0.0/Lib/python/pyrun.swg
--- swig-2.0.0/Lib/python/pyrun.swg.rh623854 2010-02-28 00:26:02.000000000 +0100
+++ swig-2.0.0/Lib/python/pyrun.swg 2010-08-17 16:32:16.581604656 +0200
@@ -45,8 +45,18 @@
#define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg
#define SWIG_ErrorType(code) SWIG_Python_ErrorType(code)
#define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
-#define SWIG_fail goto fail
+#define SWIG_fail goto fail
+/*
+ * Python 2.7 and newer and Python 3.1 and newer should use Capsules API instead of
+ * CObjects API.
+ */
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0))
+#define USE_CAPSULES
+#define TYPE_POINTER_NAME \
+ ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
/* Runtime API implementation */
@@ -1356,8 +1366,12 @@ SWIG_Python_GetModule(void) {
#ifdef SWIG_LINK_RUNTIME
type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
#else
+#ifdef USE_CAPSULES
+ type_pointer = PyCapsule_Import(TYPE_POINTER_NAME, 0);
+#else
type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
(char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+#endif
if (PyErr_Occurred()) {
PyErr_Clear();
type_pointer = (void *)0;
@@ -1402,9 +1416,14 @@ PyModule_AddObject(PyObject *m, char *na
SWIGRUNTIME void
SWIG_Python_DestroyModule(void *vptr)
{
+ size_t i;
+#ifdef USE_CAPSULES
+ swig_module_info *swig_module =
+ (swig_module_info *) PyCapsule_GetPointer((PyObject *)vptr, TYPE_POINTER_NAME);
+#else
swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
swig_type_info **types = swig_module->types;
- size_t i;
for (i =0; i < swig_module->size; ++i) {
swig_type_info *ty = types[i];
if (ty->owndata) {
@@ -1426,9 +1445,18 @@ SWIG_Python_SetModule(swig_module_info *
PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
swig_empty_runtime_method_table);
#endif
+#ifdef USE_CAPSULES
+ PyObject *pointer = PyCapsule_New((void *)swig_module, TYPE_POINTER_NAME,
+ (PyCapsule_Destructor)SWIG_Python_DestroyModule);
+#else
PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+#endif
if (pointer && module) {
+#ifdef USE_CAPSULES
+ PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+#else
PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+#endif
} else {
Py_XDECREF(pointer);
}
@@ -1449,12 +1477,20 @@ SWIG_Python_TypeQuery(const char *type)
PyObject *obj = PyDict_GetItem(cache, key);
swig_type_info *descriptor;
if (obj) {
+#ifdef USE_CAPSULES
+ descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, type);
+#else
descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
} else {
swig_module_info *swig_module = SWIG_Python_GetModule();
descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
if (descriptor) {
+#ifdef USE_CAPSULES
+ obj = PyCapsule_New(descriptor, type, NULL);
+#else
obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
PyDict_SetItem(cache, key, obj);
Py_DECREF(obj);
}

67
swig200-rh666429.patch Normal file
View file

@ -0,0 +1,67 @@
diff -up swig-2.0.3/Lib/python/pycontainer.swg.rh666429 swig-2.0.3/Lib/python/pycontainer.swg
--- swig-2.0.3/Lib/python/pycontainer.swg.rh666429 2010-10-19 08:31:31.000000000 +0200
+++ swig-2.0.3/Lib/python/pycontainer.swg 2011-04-22 15:42:42.185982189 +0200
@@ -630,6 +630,7 @@ namespace swig
return x;
}
+#if !NO_PYSLICE
/* typemap for slice object support */
%typemap(in) PySliceObject* {
$1 = (PySliceObject *) $input;
@@ -637,6 +638,7 @@ namespace swig
%typemap(typecheck,precedence=SWIG_TYPECHECK_POINTER) PySliceObject* {
$1 = PySlice_Check($input);
}
+#endif
Sequence* __getslice__(difference_type i, difference_type j) throw (std::out_of_range) {
return swig::getslice(self, i, j);
@@ -659,7 +661,11 @@ namespace swig
/* Overloaded methods for Python 3 compatibility
* (Also useful in Python 2.x)
*/
+#if NO_PYSLICE
+ Sequence* __getitem__(PyObject *slice) throw (std::out_of_range) {
+#else
Sequence* __getitem__(PySliceObject *slice) throw (std::out_of_range) {
+#endif
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
SWIG_Error(SWIG_TypeError, "Slice object expected.");
@@ -668,8 +674,11 @@ namespace swig
PySlice_GetIndices(slice, self->size(), &i, &j, &step);
return swig::getslice(self, i, j);
}
-
+#if NO_PYSLICE
+ void __setitem__(PyObject *slice, const Sequence& v)
+#else
void __setitem__(PySliceObject *slice, const Sequence& v)
+#endif
throw (std::out_of_range, std::invalid_argument) {
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
@@ -680,7 +689,11 @@ namespace swig
swig::setslice(self, i, j, v);
}
+#if NO_PYSLICE
+ void __delitem__(PyObject *slice)
+#else
void __delitem__(PySliceObject *slice)
+#endif
throw (std::out_of_range) {
Py_ssize_t i, j, step;
if( !PySlice_Check(slice) ) {
diff -up swig-2.0.3/Source/Modules/python.cxx.rh666429 swig-2.0.3/Source/Modules/python.cxx
--- swig-2.0.3/Source/Modules/python.cxx.rh666429 2011-03-14 08:22:08.000000000 +0100
+++ swig-2.0.3/Source/Modules/python.cxx 2011-04-22 15:43:45.122661120 +0200
@@ -438,6 +438,7 @@ public:
if (py3) {
/* force disable features that not compatible with Python 3.x */
classic = 0;
+ Preprocessor_define((DOH *) "NO_PYSLICE 1", 0);
}
if (cppcast) {