# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup bitbucket     1.0
PortGroup xcodeversion  1.0

bitbucket.setup         odedevs ode 0.16.6
revision                0
categories              devel
maintainers             {ryandesign @ryandesign} openmaintainer
license                 {LGPL-2.1+ BSD}

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.

homepage                https://www.ode.org
bitbucket.tarball_from  downloads

checksums               rmd160  b33126b83b58752d7b291bcfdef4397ddac38430 \
                        sha256  c91a28c6ff2650284784a79c726a380d6afec87ecf7a35c32a6be0c5b74513e8 \
                        size    2631885

# https://trac.macports.org/ticket/66792
patchfiles-append       patch-Opcode.h.diff

compiler.blacklist-append \
                        *gcc-4.*

depends_build-append    path:bin/pkg-config:pkgconfig

depends_lib-append      port:libccd

configure.args          --disable-demos \
                        --enable-double-precision \
                        --enable-libccd \
                        --enable-release \
                        --enable-shared \
                        --with-trimesh=opcode

build.type              gnu

test.run                yes
test.target             check

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

minimum_xcodeversions {9 3.1}

variant debug description {Enable debugging checks} {
    configure.args-replace \
        --enable-release   \
        --enable-debug
}
