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

legacysupport.newest_darwin_requires_legacy 12
legacysupport.use_mp_libcxx     yes

github.setup                    AcademySoftwareFoundation openexr 3.4.11 v
revision                        0
categories                      graphics
license                         BSD
maintainers                     {mcalhoun @MarcusCalhoun-Lopez} {mascguy @mascguy} openmaintainer

description                     OpenEXR Graphics Library
long_description                OpenEXR is the professional-grade high dynamic range image \
                                storage format of the motion picture industry.
homepage                        https://www.openexr.com
checksums                       rmd160  8dd69a97ab32f230500b301c0ccdfc93f51733bf \
                                sha256  63730442f5fd6c5a79395bdd199040ab3821c229066049f52a57424a984b16ed \
                                size    25752935
github.tarball_from             archive

# Python only used for tests
set py_ver                      3.14
set py_ver_nodot                [string map {. {}} ${py_ver}]

patchfiles-append               patch-re-enable-dispatch-on-10.6-powerpc.diff

depends_build-append            path:bin/pkg-config:pkgconfig
depends_lib-append              port:imath \
                                port:libdeflate \
                                port:openjph

compiler.cxx_standard           2017

configure.args-append           -DBUILD_TESTING=OFF \
                                -DOPENEXR_BUILD_PYTHON=OFF

variant tests description "Enable test support" {
    depends_build-append        port:python${py_ver_nodot}

    configure.args-replace      -DBUILD_TESTING=OFF \
                                -DBUILD_TESTING=ON

    test.run                    yes
    test.target                 test
}

# only allow numbers, to avoid pre-release versions
github.livecheck.regex          {([0-9.]+)}
