{% set version = '0.9.3' %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-agtboost
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/agtboost_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/agtboost/agtboost_{{ version }}.tar.gz
  sha256: 530fdb7fb10db664115b58dee0393fd66766c804c5c58087563b156419d15efc

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-rcpp >=1.0.1
    - r-rcppeigen
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=1.0.1
    - r-rcppeigen

test:
  commands:
    - $R -e "library('agtboost')"           # [not win]
    - "\"%R%\" -e \"library('agtboost')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=agtboost
  license: GPL-3.0-only
  summary: Fast and automatic gradient tree boosting designed to avoid manual tuning and cross-validation
    by utilizing an information theoretic approach. This makes the algorithm adaptive
    to the dataset at hand; it is completely automatic, and with minimal worries of
    overfitting. Consequently, the speed-ups relative to state-of-the-art implementations
    can be in the thousands while mathematical and technical knowledge required on the
    user are minimized.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
