{% set version = '1.1.0' %}

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

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

source:
  fn: ModelMetrics_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ModelMetrics_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ModelMetrics/ModelMetrics_{{ version }}.tar.gz
  sha256: 487d53fda57da4b29f83a927dda8b1ae6655ab044ee3eec33c38aeb27eed3d85

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-rcpp

  run:
    - r-base
    - r-rcpp

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

about:
  home: https://CRAN.R-project.org/package=ModelMetrics
  license: GPL (>= 2)
  summary: Collection of metrics for evaluating models written in C++ using 'Rcpp'.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
