# -*- 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
PortGroup           openssl 1.0

# std::optional
legacysupport.use_mp_libcxx \
                    yes
legacysupport.newest_darwin_requires_legacy \
                    16

github.setup        jupyter-xeus xeus-zmq 4.0.0
github.tarball_from archive
revision            0

categories          devel science
license             BSD
maintainers         {mps @Schamschula} openmaintainer
description         xeus-zmq provides various implementations of the xserver API from \
                    xeus, based on the ZeroMQ library.
long_description    {*}${description} These implementations all conform to the Jupyter \
                    Kernel Protocol specification.
homepage            https://github.com/jupyter-xeus/xeus-zmq

checksums           rmd160  47088d75a553327fbfdfe73b4d1b94ac1e2cbcaa \
                    sha256  6a87c0edeefae1350743071cd78c825d6ab21e771b52610ef7e41c434af20db6 \
                    size    76561

openssl.branch      3

depends_lib-append  port:cppzmq \
                    path:lib/libssl.dylib:openssl \
                    port:xeus \
                    port:xproperty \
                    port:zmq

# https://trac.macports.org/ticket/66817
# xclient_zmq.hpp:13:10: fatal error: 'optional' file not found
compiler.cxx_standard 2017

# xclient_zmq_impl.cpp:63:41: error: 'value' is
# unavailable: introduced in macOS 10.13
# std::optional<T>::value is missing from the libc++ system
# 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
     }
}
