# -*- 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 3.1.1
github.tarball_from archive
revision            1
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  d78b179b4b57f60e4f7513eec50a7eb1a6db7abe \
                    sha256  2b44988ad4f6d3e44b4000cf540ce6fdab29bf112f586107ad91dc4e4f2748ff \
                    size    73913

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
     }
}
