I couldn’t see any info describing this process on the web, so i’m
posting it here, feel free to copy it into any wikis or how-tos or
anything.
You’ll need X11 installed (I’ve used the apple packages, make sure you
install the user & SDK packages), plus the ‘glut’ package from fink
(http://www.fink.sourceforge.net). I’m also assuming that fink puts
its files into /sw (that’s the default). Download the opengl package
from the RAA and extract it.
-
run ‘ruby extconf.rb’ to generate the makefiles
-
edit Makefile.glut:
- add “-I/sw/include” to CPPFLAGS
- add “-L/sw/lib” to DLDFLAGS
- replace “libruby.a” with “-lruby” in LIBS
-
edit Makefule.ogl:
- replace “libruby.a” with “-lruby” in LIBS
-
run ‘make’ - it should now compile fine, you’ll get some parse
errors probably, and something about glutKeyboard that always seems to
appear - don’t worry about it. -
run ‘sudo make install’ to install the library
You should now be able to run the samples. Don’t forget to either run
ruby from the X11 xterm, or have X11 running and your DISPLAY variable
setup in the Mac OS Terminal (i.e. ’ setenv DISPLAY “:0.0” ')
More on how to integrate this with FXRuby as i figure it out.
[Background info: I’m running 10.2.3, DevTools from Dec 2002, Fink
installed into /sw, rbogl-0.32b.tgz, ruby 1.6.8 (stable) compiled from
source]