Ruby/SDL on Mac OS X
目的
大林さんの開発されている Ruby/SDLを Mac OS X上で動かそうと試みるページです。
linuxなどではソースを取ってきてコンパイル/インストールするだけですぐに使えるようになるのですが、残念ながらOSXではそのままでは動作せず、標準でインストールされているrubyコマンドの代わりに rubywというコマンドを新たに作り、それを使う必要があります。
このページでは以下の事項について解説しています。
- rubywのインストールまでの手順
- Ruby/SDLのインストール手順
なお、SDLやSMPEGは finkでインストールしていることを前提としています。finkcommanderで簡単にインストールすることができます。
Install rubyw
download Ruby 1.8.2 source
Download Ruby-1.8.2 source from http://www.ruby-lang.org/ , and extract it.
$ tar zxfv ruby-1.8.2.tar.gz
download rubyw patch
from here.
ruby-1.8.2-OSX-rubyw.patch(606)
$ cd ruby-1.8.2 $ patch -p1 < ruby-1.8.2-OSX-rubyw.patch
compile and install
$ ./configure --build=powerpc-darwin8.0 --prefix=/usr $ make rubyw $ strip -x -S rubyw $ sudo install -c -p -m 0755 rubyw /usr/bin/
Install SDL
use fink!
Install Ruby/SDL
preparation
$ cd /usr/lib/ruby/1.8/powerpc-darwin8.0 $ sudo ln -s ../universal-darwin8.0/*.h .
download source
from http://www.kmc.gr.jp/~ohai/rubysdl_download.html
$ tar zxfv rubysdl-1.0.0.tar.gz
compile rubysdl
$ cd rubysdl-1.0.0 $ ruby extconf.rb
and you need to edit Makefile before compile.
CFLAGS = -fno-common -g -Os -pipe -fno-common -I/sw/include -I/sw/include/SDL -D_THREAD_SAFE -D DEF_EVENT2 -D HAVE_SMPEG -D HAVE_SDL_MIXER -D HAVE_SDL_IMAGE -D HAVE_SDL_TTF -D DEF_OPENGL
install
$ sudo make install
