# $Id: Portfile 47430 2009-02-28 02:54:12Z jeremyhu@macports.org $

PortSystem              1.0

name                    ode
version                 0.9
revision                1
categories              devel
platforms               darwin
maintainers             nomaintainer
homepage                http://www.ode.org/
master_sites            sourceforge:opende
distname                ${name}-src-${version}
worksrcdir              ${name}-${version}
use_zip                 yes

description             library for simulating articulated rigid body dynamics

long_description        ODE is a free, industrial quality library for \
                        simulating articulated rigid body dynamics - for \
                        example ground vehicles, legged creatures, and moving \
                        objects in VR environments. It is fast, flexible, \
                        robust and platform independent, with advanced joints, \
                        contact with friction, and built-in collision detection.

checksums               md5     4c03759b76a0649a6d5108c8e172e1e4 \
                        sha1    3b39ce085c2dc77c3fad7abaa382ffc20d3780e5 \
                        rmd160  e999fef770d664a57ffb2f71bf5351fbd84d5b17

patchfiles              patch-configure.diff

configure.args          --with-trimesh=opcode \
                        --enable-double-precision \
                        --enable-release \
                        --enable-debug

platform darwin 9 {
    patchfiles-append   patch-include-ode-config.h.in.diff
    pre-extract {
        set minimum_xcodeversion 3.1
        set current_xcodeversion [exec defaults read /Developer/Applications/Xcode.app/Contents/Info CFBundleShortVersionString]
        if {[rpm-vercomp ${current_xcodeversion} ${minimum_xcodeversion}] < 0} {
            ui_msg "On Mac OS X ${macosx_version}, ${name} ${version} requires Xcode ${minimum_xcodeversion} or later but you have Xcode ${current_xcodeversion}."
            return -code error "incompatible Xcode version"
        }
    }
}

build.type              gnu

post-destroot {
    system "ranlib ${destroot}${prefix}/lib/libode.a"
}

livecheck.check         sourceforge
livecheck.name          opende
livecheck.regex         ode-src-(\[0-9\\\.]+)\\.
