# $Id: Portfile 80803 2011-07-17 19:47:19Z kimuraw@macports.org $

PortSystem		1.0
PortGroup		muniversal 1.0
PortGroup		ruby 1.0

ruby.setup		{poppler ruby-gnome2} 1.0.0 extconf.rb \
				{ poppler/README poppler/sample } \
				sourceforge:ruby-gnome2
revision		0
maintainers		kimuraw
platforms		darwin
description		Ruby/Poppler is a Ruby binding of poppler-glib.
long_description	Ruby/Poppler is a Ruby binding of poppler-glib.
categories-append	gnome
license			LGPLv2
checksums		md5 1e1500f7ce594e37f560c4ee3d969f40 \
				rmd160 4487a3484c77ccee928b45316053938b8a810693 \
				sha1 28866952d255a6ddae499329daa968def65d876b
configure.env	RUBYOPT=-rvendor-specific
configure.args	--strict poppler
depends_lib-append	port:poppler port:rb-glib2 port:rb-gtk2 \
					port:rb-rcairo 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} {
			system "/usr/bin/arch -${arch} ${ruby.bin} -C ${worksrcpath}-${arch}/poppler/ext/poppler extconf.rb --vendor"
		}
	}
}

## for developer, this test launches X11.app
#test.run		yes
## genearte header files for testing
#pre-configure	{
#	system "${ruby.bin} -C ${worksrcpath} extconf.rb --strict glib2 atk pango gdk_pixbuf2 gtk2"
#}
test.cmd		${ruby.bin}
test.target		-C poppler test/run-test.rb

