# -*- 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
# $Id: Portfile 88688 2012-01-07 21:50:00Z dports@macports.org $

PortSystem      1.0
PortGroup       cmake 1.0

name            OpenSceneGraph-devel
conflicts       OpenSceneGraph
set my_name     OpenSceneGraph
version         2.9.7
revision        2
platforms       darwin
categories      graphics
maintainers     nomaintainer
license         wxWidgets-3
description     high-performance 3D graphics toolkit

long_description \
    ${name} is a high-performance 3D graphics toolkit useful in fields such as \
    visual simulation, games, virtual reality, scientific visualization and \
    modelling.

homepage        http://www.openscenegraph.org/
master_sites    ${homepage}downloads/developer_releases/
distname        ${my_name}-${version}
use_zip         yes

checksums       md5     b5118ed07ec2945e23ad5e880f3f0f6d \
                sha1    5b374ef8459e95fc1b9eeebafedfb9d58a6b2290 \
                rmd160  d120307736cb56116266a899a7359b702fe69813

patchfiles      patch-disable-quicktime.diff \
                patch-src-osgDB-Registry.cpp.diff

post-patch {
    reinplace s:@PREFIX@:${prefix}: ${worksrcpath}/src/osgDB/Registry.cpp
}

depends_lib \
    port:curl \
    path:lib/libavcodec.dylib:ffmpeg \
    port:freetype \
    port:gdal \
    port:giflib \
    port:jasper \
    port:jpeg \
    port:libpng \
    port:tiff \
    port:zlib

configure.args-append \
    -DCMAKE_INSTALL_NAME_DIR=${prefix}/lib \
    -DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES \
    -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
    -DOSG_WINDOWING_SYSTEM=Cocoa

livecheck.type  regex
livecheck.url   ${homepage}downloads/developer_releases/
livecheck.regex ${my_name}-(\\d+(?:\\.\\d+)*)
