# $Id: Portfile 92602 2012-05-02 06:00:56Z ryandesign@macports.org $

PortSystem		1.0

name			Coin
version			3.1.3
revision		2
description		cross platform C++ OpenGL scene graph library
long_description	Coin is a high-level 3D graphics library with a   \
	C++ Application Programming Interface. Coin uses scene-graph data \
	structures to render real-time graphics suitable for mostly all   \
	kinds of scientific and engineering visualization applications.

categories		graphics devel
homepage		http://www.coin3d.org/lib/coin/
platforms		darwin
maintainers		css
master_sites		http://ftp.coin3d.org/coin/src/all/
checksums		md5     1538682f8d92cdf03e845c786879fbea \
			sha1    8e9f05628461963623686d3ec53102214e233dd1 \
			rmd160  e57fd6a4876a06874429f9ad6b96f166f5609362

depends_lib		port:mesa \
			port:simage \
			port:xorg-libsm \
			port:xorg-libXext \
			port:xorg-libXt

configure.args		--with-simage=${prefix} --mandir=${prefix}/share/man

post-build {
	reinplace -E {s|-arch [a-z0-9_]+||g} \
		${worksrcpath}/Coin.pc \
		${worksrcpath}/coin-default.cfg
}

platform darwin {
	configure.args-append	--disable-framework --enable-darwin-x11

variant aqua description {Install as a MacOS X framework without X11.} {
	configure.args-delete	--disable-framework --enable-darwin-x11
	configure.args-append	--with-framework-prefix=${destroot}${frameworks_dir} --without-x
	depends_lib-delete	port:xorg-libsm \
				port:xorg-libXext \
				port:xorg-libXt
}
}

variant devel description {Activate developer features, including debug libraries.} {
	configure.args-append	--enable-next-minor --enable-debug
}

variant manpages description {Include API documentation in manpages.} {
	depends_build-append	port:doxygen
	configure.args-append	--enable-man --mandir=${prefix}/share/man
	post-destroot {
		file rename ${destroot}${prefix}/share/man/man3/threads.3 \
			${destroot}${prefix}/share/man/man3/threads-coin.3
		file rename ${destroot}${prefix}/share/man/man3/manips.3 \
			${destroot}${prefix}/share/man/man3/manips-coin.3
	}
}

variant threadsafe description {Allow threadsafe scene graph traversals.} {
	configure.args-append	--enable-threadsafe
}
