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

github.setup        wg wrk 4.1.0
revision            1

categories          net
platforms           darwin
license             Apache-2
maintainers         @jlopezr openmaintainer
description         wrk HTTP benchmarking tool
long_description    wrk is a modern HTTP benchmarking tool with optional LuaJIT HTTP request generation.
homepage            https://github.com/wg/wrk

checksums           rmd160  66508bc4bea66d7731510164037beaac5fe44de5 \
                    sha256  49c309c834c484243d1f381505e7723326c5a9b6e328d88adef9ead804c8d83e \
                    size    6478150

depends_build-append    port:perl5

# https://trac.macports.org/ticket/59346
xcode_workaround.type append_to_compiler_name

build.args-append       CC="${configure.cc}" \
                        CXX="${configure.cxx}" \
                        CPP=${configure.cpp} \
                        VER=${version}

# Avoid configure phase
use_configure no

# wrk make fails with parallel build
use_parallel_build no

# No make install so copy static binary to bin dir
destroot {
    xinstall ${worksrcpath}/wrk ${destroot}${prefix}/bin/wrk
}