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

# keep version in sync with the py-pybind11 port
github.setup            pybind pybind11 2.13.6 v
revision                0

checksums               rmd160  c60e303c88e97fcafdcc0256e840223bc47ed683 \
                        sha256  e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20 \
                        size    800804
github.tarball_from     archive

categories              devel
maintainers             {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
license                 BSD

description             Extension modules for pybind11, which provides seamless operability between C++11 and Python

long_description        Extension modules for pybind11, which is a lightweight header-only library that \
                        exposes  C++ types in Python and vice versa, mainly \
                        to create Python bindings of existing C++ code.

supported_archs         noarch
platforms               any

compiler.cxx_standard   2017

set python_branch       3.12
set python_version      [string map {. ""} ${python_branch}]

configure.args-append   -DPYBIND11_PYTHON_VERSION=${python_branch} \
                        -DPYBIND11_TEST=NO

depends_build-append    port:python${python_version} \
                        port:py${python_version}-setuptools

variant tests description {Enable tests} {
    PortGroup                   active_variants 1.1
    PortGroup                   boost           1.0

    test.run                    yes
    configure.args-replace      -DPYBIND11_TEST=NO \
                                -DPYBIND11_TEST=YES
    test.target                 pytest
    depends_test-append         port:py${python_version}-numpy \
                                port:py${python_version}-scipy \
                                path:share/pkgconfig/eigen3.pc:eigen3

    require_active_variants     [boost::depends_portname]   python${python_version}
    configure.cxxflags-append   -std=c++17
}