{% set version = '0.3.1' %}

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

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

source:
  fn: rappdirs_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/rappdirs_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rappdirs/rappdirs_{{ version }}.tar.gz
  sha256: 2fd891ec16d28862f65bb57e4a78f77a597930abb59380e757afd8b6c6d3264a

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

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

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://github.com/hadley/rappdirs https://github.com/ActiveState/appdirs
  license: MIT
  license_family: MIT
  license_file: LICENSE
  summary: An easy way to determine which directories on the users computer you should use to
    save data, caches and logs. A port of Python's 'Appdirs' (\url{https://github.com/ActiveState/appdirs})
    to R.

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