diff --git a/adapt-perl512.diff b/adapt-perl512.diff deleted file mode 100644 index 9516430..0000000 --- a/adapt-perl512.diff +++ /dev/null @@ -1,20 +0,0 @@ -Index: swig-1.3.40/Lib/perl5/perlrun.swg -=================================================================== ---- swig-1.3.40.orig/Lib/perl5/perlrun.swg 2009-08-14 23:05:06.000000000 +0200 -+++ swig-1.3.40/Lib/perl5/perlrun.swg 2010-04-06 15:07:29.000000000 +0200 -@@ -272,6 +272,7 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PE - } else if (! SvOK(sv)) { /* Check for undef */ - *(ptr) = (void *) 0; - return SWIG_OK; -+#if PERL_VERSION < 12 - } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ - if (!SvROK(sv)) { - *(ptr) = (void *) 0; -@@ -279,6 +280,7 @@ SWIG_Perl_ConvertPtrAndOwn(SWIG_MAYBE_PE - } else { - return SWIG_ERROR; - } -+#endif - } else { /* Don't know what it is */ - return SWIG_ERROR; - } diff --git a/swig-2.0.3-perl512.patch b/swig-2.0.3-perl512.patch new file mode 100644 index 0000000..c7f7de0 --- /dev/null +++ b/swig-2.0.3-perl512.patch @@ -0,0 +1,19 @@ +--- trunk/Lib/perl5/perlrun.swg 2011/05/19 18:48:57 12690 ++++ trunk/Lib/perl5/perlrun.swg 2011/05/19 19:31:39 12691 +@@ -274,8 +274,14 @@ + return SWIG_OK; + } else if (SvTYPE(sv) == SVt_RV) { /* Check for NULL pointer */ + if (!SvROK(sv)) { +- *(ptr) = (void *) 0; +- return SWIG_OK; ++ /* In Perl 5.12 and later, SVt_RV == SVt_IV, so sv could be a valid integer value. */ ++ if (SvIOK(sv)) { ++ return SWIG_ERROR; ++ } else { ++ /* NULL pointer (reference to undef). */ ++ *(ptr) = (void *) 0; ++ return SWIG_OK; ++ } + } else { + return SWIG_ERROR; + } diff --git a/swig-2.0.3-perl514.patch b/swig-2.0.3-perl514.patch new file mode 100644 index 0000000..b224989 --- /dev/null +++ b/swig-2.0.3-perl514.patch @@ -0,0 +1,46 @@ +--- swig-2.0.3/Examples/test-suite/perl5/li_std_string_runme.pl 2008-06-24 22:11:46.000000000 +0200 ++++ swig-2.0.3/Examples/test-suite/perl5/li_std_string_runme.pl 2011-05-19 10:29:07.285003422 +0200 +@@ -48,7 +48,7 @@ + + # Check throw exception specification + eval { li_std_string::test_throw() }; +-is($@, "test_throw message", "Test 5"); ++like($@, qr/^test_throw message/, "Test 5"); + { local $TODO = "why is the error not a Perl string?"; + eval { li_std_string::test_const_reference_throw() }; + is($@, "", "Test 6"); +--- swig-2.0.3/Examples/test-suite/perl5/default_args_runme.pl 2008-04-30 23:02:46.000000000 +0200 ++++ swig-2.0.3/Examples/test-suite/perl5/default_args_runme.pl 2011-05-19 10:42:21.205003460 +0200 +@@ -41,11 +41,11 @@ + + # exception specifications + eval { default_args::exceptionspec() }; +-is($@, "ciao", "exceptionspec 1"); ++like($@, qr/^ciao/, "exceptionspec 1"); + eval { default_args::exceptionspec(-1) }; +-is($@, "ciao", "exceptionspec 2"); ++like($@, qr/^ciao/, "exceptionspec 2"); + eval { default_args::exceptionspec(100) }; +-is($@, '100', "exceptionspec 3"); ++like($@, qr/^100/, "exceptionspec 3"); + + my $ex = new default_args::Except($false); + +@@ -54,13 +54,13 @@ + # a zero was thrown, an exception occured, but $@ is false + is($hit, 0, "exspec 1"); + eval { $ex->exspec(-1) }; +-is($@, "ciao", "exspec 2"); ++like($@, qr/^ciao/, "exspec 2"); + eval { $ex->exspec(100) }; +-is($@, 100, "exspec 3"); ++like($@, qr/^100/, "exspec 3"); + eval { $ex = default_args::Except->new($true) }; +-is($@, -1, "Except constructor 1"); ++like($@, qr/^-1/, "Except constructor 1"); + eval { $ex = default_args::Except->new($true, -2) }; +-is($@, -2, "Except constructor 2"); ++like($@, qr/^-2/, "Except constructor 2"); + + #Default parameters in static class methods + is(default_args::Statics::staticmethod(), 60, "staticmethod 1"); diff --git a/swig.changes b/swig.changes index b77f933..fc19b94 100644 --- a/swig.changes +++ b/swig.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu May 19 19:50:42 UTC 2011 - idoenmez@novell.com + +- Drop adapt-perl512.diff and replace it with swig-2.0.3-perl512.patch + which is applied upstream. + +------------------------------------------------------------------- +Thu May 19 08:47:42 UTC 2011 - idoenmez@novell.com + +- Add swig-2.0.3-perl514.patch: fix test failures with Perl 5.14 + ------------------------------------------------------------------- Mon May 2 15:36:04 UTC 2011 - idoenmez@novell.com diff --git a/swig.spec b/swig.spec index d165470..9b1b14a 100644 --- a/swig.spec +++ b/swig.spec @@ -54,13 +54,16 @@ Summary: Simplified Wrapper and Interface Generator Url: http://www.swig.org Group: Development/Languages/C and C++ Source: swig-%{version}.tar.bz2 -Patch1: adapt-perl512.diff +# PATCH-FIX-UPSTREAM swig-2.0.3-perl512.patch idoenmez@suse.de -- Upstream bug #3260265 +Patch1: swig-2.0.3-perl512.patch # PATCH-FIX-UPSTREAM swig-2.0.3-disable-broken-tests.patch idoenmez@suse.de -- Disable broken tests Patch2: swig-2.0.3-disable-broken-tests.patch # PATCH-FIX-UPSTREAM swig-2.0.3-use-python-capsule-api.patch idoenmez@suse.de -- Use Python capsule api Patch3: swig-2.0.3-use-python-capsule-api.patch # PATCH-FIX-UPSTREAM swig-2.0.3-support-python32.patch idoenmez@suse.de -- Support Python 3.2 Patch4: swig-2.0.3-support-python32.patch +# PATCH-FIX-UPSTREAM swig-2.0.3-perl514.patch idoenmez@suse.de -- Fix Perl 5.14 test failure +Patch5: swig-2.0.3-perl514.patch BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -119,6 +122,7 @@ understandig SWIG usage. %patch2 %patch3 -p1 %patch4 -p1 +%patch5 -p1 %build ./autogen.sh