{% set version = '0.1.2' %}

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

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

source:
  fn: pryr_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/pryr_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/pryr/pryr_{{ version }}.tar.gz
  sha256: 65c2b7c9f96e2aa683ac9cdab3c215fd3039ecd66a2ba7002a8e77881428c3c6

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcpp
    - r-codetools
    - r-stringr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-rcpp
    - r-codetools
    - r-stringr
    - libgcc  # [not win]

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

about:
  home: https://github.com/hadley/pryr
  license: GPL-2
  summary: Useful tools to pry back the covers of R and understand the language at a deeper level.
  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
