PortSystem		1.0
PortGroup		ruby 1.0

ruby.setup		{cocoa rubycocoa} 1.2.0 install.rb {ChangeLog ReadMe.md}
revision		1
checksums		rmd160  8c0c6e89e6ec5893466717d22952bf8d3f463af2 \
				sha256  fc8dc7cc130a87c9f45b039381f974e52aaff23bfdbfa71b250040d7672653e9 \
				size    1966211

maintainers		{kimuraw @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		https://${ruby.project}.github.io
license			{LGPL Ruby}
master_sites	sourceforge:project/${ruby.project}/RubyCocoa/${version}/
distname		RubyCocoa-${version}
platforms		darwin

depends_lib-append \
				port:libffi \
				port:libxml2

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

post-patch {
	reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/pre-config.rb
}

use_xcode		yes

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

pre-configure {
	configure.args-append --target-archs="[get_canonical_archs]"
}

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