# -*- 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               github 1.0
PortGroup               cmake 1.1
PortGroup               boost 1.0

set git_commit          ba2a6f7339055647a98b3d0c1afe36036f6a6979
set git_date            20200529
github.setup            openscenegraph OpenSceneGraph ${git_commit}
name                    OpenSceneGraph-devel
version                 3.7.0-${git_date}
revision                18
conflicts               OpenSceneGraph
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/

checksums               rmd160  a6016a81357d2b96a3141d98a2f883be42f4081b \
                        sha256  0906aba0a7951854e5be89d9a14944cd5de4d6c94b8f5e4145a8ec939b1bb729 \
                        size    5827462

# respect MacPorts compiler flags
# see https://trac.macports.org/ticket/45287
patchfiles-append       patch-CMakeLists.txt.diff

# see https://github.com/openscenegraph/OpenSceneGraph/issues/1075
patchfiles-append       patch-openexr3.diff

depends_build-append    port:pkgconfig

depends_lib             port:curl \
                        port:dcmtk \
                        path:lib/libavcodec.dylib:ffmpeg \
                        port:fontconfig \
                        port:freetype \
                        port:gdal \
                        port:giflib \
                        path:lib/pkgconfig/glib-2.0.pc:glib2 \
                        port:gstreamer1-gst-plugins-base \
                        port:imath \
                        path:include/turbojpeg.h:libjpeg-turbo \
                        port:jasper \
                        port:libpng \
                        path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
                        port:openexr \
                        path:lib/pkgconfig/poppler.pc:poppler \
                        port:tiff \
                        port:zlib

compiler.cxx_standard   2011
cmake.set_cxx_standard  yes

configure.args-append   -DOSG_CONFIG_HAS_BEEN_RUN_BEFORE=YES \
                        -DOSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX=imageio \
                        -DOSG_WINDOWING_SYSTEM=Cocoa \
                        -DBUILD_OSG_EXAMPLES=NO

# disable unwanted optional dependencies to avoid opportunistic configuration
# TODO: add some of these back either directly or as variants after testing

configure.args-append   -DCMAKE_DISABLE_FIND_PACKAGE_Asio=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_COLLADA=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_DirectInput=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_FBX=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_GTA=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_GtkGl=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_Inventor=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_LIBLAS=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_LibVNCServer=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_NVTT=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_OpenCascade=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_SDL2=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_SDL=1 \
                        -DCMAKE_DISABLE_FIND_PACKAGE_ZeroConf=1

livecheck.type          none
