[rubygem-therubyracer] Add patch that fixes bignum operations on Ruby 2.0.

Bohuslav Kabrda bkabrda at fedoraproject.org
Thu Mar 7 11:45:38 UTC 2013


commit f2e055168d4889dda6197a362d8d7ea9b213ccbd
Author: Bohuslav Kabrda <bkabrda at redhat.com>
Date:   Thu Mar 7 12:45:32 2013 +0100

    Add patch that fixes bignum operations on Ruby 2.0.

 ...therubyracer-0.11.1-fix-bignum-conversion.patch |   42 ++++++++++++++++++++
 rubygem-therubyracer.spec                          |   10 ++++-
 2 files changed, 51 insertions(+), 1 deletions(-)
---
diff --git a/rubygem-therubyracer-0.11.1-fix-bignum-conversion.patch b/rubygem-therubyracer-0.11.1-fix-bignum-conversion.patch
new file mode 100644
index 0000000..0422b96
--- /dev/null
+++ b/rubygem-therubyracer-0.11.1-fix-bignum-conversion.patch
@@ -0,0 +1,42 @@
+diff --git a/lib/v8.rb b/lib/v8.rb
+index 892550a..1546add 100644
+--- a/lib/v8.rb
++++ b/lib/v8.rb
+@@ -19,6 +19,7 @@ require 'v8/conversion/method'
+ require 'v8/conversion/symbol'
+ require 'v8/conversion/string'
+ require 'v8/conversion/fixnum'
++require 'v8/conversion/bignum'
+ require 'v8/conversion'
+ require 'v8/access/names'
+ require 'v8/access/indices'
+diff --git a/lib/v8/conversion.rb b/lib/v8/conversion.rb
+index 3c2518b..f8739c9 100644
+--- a/lib/v8/conversion.rb
++++ b/lib/v8/conversion.rb
+@@ -18,7 +18,7 @@ for type in [TrueClass, FalseClass, NilClass, Float] do
+   end
+ end
+ 
+-for type in [Class, Object, Array, Hash, String, Symbol, Time, Proc, Method, Fixnum] do
++for type in [Class, Object, Array, Hash, String, Symbol, Time, Proc, Method, Fixnum, Bignum] do
+   type.class_eval do
+     include V8::Conversion.const_get(type.name)
+   end
+diff --git a/lib/v8/conversion/bignum.rb b/lib/v8/conversion/bignum.rb
+new file mode 100644
+index 0000000..4b64125
+--- /dev/null
++++ b/lib/v8/conversion/bignum.rb
+@@ -0,0 +1,11 @@
++class V8::Conversion
++  module Bignum
++    def to_ruby
++      self
++    end
++
++    def to_v8
++      self.to_f.to_v8
++    end
++  end
++end
diff --git a/rubygem-therubyracer.spec b/rubygem-therubyracer.spec
index dbfd16a..ea234b8 100644
--- a/rubygem-therubyracer.spec
+++ b/rubygem-therubyracer.spec
@@ -1,7 +1,7 @@
 %global gem_name therubyracer
 
 %global majorver 0.11.0
-%global release 1
+%global release 2
 #%%global preminorver beta5
 %global fullver %{majorver}%{?preminorver}
 
@@ -19,6 +19,7 @@ Group: Development/Languages
 License: MIT
 URL: http://github.com/cowboyd/therubyracer
 Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?preminorver}.gem
+Patch0: %{name}-0.11.1-fix-bignum-conversion.patch
 Requires: ruby(release)
 Requires: rubygem(ref)
 Requires: ruby(rubygems)
@@ -54,6 +55,10 @@ Documentation for %{name}
 %setup -q -c -T
 %gem_install -n %{SOURCE0}
 
+pushd .%{gem_instdir}
+%patch0 -p1
+popd
+
 %build
 
 %install
@@ -104,6 +109,9 @@ popd
 %{gem_instdir}/therubyracer.gemspec
 
 %changelog
+* Thu Mar 07 2013 Bohuslav Kabrda <bkabrda at redhat.com> - 0.11.0-2
+- Add patch that fixes bignum operations on Ruby 2.0.
+
 * Thu Mar 07 2013 Bohuslav Kabrda <bkabrda at redhat.com> - 0.11.0-1
 - Updated to 0.11.0 final.
 


More information about the scm-commits mailing list