{% set version = "0.49" %}
{% set posix = 'm2-' if win else '' %}

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

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

build:
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/
  missing_dso_whitelist:
    - '*/R.dll'        # [win]
    - '*/Rblas.dll'    # [win]
    - '*/Rlapack.dll'  # [win]

requirements:
  build:
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
    - {{ compiler('c') }}          # [not win]
    - {{ stdlib("c") }}            # [not win]
    - {{ compiler('cxx') }}        # [not win]
    - {{ compiler('m2w64_c') }}    # [win]
    - {{ stdlib("m2w64_c") }}      # [win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ 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
    - LICENSE

extra:
  recipe-maintainers:
    - conda-forge/r
    - bsennblad
    - philip-khor
