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

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

source:
  fn: assertthat_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/assertthat_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/assertthat/assertthat_{{ version }}.tar.gz
  sha256: 85cf7fcc4753a8c86da9a6f454e46c2a58ffc70c4f47cac4d3e3bcefda2a9e9f

build:
  noarch: generic
  merge_build_host: True  # [win]
  number: 4
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ posix }}zip               # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=assertthat
  license: GPL-3
  summary: assertthat is an extension to stopifnot() that makes it easy to declare the pre and
    post conditions that you code should satisfy, while also producing friendly error
    messages so that your users know what they've done wrong.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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