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

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

source:
  fn: randomForest_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/randomForest_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/randomForest/randomForest_{{ version }}.tar.gz
  sha256: f4b88920419eb0a89d0bc5744af0416d92d112988702dc726882394128a8754d

build:
  merge_build_host: True  # [win]
  number: 1000
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: https://www.stat.berkeley.edu/~breiman/RandomForests/
  license: GPL (>= 2)
  summary: Classification and regression based on a forest of trees using random inputs, based
    on Breiman (2001) <DOI:10.1023/A:1010933404324>.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
