Files
gentoo/dev-ruby/RubyInline/files/ruby-inline-3.12.2-gentoo.patch
Robin H. Johnson 56bd759df1 proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.

This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.

Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.

Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
2015-08-08 17:38:18 -07:00

68 lines
2.5 KiB
Diff

we have to patch the code so that it takes the RUBY_DESCRIPTION into
consideration, to avoid loading Ruby-Enterprise (REE18) objects in MRI
and vice-versa; we're a bit “greedier” since we will rebuild objects
even when just switching versions, but it'll be better this way than
being too conservatives.
Index: ruby-inline-3.8.4/lib/inline.rb
===================================================================
--- ruby-inline-3.8.4.orig/lib/inline.rb
+++ ruby-inline-3.8.4/lib/inline.rb
@@ -360,13 +360,18 @@ module Inline
ext.join "\n"
end
+ def implementation_checksum
+ @implementation_checksum ||=
+ (Digest::MD5.new << RUBY_DESCRIPTION).to_s[0,4]
+ end
+
def module_name
unless defined? @module_name then
module_name = @mod.name.gsub('::','__')
md5 = Digest::MD5.new
@pre.each { |m| md5 << m.to_s }
@sig.keys.sort_by { |x| x.to_s }.each { |m| md5 << m.to_s }
- @module_name = "Inline_#{module_name}_#{md5}"
+ @module_name = "Inline_#{module_name}_#{md5}_#{implementation_checksum}"
end
@module_name
end
Index: ruby-inline-3.8.4/test/test_inline.rb
===================================================================
--- ruby-inline-3.8.4.orig/test/test_inline.rb
+++ ruby-inline-3.8.4/test/test_inline.rb
@@ -404,6 +404,7 @@ static VALUE method_name_equals(VALUE se
end
def util_module_name(*signatures)
+ implementation = (Digest::MD5.new << RUBY_DESCRIPTION).to_s[0,4]
md5 = Digest::MD5.new
signatures.each do |signature|
@@ -411,6 +412,6 @@ static VALUE method_name_equals(VALUE se
md5 << signature.to_s
end
- assert_equal("Inline_TestInline__TestC_#{md5}", @builder.module_name)
+ assert_equal("Inline_TestInline__TestC_#{md5}_#{implementation}", @builder.module_name)
end
@@ -757,6 +758,7 @@ puts(s); return rb_str_new2(s)}"
@builder.c "VALUE my_method() { return Qnil; }"
windoze = "\n __declspec(dllexport)" if Inline::WINDOZE
+ implementation = (Digest::MD5.new << RUBY_DESCRIPTION).to_s[0,4]
expected = <<-EXT
#include "ruby.h"
@@ -773,7 +775,7 @@ static VALUE my_method(VALUE self) {
#ifdef __cplusplus
extern \"C\" {
#endif#{windoze}
- void Init_Inline_TestInline__TestC_3ab8c09639e499394bb1f0a0194a839f() {
+ void Init_Inline_TestInline__TestC_3ab8c09639e499394bb1f0a0194a839f_#{implementation}() {
VALUE c = rb_cObject;
c = rb_const_get(c, rb_intern("TestInline"));
c = rb_const_get(c, rb_intern("TestC"));