- generate guile 2 friendly code

OBS-URL: https://build.opensuse.org/package/show/devel:tools:building/swig?expand=0&rev=25
This commit is contained in:
Petr Gajdos 2011-12-05 15:48:36 +00:00 committed by Git OBS Bridge
parent bd2b7fea26
commit f163bfcab1
3 changed files with 36 additions and 0 deletions

25
swig-2.0.4-guile2.patch Normal file
View File

@ -0,0 +1,25 @@
Index: swig-2.0.4/Lib/guile/guile_scm_run.swg
===================================================================
--- swig-2.0.4.orig/Lib/guile/guile_scm_run.swg
+++ swig-2.0.4/Lib/guile/guile_scm_run.swg
@@ -60,16 +60,17 @@ static swig_module_info *SWIG_Guile_GetM
SWIGINTERN char *
SWIG_Guile_scm2newstr(SCM str, size_t *len) {
#define FUNC_NAME "SWIG_Guile_scm2newstr"
- char *ret;
+ char *ret, *tmp;
size_t l;
SCM_ASSERT (SCM_STRINGP(str), str, 1, FUNC_NAME);
- l = SCM_STRING_LENGTH(str);
+ tmp = scm_to_utf8_string(str);
+ memcpy(ret, tmp, l);
+ free(tmp);
ret = (char *) SWIG_malloc( (l + 1) * sizeof(char));
if (!ret) return NULL;
- memcpy(ret, SCM_STRING_CHARS(str), l);
ret[l] = '\0';
if (len) *len = l;
return ret;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Mon Dec 5 13:37:26 UTC 2011 - pgajdos@suse.com
- generate guile 2 friendly code
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Sep 20 09:31:28 UTC 2011 - kkaempf@suse.com Tue Sep 20 09:31:28 UTC 2011 - kkaempf@suse.com

View File

@ -65,6 +65,8 @@ Patch2: swig-2.0.4-ptrdiff_t.patch
Patch3: swig-2.0.4-disable-broken-tests.patch Patch3: swig-2.0.4-disable-broken-tests.patch
# swig-2.0.4-disable-broken-tests_rhel4.patch kkaempf@suse.com -- disable tests failing on RHEL4 # swig-2.0.4-disable-broken-tests_rhel4.patch kkaempf@suse.com -- disable tests failing on RHEL4
Patch4: swig-2.0.4-disable-broken-tests_rhel4.patch Patch4: swig-2.0.4-disable-broken-tests_rhel4.patch
# PATCH-FIX-UPSTREAM swig-2.0.4-guile2.patch pgajdos@suse.com -- generate guile 2 friendly code
Patch5: swig-2.0.4-guile2.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description %description
@ -125,6 +127,10 @@ understandig SWIG usage.
%if 0%{?rhel_version} >= 400 && 0%{?rhel_version} < 500 %if 0%{?rhel_version} >= 400 && 0%{?rhel_version} < 500
%patch4 -p1 %patch4 -p1
%endif %endif
# guile 2 from 12.1
%if 0%{?suse_version} >= 1210
%patch5 -p1
%endif
%build %build
%configure --disable-ccache %configure --disable-ccache