Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Zanfa/mruby-iOS

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
6 Commits
 
 
 
 

Repository files navigation

mruby-iOS

A build_config.rb to cross-compile mruby for iOS applications.

# cd to your mruby src path
cd ~/Downloads/mruby-1.0.0

# Compile mrbuy with this build_config.rb
MRUBY_CONFIG=(PATH_TO_THIS_REPO)/build_config.rb ./minirake

# Navigate to built libraries
cd build

This should have generated build/iphone-sim, build/iphone-armv7 and build/iphone-armv7s directories. Copy the required libmruby.a from build/iphone-*/lib paths to your projects and enjoy. You only need build/iphone-sim/lib/libmruby.a if you're using the iOS simulator, and don't forget to copy the headers from include/ path as well

RubyMotion

To use mruby in a RubyMotion project, do the following:

  1. Build mruby as explained above

  2. Create a new directory vendor/mruby in your RubyMotion project

  3. Copy libmruby.a from build/iphone-sim/lib/libmruby.a to the vendor/mruby directory

  4. Copy everything inside include/ dir to you vendor/mruby directory as well

  5. Add the following line to your RubyMotion Rakefile

    app.vendor_project('vendor/mruby', :static)

  6. Use mruby in your application. For example use this in your app_delegate.rb:

    mrb = Pointer.new(:object) mrb[0] = mrb_open() mrb_load_string(mrb[0], "class TestClass; end") puts mrb_class_defined(mrb[0], "TestClass") # Should output 1 in the console

  7. Run rake and look at the console

  8. To run on actual devices, you need to copy for build/iphone-armv7/lib/libmruby.a and build/iphone-armv7s/lib/libmruby.a to vendor/mruby as well

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.