# $Id: Portfile,v 1.6 2004/12/20 23:13:16 tristan Exp $
PortSystem		1.0
PortGroup		ruby 1.0

ruby.setup		{opengl rbogl} 0.32c extconf.rb {sample}
revision		2
maintainers		tristan@opendarwin.org
description		OpenGL bindings for Ruby
long_description	${description}
categories-append	graphics
homepage		http://www2.giganet.net/~yoshi/
master_sites	${homepage}
checksums		md5 37e8a112dcc1b2e8446abfdab3b6ac07
platforms		darwin 

worksrcdir		${ruby.module}-${version}

patchfiles		patch-extconf.rb \
				patch-glu.c \
				patch-glut.c \
				patch-ogl.c \
				patch-rbogl.c

post-configure {
	cd ${worksrcpath}
	reinplace "s|^CFLAGS.*\$|& \
		-I/System/Library/Frameworks/OpenGL.framework/Headers \
		-I/System/Library/Frameworks/GLUT.framework/Headers|" \
		Makefile.glut Makefile.ogl
	reinplace "s|^DLDFLAGS.*\$|& \
		-L\$(prefix)/lib \
		-L/System/Library/Frameworks/OpenGL.framework/Libraries|" \
		Makefile.glut Makefile.ogl
	reinplace "s|^LIBS.*\$|& \
		-lGLU -framework GLUT -lGL -framework OpenGL|" \
	Makefile.glut Makefile.ogl
}

