- Update to 2.0.12

- This is a maintenance release backporting some fixes from the
    pending 3.0.0 release.
  - Octave 3.8 support added.
  - C++11 support for new versions of erase/insert in the STL
    containers.
  - Compilation fixes on some systems for the generated Lua, PHP,
    Python and R wrappers.
 
  - Drop upstreamed patches:
    swig-lua-fix-void-return-for-int-functions.patch
    swig-support-octave-3.8.0.patch
    ruby-2.0-encoding-utf8.patch

OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=60
This commit is contained in:
Klaus Kämpf 2014-02-10 09:34:03 +00:00 committed by Git OBS Bridge
parent 536cb6b5d2
commit f05657c6d2
6 changed files with 21 additions and 291 deletions

View File

@ -1,12 +0,0 @@
diff -wruN -x '*~' -x '*.o' -x '*.a' -x '*.so' -x '*.so.[0-9]' -x autom4te.cache -x .deps -x .libs -x Makefile -x Makefile ../orig-swig-2.0.10/Examples/test-suite/ruby/char_constant_runme.rb ./Examples/test-suite/ruby/char_constant_runme.rb
--- ../orig-swig-2.0.10/Examples/test-suite/ruby/char_constant_runme.rb 2013-05-27 20:24:04.000000000 +0200
+++ ./Examples/test-suite/ruby/char_constant_runme.rb 2013-05-28 14:48:44.924421929 +0200
@@ -28,7 +28,7 @@
raise RuntimeError, "Invalid value for NULL_CONST."
end
-if Char_constant::SPECIALCHAR != "\341" #'á'
+if Char_constant::SPECIALCHAR.ord != 225 # "\341" #'á'
raise RuntimeError, "Invalid value for SPECIALCHAR."
end

3
swig-2.0.12.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:65e13f22a60cecd7279c59882ff8ebe1ffe34078e85c602821a541817a4317f7
size 5312394

View File

@ -1,42 +0,0 @@
From ea4a4e435f721380555fea039bd5dc758eda43ae Mon Sep 17 00:00:00 2001
From: Atri <badshah400@gmail.com>
Date: Tue, 1 Oct 2013 01:28:26 +0530
Subject: [PATCH] Lua: Fix void return for non-void functions
Commit #c3f3880d caused the functions
SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L,
swig_lua_namespace* ns)
and
SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L,
swig_lua_namespace* ns)
to return void when int returns were expected resulting in the build
failures for plplot's lua bindings for example. This commit fixes the
issue.
---
Lib/lua/luarun.swg | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Lib/lua/luarun.swg b/Lib/lua/luarun.swg
index 4d851bd..8485ed4 100644
--- a/Lib/lua/luarun.swg
+++ b/Lib/lua/luarun.swg
@@ -524,7 +524,7 @@ SWIGINTERN int SWIG_Lua_add_namespace_details(lua_State* L, swig_lua_namespace*
/* clear stack - remove metatble */
lua_pop(L,1);
-
+ return 0;
}
/* helper function. creates namespace table and add it to module table */
@@ -555,6 +555,7 @@ SWIGINTERN int SWIG_Lua_namespace_register(lua_State* L, swig_lua_namespace* ns)
lua_setmetatable(L,-2); /* set metatable */
lua_rawset(L,-3); /* add namespace to module table */
+ return 0;
}
/* -----------------------------------------------------------------------------
* global variable support code: classes
--
1.8.4

View File

@ -1,224 +0,0 @@
https://github.com/swig/swig/commit/5b167cc12daf9ea275c17fedaefc975450613ab2
From 5b167cc12daf9ea275c17fedaefc975450613ab2 Mon Sep 17 00:00:00 2001
From: Karl Wette <karl.wette@ligo.org>
Date: Mon, 13 Jan 2014 18:24:17 +1300
Subject: [PATCH] octave: update support to Octave version 3.8.0
diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index 41d1c7a..2174a0f 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -1,20 +1,88 @@
#include <octave/version.h>
-#ifndef OCTAVE_API_VERSION_NUMBER
-
- // Hack to distinguish between Octave 3.2 and earlier versions before OCTAVE_API_VERSION_NUMBER existed
- #define ComplexLU __ignore
- #include <octave/CmplxLU.h>
- #undef ComplexLU
- #ifdef octave_Complex_LU_h
- # define OCTAVE_API_VERSION_NUMBER 36
- #else
- # define OCTAVE_API_VERSION_NUMBER 37
- #endif
-#endif
+// Macro for enabling features which require Octave version >= major.minor.patch
+#define SWIG_OCTAVE_PREREQ(major, minor, patch) \
+ ( (OCTAVE_MAJOR_VERSION<<16) + (OCTAVE_MINOR_VERSION<<8) + OCTAVE_PATCH_VERSION >= ((major)<<16) + ((minor)<<8) + (patch) )
+
+// Reconstruct Octave major, minor, and patch versions for releases prior to 3.8.1
+#if !defined(OCTAVE_MAJOR_VERSION)
+
+# if !defined(OCTAVE_API_VERSION_NUMBER)
+
+// Hack to distinguish between Octave 3.8.0, which removed OCTAVE_API_VERSION_NUMBER but did not yet
+// introduce OCTAVE_MAJOR_VERSION, and Octave <= 3.2, which did not define OCTAVE_API_VERSION_NUMBER
+# include <octave/ov.h>
+# if defined(octave_ov_h)
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 8
+# define OCTAVE_PATCH_VERSION 0
+# else
+
+// Hack to distinguish between Octave 3.2 and earlier versions, before OCTAVE_API_VERSION_NUMBER existed
+# define ComplexLU __ignore
+# include <octave/CmplxLU.h>
+# undef ComplexLU
+# if defined(octave_Complex_LU_h)
+
+// We know only that this version is prior to Octave 3.2, i.e. OCTAVE_API_VERSION_NUMBER < 37
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 1
+# define OCTAVE_PATCH_VERSION 99
+
+# else
+
+// OCTAVE_API_VERSION_NUMBER == 37
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 2
+# define OCTAVE_PATCH_VERSION 0
+
+# endif // defined(octave_Complex_LU_h)
+
+# endif // defined(octave_ov_h)
-#if OCTAVE_API_VERSION_NUMBER < 37
+// Correlation between Octave API and version numbers extracted from Octave's
+// ChangeLogs; version is the *earliest* released Octave with that API number
+# elif OCTAVE_API_VERSION_NUMBER >= 48
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 6
+# define OCTAVE_PATCH_VERSION 0
+
+# elif OCTAVE_API_VERSION_NUMBER >= 45
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 4
+# define OCTAVE_PATCH_VERSION 1
+
+# elif OCTAVE_API_VERSION_NUMBER >= 42
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 3
+# define OCTAVE_PATCH_VERSION 54
+
+# elif OCTAVE_API_VERSION_NUMBER >= 41
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 3
+# define OCTAVE_PATCH_VERSION 53
+
+# elif OCTAVE_API_VERSION_NUMBER >= 40
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 3
+# define OCTAVE_PATCH_VERSION 52
+
+# elif OCTAVE_API_VERSION_NUMBER >= 39
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 3
+# define OCTAVE_PATCH_VERSION 51
+
+# else // OCTAVE_API_VERSION_NUMBER == 38
+# define OCTAVE_MAJOR_VERSION 3
+# define OCTAVE_MINOR_VERSION 3
+# define OCTAVE_PATCH_VERSION 50
+
+# endif // !defined(OCTAVE_API_VERSION_NUMBER)
+
+#endif // !defined(OCTAVE_MAJOR_VERSION)
+
+#if !SWIG_OCTAVE_PREREQ(3,2,0)
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, FS ## cname, args, nargout, doc)
#else
#define SWIG_DEFUN(cname, wname, doc) DEFUNX_DLD(#cname, wname, G ## cname, args, nargout, doc)
@@ -427,7 +495,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
if (error_state) return dim_vector(1,1);
}
return d;
- } else if (out.is_matrix_type() || out.is_real_nd_array() || out.is_numeric_type() ) {
+ } else if (out.is_matrix_type() || out.is_numeric_type() ) {
if (out.rows()==1 || out.columns()==1) {
Array<int> a = out.int_vector_value();
if (error_state) return dim_vector(1,1);
@@ -746,7 +814,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
return outarg(0).string_value();
}
-#if OCTAVE_API_VERSION_NUMBER >= 40
+#if SWIG_OCTAVE_PREREQ(3,3,52)
virtual octave_map map_value() const {
return octave_map();
}
@@ -982,7 +1050,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
virtual std::string string_value(bool force = false) const
{ return ptr->string_value(force); }
-#if OCTAVE_API_VERSION_NUMBER >= 40
+#if SWIG_OCTAVE_PREREQ(3,3,52)
virtual octave_map map_value() const
{ return ptr->map_value(); }
#else
@@ -1293,10 +1361,12 @@ SWIGRUNTIME void SWIG_Octave_SetGlobalValue(std::string name, const octave_value
}
SWIGRUNTIME void SWIG_Octave_LinkGlobalValue(std::string name) {
-#if OCTAVE_API_VERSION_NUMBER < 37
+#if !SWIG_OCTAVE_PREREQ(3,2,0)
link_to_global_variable(curr_sym_tab->lookup(name, true));
#else
+#if !SWIG_OCTAVE_PREREQ(3,8,0)
symbol_table::varref(name);
+#endif
symbol_table::mark_global(name);
#endif
}
diff --git a/Lib/octave/octruntime.swg b/Lib/octave/octruntime.swg
index 43313c3..fbf2007 100644
--- a/Lib/octave/octruntime.swg
+++ b/Lib/octave/octruntime.swg
@@ -25,7 +25,7 @@ static bool SWIG_init_user(octave_swig_type* module_ns);
SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) {
bool retn;
{
-#if OCTAVE_API_VERSION_NUMBER < 38
+#if !SWIG_OCTAVE_PREREQ(3,3,50)
unwind_protect::begin_frame("SWIG_Octave_LoadModule");
unwind_protect_int(error_state);
unwind_protect_int(warning_state);
@@ -44,7 +44,7 @@ SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) {
discard_warning_messages = true;
feval(name, octave_value_list(), 0);
retn = (error_state == 0);
-#if OCTAVE_API_VERSION_NUMBER < 38
+#if !SWIG_OCTAVE_PREREQ(3,3,50)
unwind_protect::run_frame("SWIG_Octave_LoadModule");
#endif
}
@@ -57,7 +57,7 @@ SWIGINTERN bool SWIG_Octave_LoadModule(std::string name) {
SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::string name) {
bool retn;
{
-#if OCTAVE_API_VERSION_NUMBER < 38
+#if !SWIG_OCTAVE_PREREQ(3,3,50)
unwind_protect::begin_frame("SWIG_Octave_InstallFunction");
unwind_protect_int(error_state);
unwind_protect_int(warning_state);
@@ -80,7 +80,7 @@ SWIGINTERN bool SWIG_Octave_InstallFunction(octave_function *octloadfcn, std::st
error_state = 0;
feval("autoload", args, 0);
retn = (error_state == 0);
-#if OCTAVE_API_VERSION_NUMBER < 38
+#if !SWIG_OCTAVE_PREREQ(3,3,50)
unwind_protect::run_frame("SWIG_Octave_InstallFunction");
#endif
}
@@ -196,7 +196,7 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) {
// definitely affects version 3.2.*, not sure about 3.3.*, seems to be fixed in
// version 3.4.* and above. can be turned off with macro definition.
#ifndef SWIG_OCTAVE_NO_SEGFAULT_HACK
-#if 36 < OCTAVE_API_VERSION_NUMBER && OCTAVE_API_VERSION_NUMBER < 45
+#if SWIG_OCTAVE_PREREQ(3,2,0) && !SWIG_OCTAVE_PREREQ(3,4,1)
octave_exit = ::_Exit;
#endif
#endif
@@ -212,7 +212,7 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) {
// workaround bug in octave where installing global variable of custom type and then
// exiting without explicitly clearing the variable causes octave to segfault.
-#if OCTAVE_API_VERSION_NUMBER > 36
+#if SWIG_OCTAVE_PREREQ(3,2,0)
octave_value_list eval_args;
eval_args.append("base");
eval_args.append("function __swig_atexit__; "
@@ -297,7 +297,7 @@ DEFUN_DLD( SWIG_name, args, nargout, SWIG_name_usage ) {
}
}
-#if OCTAVE_API_VERSION_NUMBER < 37
+#if !SWIG_OCTAVE_PREREQ(3,2,0)
mlock(me->name());
#else
mlock();
--
1.8.5.1

View File

@ -1,3 +1,20 @@
-------------------------------------------------------------------
Sun Feb 9 18:30:13 UTC 2014 - kkaempf@suse.com
- Update to 2.0.12
- This is a maintenance release backporting some fixes from the
pending 3.0.0 release.
- Octave 3.8 support added.
- C++11 support for new versions of erase/insert in the STL
containers.
- Compilation fixes on some systems for the generated Lua, PHP,
Python and R wrappers.
- Drop upstreamed patches:
swig-lua-fix-void-return-for-int-functions.patch
swig-support-octave-3.8.0.patch
ruby-2.0-encoding-utf8.patch
-------------------------------------------------------------------
Wed Jan 29 19:57:02 UTC 2014 - badshah400@gmail.com

View File

@ -17,7 +17,7 @@
Name: swig
Version: 2.0.11
Version: 2.0.12
Release: 0
Summary: Simplified Wrapper and Interface Generator
License: GPL-3.0+ and BSD-3-Clause
@ -27,16 +27,10 @@ Source: http://sourceforge.net/projects/swig/files/swig/%{name}-%{versio
Source1: %{name}.rpmlintrc
# Fix the return type in declaration of caml_array_length
Patch9: swig-fix_ocaml_type.patch
# Ruby 2.0 encodes to UTF-8, SWIG to US-ASCII-8BIT, kkaempf@suse.de
Patch10: ruby-2.0-encoding-utf8.patch
# Fix SWIG object tracking to use C hash, not Ruby Hash, kkaempf@suse.de
Patch11: 0001-Fix-Ruby-tracking-code-to-use-C-hash.patch
# Ruby 1.8.6 (SLE 10) differs in object tracking, kkaempf@suse.de
Patch12: ruby-1.8.6-newobject.patch
# PATCH-FIX-UPSTREAM swig-lua-fix-void-return-for-int-functions.patch bnc#843310 badshah400@gmail.com -- Fix functions returning void when int is expected for lua bindings
Patch13: swig-lua-fix-void-return-for-int-functions.patch
# PATCH-FIX-UPSTREAM swig-support-octave-3.8.0.patch badshah400@gmail.com -- Support octave 3.8.0 (this fixes octave 3.8.0 bindings of several packages failing to build in Factory such as mathgl, plplot, etc.), patch taken from upstream and rebased for current version.
Patch14: swig-support-octave-3.8.0.patch
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: boost-devel
@ -136,14 +130,8 @@ understandig SWIG usage.
# Ruby 1.9 for openSUSE 12.x
%if 0%{?suse_version} >= 1220
%patch11 -p1
# Ruby 2.0 for openSUSE 13.1
%if 0%{?suse_version} > 1230
%patch10 -p1
%endif
%endif
%patch9
%patch13 -p1
%patch14 -p1
%build
%configure --disable-ccache