{% set version = '1.2.6' %}

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

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

source:
  fn: fs_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/fs_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/fs/fs_{{ version }}.tar.gz
  sha256: 12a929d8e1c7a561d90eb0692c8a13927aa02d8f8034da6ac8a3235a3156184f

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

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake          # [not win]
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-rcpp

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

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

about:
  home: http://fs.r-lib.org, https://github.com/r-lib/fs
  license: GPL-3
  summary: A cross-platform interface to file system operations, built on top of the 'libuv'
    C library.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - nick-youngblut
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
