# -*- 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 3.0.4 v
revision                0

checksums               rmd160  4573fc8399535c35cb44b8ca3d2cd031aa630719 \
                        sha256  74b6a2c2b4573a400cafb6ecbf60c98df300cd3d0041296b913d02b2cbbb2676 \
                        size    966373
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.13
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
}
