# $Id: Portfile 91955 2012-04-14 00:36:07Z kimuraw@macports.org $

PortSystem		1.0
PortGroup		muniversal 1.0
PortGroup		ruby 1.0

ruby.setup		{gtk2 ruby-gnome2} 1.1.3 extconf.rb \
				{ gtk2/README gtk2/sample gdk_pixbuf2/sample } \
				sourceforge:ruby-gnome2
revision		0
maintainers		kimuraw
platforms		darwin
description		Ruby/GTK2 is a Ruby binding of GTK+-2.0.x. \
				Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x.
long_description	Ruby/GTK2 is a Ruby binding of GTK+-2.0.x. \
				Ruby/GdkPixbuf2 is a Ruby binding of GdkPixbuf-2.x.
license			LGPL-2
checksums		md5 8fa5a2b35f45df722df599fb0765b069 \
				rmd160 7f78bd36632bf5547000a92304cefd368da9ad98 \
				sha1 f99af53f020136a1e1162e97c792343cd97a9a45
# generate glib-enum-types.h at glib/src and glib/pango
pre-configure	{
	system "${ruby.bin} -C ${worksrcpath} extconf.rb --strict glib2 pango"
}
configure.env	RUBYOPT=-rvendor-specific
configure.args	--strict gtk2 gdk_pixbuf2
depends_lib-append	port:gtk2 port:rb-pango port:rb-rcairo port:rb-glib2 \
				port:rb-atk port:rb-pkg-config
distname		${ruby.project}-all-${version}

# run extconf.rb with each arch `ruby'
use_parallel_build	no
post-configure {
	if {[variant_isset universal]} {
		foreach arch ${universal_archs} {
			foreach submod {glib2 pango gtk2 gdk_pixbuf2} {
				system "/usr/bin/arch -${arch} ${ruby.bin} -C ${worksrcpath}-${arch}/${submod}/ext/${submod} extconf.rb --vendor"
			}
		}
	}
}

## patch-gtk-test-run-test.rb.diff: do not build dependent libraries at testing
#patchfiles		patch-gtk2-test-run-test.rb.diff
## Run Test for developer only, the test launches X11.app
#test.run		yes
test.cmd		${ruby.bin}
test.target		-C gtk2 test/run-test.rb

