# $Id: Portfile 74719 2010-12-30 17:14:22Z kimuraw@macports.org $

PortSystem		1.0
PortGroup		muniversal 1.0
PortGroup		ruby 1.0

ruby.setup		rcairo 1.10.0 extconf.rb {README.rdoc COPYING GPL samples doc}
revision		1
maintainers		kimuraw
description		Ruby bindings for cairo
long_description \
		Ruby bindings for Cairo. Cairo is a 2D graphics library \
		with support for multiple output devices.
categories-append	graphics
checksums		md5  4fe76f1069d0d1ccfdf7848e3e928d9f \
				rmd160 243e39c25c4c633842f7b9f605de7c192b4ed265 \
				sha1 592fe1f19c6608f98d5170324e9ed479249caae7
platforms		darwin

depends_lib-append		path:lib/pkgconfig/cairo.pc:cairo \
						port:rb-pkg-config
configure.env-append 	PKG_CONFIG=${prefix}/bin/pkg-config
configure.args-append	--vendor

homepage        http://cairographics.org/rcairo/
master_sites    http://cairographics.org/releases/
license			Ruby

# 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 ${arch} ${ruby.bin} -C ${worksrcpath}-${arch}/ext/cairo extconf.rb --vendor"
		}
	}
}

test.env-append 	PKG_CONFIG=${prefix}/bin/pkg-config
test.run		yes
test.dir		${worksrcpath}
test.cmd		${ruby.bin}
test.target		test/run-test.rb
test.args		--testcase=PaperTest

livecheck.type	regex
livecheck.url	${homepage}
livecheck.regex	{The latest version is <a href="http://cairographics.org/releases/rcairo-([\d.]+).tar.gz">}
