From 5961c79b1c8238bed45cfdc5e0d2795553be3f9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Mon, 3 Sep 2012 14:44:25 +0200 Subject: [PATCH] Upgrade to Ruby 2.0.0 (r36887). --- ...0-r36832-rb_float_value-optimization.patch | 46 +++++++++++++++++++ ruby.spec | 12 +++-- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 ruby-2.0-r36832-rb_float_value-optimization.patch diff --git a/ruby-2.0-r36832-rb_float_value-optimization.patch b/ruby-2.0-r36832-rb_float_value-optimization.patch new file mode 100644 index 0000000..97dc58b --- /dev/null +++ b/ruby-2.0-r36832-rb_float_value-optimization.patch @@ -0,0 +1,46 @@ +From 0b89d6d5f9f8c788f4391d8a0499f10aed624371 Mon Sep 17 00:00:00 2001 +From: ko1 +Date: Mon, 27 Aug 2012 09:22:21 +0000 +Subject: [PATCH] * include/ruby/ruby.h (rb_float_value): optimize it. This + technique was pointed by shinichiro.hamaji + . + +git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e +--- + ChangeLog | 6 ++++++ + include/ruby/ruby.h | 10 +++++----- + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h +index 3905b32..b8b2267 100644 +--- a/include/ruby/ruby.h ++++ b/include/ruby/ruby.h +@@ -733,10 +733,7 @@ struct RFloat { + rb_float_value(VALUE v) + { + if (FLONUM_P(v)) { +- if (v == (VALUE)0x8000000000000002) { +- return 0.0; +- } +- else { ++ if (v != (VALUE)0x8000000000000002) { /* LIKELY */ + union { + double d; + VALUE v; +@@ -746,9 +743,12 @@ struct RFloat { + /* e: xx1... -> 011... */ + /* xx0... -> 100... */ + /* ^b63 */ +- t.v = RUBY_BIT_ROTR(((b63 ^ 1) << 1) | b63 | (v & ~0x03), 3); ++ t.v = RUBY_BIT_ROTR(2 - b63 | (v & ~0x03), 3); + return t.d; + } ++ else { ++ return 0.0; ++ } + } + else { + return ((struct RFloat *)v)->float_value; +-- +1.7.10 + diff --git a/ruby.spec b/ruby.spec index 7dfe04f..3e3449e 100644 --- a/ruby.spec +++ b/ruby.spec @@ -13,7 +13,7 @@ # If revision is removed/commented out, the official release build is expected. # Keep the revision enabled for pre-releases from SVN. -%global revision 36213 +%global revision 36887 %global release 1 @@ -52,7 +52,7 @@ %global bigdecimal_version 1.1.0 %global io_console_version 0.3 %global json_version 1.7.1 -%global minitest_version 3.0.0 +%global minitest_version 3.3.0 %global _normalized_cpu %(echo %{_target_cpu} | sed 's/^ppc/powerpc/;s/i.86/i386/;s/sparcv./sparc/') @@ -109,6 +109,10 @@ Patch12: ruby-1.9.3-mkmf-verbose.patch # TODO: Should be probably upstreamed with #5281. Patch14: ruby-2.0.0-Expand-ruby.pc-variable-by-configuration-process.patch +# This patch breaks a test suite, so revert it for now. +# https://bugs.ruby-lang.org/issues/6971 +Patch100: ruby-2.0-r36832-rb_float_value-optimization.patch + Requires: %{name}-libs%{?_isa} = %{version}-%{release} Requires: ruby(rubygems) >= %{rubygems_version} # Make the bigdecimal gem a runtime dependency of Ruby to avoid problems @@ -359,6 +363,8 @@ Tcl/Tk interface for the object-oriented scripting language Ruby. #%%patch13 -p1 %patch14 -p1 +%patch100 -p1 -R + %build autoconf @@ -581,7 +587,6 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libdir}/ripper %{ruby_libdir}/rss %{ruby_libdir}/shell -%{ruby_libdir}/syck %{ruby_libdir}/syslog %{ruby_libdir}/test %exclude %{ruby_libdir}/tk @@ -690,7 +695,6 @@ make check TESTS="-v $DISABLE_TESTS" %{ruby_libarchdir}/socket.so %{ruby_libarchdir}/stringio.so %{ruby_libarchdir}/strscan.so -%{ruby_libarchdir}/syck.so %{ruby_libarchdir}/syslog.so %exclude %{ruby_libarchdir}/tcltklib.so %exclude %{ruby_libarchdir}/tkutil.so