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

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

source:
  fn: withr_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/withr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/withr/withr_{{ version }}.tar.gz
  sha256: 41366f777d8adb83d0bdbac1392a1ab118b36217ca648d3bb9db763aa7ff4686

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

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

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

about:
  home: http://withr.r-lib.org, http://github.com/r-lib/withr#readme
  license: GPL (>= 2)
  summary: A set of functions to run code 'with' safely and temporarily modified global state.
    Many of these functions were originally a part of the 'devtools' package, this provides
    a simple package with limited dependencies to provide access to these functions.
  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:
    - croth1
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
