{% set version = "0.3.3" %}

{% 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: 49959f65b45b0b189a2792d6c1339bef59674ecae92f8c2ed9f26ff9e488c184

build:
  merge_build_host: true  # [win]
  number: 2

  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
