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

R.setup             cran roigrp highs 0.1-10
revision            1
categories-append   math
maintainers         {@barracuda156 gmail.com:vital.had} openmaintainer
license             GPL-2+
description         HiGHS optimization solver
long_description    R interface to HiGHS, an optimization solver for solving mixed integer optimization \
                    problems with quadratic or linear objective and linear constraints.
homepage            https://gitlab.com/roigrp/solver/highs
checksums           rmd160  2fc440d27e217824ecbaf4e355dcc04b82c76194 \
                    sha256  4ce0034f9eea27e5ba3562c57b09d6c656d898e37cd6a01c19a4d2e6ddfa55ee \
                    size    1128369

depends_build-append \
                    path:bin/cmake:cmake \
                    port:bash \
                    port:pkgconfig
depends_lib-append  port:HiGHS \
                    port:R-checkmate \
                    port:R-Rcpp

patchfiles          patch-use-Macports-highs.diff \
                    patch-cxx11.diff

post-patch {
    reinplace "s,@PREFIX@,${prefix}," ${worksrcpath}/configure
}

# There are no specific tests atm.
depends_test-append port:R-tinytest

test.run            yes
