summaryrefslogtreecommitdiff
path: root/data/rubyobjc_/port.diff
diff options
context:
space:
mode:
Diffstat (limited to 'data/rubyobjc_/port.diff')
-rw-r--r--data/rubyobjc_/port.diff134
1 files changed, 134 insertions, 0 deletions
diff --git a/data/rubyobjc_/port.diff b/data/rubyobjc_/port.diff
new file mode 100644
index 000000000..d27368c90
--- /dev/null
+++ b/data/rubyobjc_/port.diff
@@ -0,0 +1,134 @@
+diff -ru rubyobjc-4/objc/objc_builtin.rm rubyobjc-4+iPhone/objc/objc_builtin.rm
+--- rubyobjc-4/objc/objc_builtin.rm 2007-06-11 02:29:52.000000000 +0000
++++ rubyobjc-4+iPhone/objc/objc_builtin.rm 2008-03-20 00:42:37.000000000 +0000
+@@ -10,20 +10,12 @@
+ #import "rubyobjc.h"
+
+ <%
+-begin
+- require 'rubygems'
+- require 'objc'
+- raise LoadError unless ObjC.require :bf
+- rails NameError unless ObjC::BF
+- BLOWFISH = true
+-rescue LoadError, NameError
+- BLOWFISH = false
+-end
++BLOWFISH = false
+
+ $filelength = {}
+
+-FIRST_SHIFT = 99
+-SHIFT_STEP = 109
++FIRST_SHIFT = 0
++SHIFT_STEP = 0
+ KEY = "RubyObjC. Copyright 2007, Neon Design Technology, Inc."
+
+ def file_as_string(modulename, filename)
+@@ -64,7 +56,7 @@
+ end
+
+ private_modules = ["ObjC", "generator"]
+-public_modules = ["Foundation", "AppKit", "console", "menu", "nibtools"]
++public_modules = ["Foundation", "UIKit"]
+ modules = private_modules + public_modules
+
+ modules.each {|m|
+diff -ru rubyobjc-4/objc/rubyobjc.h rubyobjc-4+iPhone/objc/rubyobjc.h
+--- rubyobjc-4/objc/rubyobjc.h 2007-06-11 02:29:52.000000000 +0000
++++ rubyobjc-4+iPhone/objc/rubyobjc.h 2008-03-20 00:21:59.000000000 +0000
+@@ -16,7 +16,7 @@
+ #else
+ #import "tiger_runtime.h"
+ #endif
+-#import <Cocoa/Cocoa.h>
++#include <Foundation/Foundation.h>
+ #import <ruby.h>
+ #include <string.h>
+ #include "ffi.h"
+@@ -95,4 +95,4 @@
+ void remove_methods(VALUE class, const char *methodsToRemove[], int count);
+
+ #include "st.h"
+-st_table *objc_method_calls;
+\ No newline at end of file
++st_table *objc_method_calls;
+diff -ru rubyobjc-4/objc/rubyobjc.m rubyobjc-4+iPhone/objc/rubyobjc.m
+--- rubyobjc-4/objc/rubyobjc.m 2007-06-11 02:29:52.000000000 +0000
++++ rubyobjc-4+iPhone/objc/rubyobjc.m 2008-03-20 00:49:53.000000000 +0000
+@@ -32,8 +32,6 @@
+ #import "rubyobjc.h"
+ #include <dlfcn.h>
+
+-VALUE module_require(int argc, VALUE *argv, VALUE self);
+-
+ VALUE objc_verbose = Qnil;
+ VALUE objc_module;
+ long ruby_to_objc_calls = 0;
+@@ -218,8 +216,6 @@
+ */
+ VALUE module_set_path(VALUE self, VALUE path)
+ {
+- VALUE name = rb_str_new2("ObjC");
+- module_require(1, &name, objc_module);
+ return rb_funcall(self, rb_intern("_set_path"), 1, path);
+ }
+
+@@ -244,12 +240,9 @@
+ rb_define_module_function(objc_module, "objc_method_calls", module_method_calls, 0);
+ rb_define_module_function(objc_module, "objc_method_tracking", module_method_tracking, 0);
+ rb_define_module_function(objc_module, "objc_method_tracking=", module_set_method_tracking, 1);
+- Init_ObjC_Builtin(objc_module);
+ }
+
+ void Init_objc()
+ {
+ Init_objc_base();
+- VALUE name = rb_str_new2("ObjC");
+- module_require(1, &name, objc_module);
+ }
+diff -ru rubyobjc-4/ruby/bridge.rb rubyobjc-4+iPhone/ruby/bridge.rb
+--- rubyobjc-4/ruby/bridge.rb 2007-06-11 02:29:52.000000000 +0000
++++ rubyobjc-4+iPhone/ruby/bridge.rb 2008-03-20 01:08:24.000000000 +0000
+@@ -31,25 +31,20 @@
+
+ if __FILE__ == $0
+ framework = ARGV[0]
+- filename = "/System/Library/Frameworks/#{framework.capitalize}.framework/Versions/C/Resources/BridgeSupport.xml"
+ case framework
+ when "foundation":
+ puts <<-END
+ ObjC.add_function(ObjC::Function.wrap('NSLog', 'v', ['@']))
+ END
+- when "appkit":
++ filename = "../bridged/Foundation.xml"
++ when "uikit":
+ puts <<-END
+- ObjC::NSApplication.sharedApplication
+- ObjC.add_function(ObjC::Function.wrap('NSApplicationMain', 'i', %w{i ^*}))
+- ObjC.add_function(ObjC::Function.wrap('NSBeep', 'v', nil))
+- ObjC.add_function(ObjC::Function.wrap('NSRectFill', 'v', %w{{_NSRect={_NSPoint=ff}{_NSSize=ff}}}))
++ ObjC.add_function(ObjC::Function.wrap('UIApplicationMain', 'i', %w{i ^*}, '#'))
+ END
++ filename = "../bridged/UIKit.xml"
+ end
+ if File.exist? filename
+ puts Bridge.convert(filename)
+- else
+- filename = "../bridged/#{framework.capitalize}.xml"
+- puts Bridge.convert(filename) if File.exist? filename
+ end
+
+ end
+diff -ru rubyobjc-4/ruby/objc.rb rubyobjc-4+iPhone/ruby/objc.rb
+--- rubyobjc-4/ruby/objc.rb 2007-06-11 02:29:52.000000000 +0000
++++ rubyobjc-4+iPhone/ruby/objc.rb 2008-03-20 00:32:13.000000000 +0000
+@@ -8,6 +8,8 @@
+ # For more information about this file, visit http://www.rubyobjc.com.
+ #
+
++require 'objc.so'
++
+ # Don't wait for this to be loaded with a framework
+ ObjC.add_function(ObjC::Function.wrap('NSLog', 'v', ['@']))
+