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

# No release since v0.98.1 in 2015; master carries seven years of fixes.
github.setup        imneme pcg-cpp 428802d1a5634f96bcd0705fab379ff0113bcf13
github.tarball_from archive
version             0.98.1-20220408
revision            0

categories          devel
platforms           any
supported_archs     noarch
license             {Apache-2 MIT}
maintainers         {@jrjsmrtn gmail.com:jrjsmrtn} openmaintainer

description         PCG family of random number generators for C++

long_description    PCG is a family of simple, fast, statistically good \
                    random number generators. This header-only C++ library \
                    provides them with an interface compatible with the \
                    C++11 <random> engines.

checksums           rmd160  0fc8fb3d330df69d754c53594069dbfbd22e2073 \
                    sha256  79f23706ed0cbc1bb57ea35d50d0abed66898b8f7b0bcf2aaecdfd234863b060 \
                    size    78224

# The headers are C++11, and the tests are compiled with -std=c++11.
compiler.cxx_standard 2011

use_configure       no

build {}

destroot {
    xinstall -d ${destroot}${prefix}/include
    xinstall -m 0644 {*}[glob ${worksrcpath}/include/*.hpp] ${destroot}${prefix}/include
}

# run-tests.sh reports a mismatch but still exits 0, so check for its
# success line.
test.run            yes
test {
    system -W ${worksrcpath}/test-high "${build.cmd} test CXX=${configure.cxx} 2>&1 | tee test.log && grep -qx 'All tests succeeded.' test.log"
}
