# -*- 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 Microsoft lightgbm 4.4.0
revision            0
categories-append   math
maintainers         nomaintainer
license             MIT
description         Light Gradient Boosting Machine
long_description    {*}${description}
homepage            https://github.com/Microsoft/LightGBM
checksums           rmd160  952f9d3ecf5c420e70eb79fbee92fa0ae46fe9d2 \
                    sha256  c1e91202a1b5eb2088c54382bb1a89d7901d6ddad4fca1448926c43946ae5d20 \
                    size    1723281

# OpenMP detected is broken: https://github.com/fabsig/GPBoost/issues/95
# Also it uses an outdated Eigen with yet unfixed Altivec headers.
# For now, just disable vectorization on PowerPC.
patchfiles          patch-unbreak-openmp.diff \
                    patch-unbreak-ppc.diff

depends_lib-append  port:R-data.table \
                    port:R-jsonlite \
                    port:R-R6

compiler.cxx_standard 2017

depends_test-append port:R-knitr \
                    port:R-RhpcBLASctl \
                    port:R-rmarkdown \
                    port:R-testthat

test.run            yes

# FIXME: linking on Rosetta may fail: https://github.com/microsoft/LightGBM/issues/5931
# No problem when building natively on PowerPC.
