{% set version = '0.3' %}

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

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

source:
  fn: xfun_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/xfun_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/xfun/xfun_{{ version }}.tar.gz
  sha256: 897211d135a7fc5f955e4c810e0a0d8fa12b034b0a89dde47ab23e9b486b21e4

build:
  merge_build_host: True  # [win]
  number: 1

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

requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://github.com/yihui/xfun
  license: MIT
  summary: Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'.
  license_family: MIT
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\MIT'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - bsennblad
    - dbast
