Permalink
Browse files

Make it work on OSX.

Post Great Merge, needed some stuff to make OSX work.

Rakefile has a few changes relating to getting things to build,
builddeps had a silly bug where the last few lines wouldn't work, and
due to the commit by s3v3n's new feature, cocoa.m needed updating so
that fucntions have the right signature.
  • Loading branch information...
1 parent e62d527 commit d0a954038172bdd95494a5c0857e11e64697cc08 @steveklabnik steveklabnik committed Jul 3, 2010
Showing with 23 additions and 11 deletions.
  1. +8 −3 Rakefile
  2. +1 −0 builddeps.sh
  3. +14 −8 shoes/native/cocoa.m
View
11 Rakefile
@@ -1,7 +1,7 @@
require 'rubygems'
require 'rake'
require 'rake/clean'
-require 'platform/skel'
+require_relative 'platform/skel'
require 'fileutils'
require 'find'
require 'yaml'
@@ -282,6 +282,7 @@ task :build => [:build_os, "dist/VERSION.txt"] do
cp "platform/mac/command-manual.rb", "#{APPNAME}.app/Contents/MacOS/"
rewrite "platform/mac/shoes-launch", "#{APPNAME}.app/Contents/MacOS/#{NAME}-launch"
chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}-launch"
+ chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}-bin"
rewrite "platform/mac/shoes", "#{APPNAME}.app/Contents/MacOS/#{NAME}"
chmod 0755, "#{APPNAME}.app/Contents/MacOS/#{NAME}"
# cp InfoPlist.strings YourApp.app/Contents/Resources/English.lproj/
@@ -439,7 +440,11 @@ else
if Config::CONFIG['rubyhdrdir']
LINUX_CFLAGS << " -I#{Config::CONFIG['rubyhdrdir']} -I#{Config::CONFIG['rubyhdrdir']}/#{RUBY_PLATFORM}"
end
- LINUX_LIB_NAMES = %W[#{ruby_so} cairo pangocairo-1.0 ungif]
+ if RUBY_PLATFORM =~ /darwin/
+ LINUX_LIB_NAMES = %W[#{ruby_so} cairo pangocairo-1.0 gif]
+ else
+ LINUX_LIB_NAMES = %W[#{ruby_so} cairo pangocairo-1.0 ungif]
+ end
FLAGS.each do |flag|
LINUX_CFLAGS << " -D#{flag}" if ENV[flag]
end
@@ -528,7 +533,7 @@ else
rm_f t.name
rm_f bin
if RUBY_PLATFORM =~ /darwin/
- sh "#{CC} -Ldist -o #{bin} bin/main.o #{LINUX_LIBS} -lshoes -arch i386 -m32"
+ sh "#{CC} -Ldist -o #{bin} bin/main.o #{LINUX_LIBS} -lshoes -arch x86_64"
else
sh "#{CC} -Ldist -o #{bin} bin/main.o #{LINUX_LIBS} -lshoes #{Config::CONFIG['LDFLAGS']}"
rewrite "platform/nix/shoes.launch", t.name, %r!/shoes-bin!, "/#{NAME}-bin"
View
1 builddeps.sh
@@ -95,6 +95,7 @@ cd ../ruby-1.9.1-p378
make && make install
#install RubyGems.
+cd ../rubygems-1.3.6
/tmp/dep/bin/ruby setup.rb
#install rake.
View
22 shoes/native/cocoa.m
@@ -1499,7 +1499,7 @@ void shoes_cairo_destroy(shoes_canvas *canvas)
}
static VALUE
-shoes_dialog_chooser(VALUE self, NSString *title, BOOL directories)
+shoes_dialog_chooser(VALUE self, NSString *title, BOOL directories, VALUE attr)
{
VALUE path = Qnil;
COCOA_DO({
@@ -1518,13 +1518,15 @@ void shoes_cairo_destroy(shoes_canvas *canvas)
}
VALUE
-shoes_dialog_open(VALUE self)
+shoes_dialog_open(int argc, VALUE *argv, VALUE self)
{
- return shoes_dialog_chooser(self, @"Open file...", NO);
+ rb_arg_list args;
+ rb_parse_args(argc, argv, "|h", &args);
+ return shoes_dialog_chooser(self, @"Open file...", NO, args.a[0]);
}
VALUE
-shoes_dialog_save(VALUE self)
+shoes_dialog_save(int argc, VALUE *argv, VALUE self)
{
VALUE path = Qnil;
COCOA_DO({
@@ -1539,13 +1541,17 @@ void shoes_cairo_destroy(shoes_canvas *canvas)
}
VALUE
-shoes_dialog_open_folder(VALUE self)
+shoes_dialog_open_folder(int argc, VALUE *argv, VALUE self)
{
- return shoes_dialog_chooser(self, @"Open folder...", YES);
+ rb_arg_list args;
+ rb_parse_args(argc, argv, "|h", &args);
+ return shoes_dialog_chooser(self, @"Open folder...", YES, args.a[0]);
}
VALUE
-shoes_dialog_save_folder(VALUE self)
+shoes_dialog_save_folder(int argc, VALUE *argv, VALUE self)
{
- return shoes_dialog_chooser(self, @"Save folder...", YES);
+ rb_arg_list args;
+ rb_parse_args(argc, argv, "|h", &args);
+ return shoes_dialog_chooser(self, @"Save folder...", YES, args.a[0]);
}

0 comments on commit d0a9540

Please sign in to comment.