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

# On macOS <10.13 built-in libc++ has no support for std::variant
legacysupport.newest_darwin_requires_legacy \
                        16
legacysupport.use_mp_libcxx \
                        yes

github.setup            jupyter-xeus xeus 6.0.5
github.tarball_from     archive
revision                0

categories              devel science
license                 BSD
maintainers             {mps @Schamschula} openmaintainer
description             xeus is a library meant to facilitate the implementation of \
                        kernels for Jupyter.
long_description        {*}${description} It takes the burden of implementing the \
                        Jupyter Kernel protocol so developers can focus on implementing \
                        the interpreter part of the kernel.

checksums               rmd160  1142ec738a91a3dd8ff47766c06a1c5d51da76d7 \
                        sha256  32a36d587c1dc4dee8e8f65dffb90e8bac910c5de3f723ed7f24a99aec447138 \
                        size    9051546

# fatal error: 'any' file not found
compiler.cxx_standard   2017

depends_build-append    port:pkgconfig \
                        port:cctools

depends_lib-append      port:nlohmann-json

configure.args-append   -DXEUS_DISABLE_ARCH_NATIVE=ON

# xkernel.cpp:95:14: error: 'visit<(lambda at /opt/local/var/macports/build/
# xeus-2ece0966/work/xeus-6.0.2/src/xkernel.cpp:95:20), std::variant<xeus
# ::xkernel_configuration, xeus::xregistration_configuration> &, void>'
# is unavailable: introduced in macOS 10.13
# std::variant<Types...>::visit is missing in the system libc++
# library, and Clang reports this error even with
# macports-libcxx (except for <Lion), so pass this flag.
if {${os.platform} eq "darwin" && ${os.major} < 17 && ${os.major} > 10} {
    if {[string match *clang* ${configure.compiler}]} {
        configure.cxxflags-append \
                        -D_LIBCPP_DISABLE_AVAILABILITY
    }
}
