{% set version = '1.8.2' %}

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

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

source:
  fn: checkmate_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/checkmate_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/checkmate/checkmate_{{ version }}.tar.gz
  sha256: 8f182f7894bce100fb2ed4af4487fbf2aceb9bd6d07f8301db549f9ae87b0cff

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-backports
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-backports
    - libgcc  # [not win]

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

about:
  home: https://github.com/mllg/checkmate
  license: BSD_3_clause
  summary: |
    Tests and assertions to perform frequent argument checks. A substantial part of the
    package was written in C to minimize any worries about execution time overhead.
  license_family: BSD

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
