# $Id: Portfile,v 1.3 2006/05/04 06:27:48 mww Exp $

PortSystem 1.0

name	   inventor
version	   2.1.5-10
revision	2
categories	devel graphics x11
platforms	darwin
maintainers	cssdev@mac.com

description	SGI Open InventorTM graphics toolkit
long_description    Open InventorTM is an object-oriented 3D toolkit offering a comprehensive \
		    solution to interactive graphics programming problems. It presents a \
		    programming model based on a 3D  scene database that dramatically simplifies \
		    graphics programming. It includes a rich set of objects such as cubes, \
		    polygons, text, materials, cameras, lights, trackballs, handle boxes, 3D \
		    viewers, and editors that speed up your programming time and extend your \
		    3D programming capabilities.

homepage	    http://oss.sgi.com/projects/inventor/
master_sites	    ftp://oss.sgi.com/projects/inventor/download/
checksums	    md5 82208096f1e0b111160e864e239c3a51
distname	    ${name}-${version}.src
worksrcdir	    ${name}

depends_lib	    lib:libX11.6:XFree86 \
		    lib:libXm.4:openmotif \
		    port:freetype \
		    lib:libjpeg.62:jpeg \
		    lib:libdl:dlcompat

patchfiles	    patch-BarChart-GNUmakefile.diff \
		    patch-Decal-GNUmakefile.diff \
		    patch-GeneralizedCylinder-GNUmakefile.diff \
		    patch-SceneViewer-GNUmakefile.diff \
		    patch-SoGLTextureImageElement.c++.diff \
		    patch-SoText2.c++.diff \
		    patch-SoText3.c++.diff \
		    patch-TextWrapper.c++.diff \
		    patch-drop-GNUmakefile.diff \
		    patch-flfreetype.h.diff \
		    patch-gview-GNUmakefile.diff \
		    patch-ivcat-GNUmakefile.diff \
		    patch-ivcommondefs.diff \
		    patch-ivdowngrade-GNUmakefile.diff \
		    patch-ivfix-GNUmakefile.diff \
		    patch-ivinfo-GNUmakefile.diff \
		    patch-ivman-GNUmakefile.diff \
		    patch-ivview-GNUmakefile.diff \
		    patch-localrules.apple.diff \
		    patch-machine.h.diff \
		    patch-maze-GNUmakefile.diff \
		    patch-noodle-GNUmakefile.diff \
		    patch-qmorf-GNUmakefile.diff \
		    patch-revo-GNUmakefile.diff \
		    patch-soxt-GNUmakefile.diff \
		    patch-textomatic-GNUmakefile.diff \
		    patch-widgets-GNUmakefile.componentTest.diff

post-patch {
	   reinplace "s|__PREFIX__|${prefix}|" ${worksrcpath}/make/ivcommondefs
}

use_configure	no

build.env	DYLD_LIBRARY_PATH=${worksrcpath}/lib IVROOT=${destroot}

destroot.env	${build.env}

post-destroot {
	      xinstall -m 755 -d ${destroot}${prefix}/share/${name}
	      xinstall -m 644 -W ${worksrcpath} COPYING FAQ.misc KNOWN.BUGS \
	      ${destroot}${prefix}/share/${name}
}

variant debug {
    build.env-append      LIBTYPE=debug
    patchfiles-append     patch-SoV1NkCatalog.c++.diff \
                          patch-SoText3V2.c++.diff
}

variant imagelib {
	post-destroot {
		xinstall -m 644 -W ${worksrcpath}/libimage libimage.a \
			${destroot}${prefix}/lib
		xinstall -m 644 -W ${worksrcpath}/libimage image.h \
			${destroot}${prefix}/include
		system "ranlib ${destroot}${prefix}/lib/libimage.a"
	}
}
