# $Id: Portfile 59632 2009-10-18 11:11:57Z kimuraw@macports.org $

PortSystem		1.0
PortGroup		ruby 1.0

ruby.setup		{cocoa rubycocoa} 1.0.1 install.rb {ChangeLog ReadMe.html ReadMe.ja.html}
revision		0
maintainers		kimuraw
description		Ruby bindings for writing cocoa programs
long_description	RubyCocoa is a Ruby library for using Cocoa Objects \
					on Mac OS X in Ruby scripts. You can use RubyCocoa \
					to work with Cocoa objects in Ruby scripts, write \
					Cocoa applications with Ruby and Interface Builder, \
					develop small scale simple Cocoa applications and \
					such.
categories-append	devel
homepage		http://${ruby.project}.sourceforge.net/
license			LGPL/Ruby
master_sites	sourceforge:${ruby.project}
distname		RubyCocoa-${version}
checksums		md5 067ab6fdc92273b752b75d78cfce5f89 \
				rmd160 ae578de14a43ac6648683657ff952246ebc9726d \
				sha1 ae7e325468e817acf37633b5abae7ddc1634ea75
platforms		darwin

# fix #16928: allow non Mac OS X's make, like gmake
patchfiles-append	patch-ext-rubycocoa-extconf.rb.in.diff

configure.args		--install-prefix=${destroot}${prefix} \
					--install-root=${destroot} \
					--documentation=${prefix}/share/doc/${name} \
					--examples=${prefix}/share/examples/${name}
destroot.violate_mtree	yes

# apply universal_archs or build_arch
if {[variant_isset universal]} {
	if {[info exists universal_archs] && $universal_archs != ""} {
		configure.args-append --target-archs="${universal_archs}"
	}
} else {
	if {[info exists build_arch] && $build_arch != ""} {
		configure.args-append --target-archs="${build_arch}"
	}
}

# by default, do not install Xcode templates. #18708
variant xcode description {install project templates for Xcode} { }
if {![variant_isset xcode]} {
	configure.args-append \
		--xcode-extras="${prefix}/share/doc/${name}/project-templates"
}

#test.run yes
test.cmd ${ruby.bin}
test.target install.rb test

