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

github.setup        librats librats 2.0.3
revision            0
categories          devel net p2p
maintainers         nomaintainer
license             MIT
description         P2P native library for big networks
long_description    High-performance, light-weight {*}${description}.
checksums           rmd160  2b7436512e5bce35f2002157f397fef6929e4be5 \
                    sha256  e7ecbbb969334d6ee6eb0718659116787ec04a69fbf8cde5792929f4b73235be \
                    size    1000963
github.tarball_from archive

compiler.cxx_standard   2017

# FIXME: enabling dynamic lib disables static:
# https://github.com/librats/librats/issues/27

configure.args-append   -DRATS_BINDINGS=ON \
                        -DRATS_BUILD_EXAMPLES=ON \
                        -DRATS_BUILD_TESTS=OFF \
                        -DRATS_SEARCH_FEATURES=ON \
                        -DRATS_SHARED_LIBRARY=ON \
                        -DRATS_STATIC_LIBRARY=ON \
                        -DRATS_STORAGE=OFF

post-destroot {
    xinstall -m 755 ${cmake.build_dir}/bin/rats-client ${destroot}${prefix}/bin/
    system "install_name_tool -change @rpath/librats.1.dylib ${prefix}/lib/librats.dylib ${destroot}${prefix}/bin/rats-client"
}
