# -*- 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

github.setup            openscenegraph OpenSceneGraph 3.6.5 OpenSceneGraph-
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from     tarball
revision                18
conflicts               OpenSceneGraph-devel
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  d51b565206bdd4d49e8374a7a72c3686965218ff \
                        sha256  b46b9bfc725daa18c40630822b58baa0ec0e504d2cff96cc4ace06a1f173ecfd \
                        size    5781086

# 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

github.livecheck.regex  {(\d+(?:\.\d+)+)}
