# $Id: Portfile 113161 2013-11-11 06:40:09Z jeremyhu@macports.org $

PortSystem 1.0

name                solid
version             3.5.6
revision            1
categories          science math devel
platforms           darwin
license             LGPL-2
maintainers         mww openmaintainer
description         SOLID is a software library for collision detection of geometric objects in 3D space
long_description    ${description}

homepage            http://www.dtecta.com/
master_sites        http://www.dtecta.com/files/
checksums           rmd160  0b2e305c323caef96e182ec75529bad92c41f35a \
                    sha256  4acfa20266f0aa5722732794f8e93d7bb446e467719c947a3ca583f197923af0

extract.suffix      .tgz
patchfiles          patch-examples-mnm.cpp.diff patch-examples-physics.cpp.diff \
                    patch-examples-gldemo.cpp.diff patch-configure.ac.diff

depends_lib         port:qhull

# This project has buggy C++ code
compiler.blacklist  *clang*

use_autoreconf      yes
autoreconf.args     -fvi
autoreconf.env      AUTOMAKE="automake --foreign"

configure.cflags    -fno-gcse -fno-strict-aliasing -DNDEBUG -fpermissive
configure.cxxflags  -fno-gcse -fno-strict-aliasing -DNDEBUG -fpermissive

build.args          GLLIBS="-framework OpenGL -framework GLUT"

platform darwin {
    if {${os.major} >= 13} {
        depends_lib
        depends_run
        pre-fetch {
            ui_error "$name does not build on Mavericks or later."
            error "unsupported platform"
        }
    }
}

livecheck.type      none
