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

# 1.34.0 has breaking changes: https://github.com/clangen/musikcube/issues/723
# Also restbed fails:
# restbed/detail/socket_impl.hpp:25:10: fatal error: asio/io_service.hpp: No such file or directory
set real_name               asio
name                        ${real_name}-devel
conflicts                   ${real_name}
github.setup                chriskohlhoff ${real_name} 1-38-2 ${real_name}-
version                     [string map {- .} ${github.version}]
revision                    0
categories                  devel
license                     Boost-1
platforms                   any
description                 Asio C++ Library
long_description            Asio is a cross-platform C++ library for network \
                            and low-level I/O programming that provides developers \
                            with a consistent asynchronous model using a modern C++ approach.
maintainers                 {gmail.com:g.litenstein @Lord-Kamina} openmaintainer
homepage                    https://think-async.com/Asio
checksums                   rmd160  e55650628d3bf5be135e759cde3b10a4aa617b4a \
                            sha256  9f2648fa483e58a6bf848d970ee0ea650ca19ed7769dfa520ed4f7b8d27af1db \
                            size    2918472
github.tarball_from         archive
supported_archs             noarch

use_autoconf                yes
autoconf.cmd                ./autogen.sh

depends_build-append        port:autoconf \
                            port:automake \
                            port:libtool \
                            path:bin/pkg-config:pkgconfig

compiler.cxx_standard       2017
compiler.blacklist-append   {clang < 800}

if { [string match *clang* ${configure.compiler}] } {
    # Quiet warnings
    configure.cxxflags-append \
                            -Wno-error=unknown-pragmas \
                            -Wno-error=unknown-warning-option
}

configure.args-append       --with-boost=no \
                            --with-openssl=[openssl::install_area]
configure.env-append        ASIO_DISABLE_STD_STRING_VIEW=1 \
                            ASIO_HAS_STD_CHRONO=1
