{% set version = '6.0.1' %}

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

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

source:
  fn: roxygen2_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/roxygen2_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/roxygen2/roxygen2_{{ version }}.tar.gz
  sha256: d22ddc05cd5308a48b8359b932e1f7f4c23fdf0c857ac8e52c42381b6bfcff76

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

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

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

  host:
    - r-base
    - r-r6
    - r-rcpp
    - r-brew
    - r-commonmark
    - r-desc
    - r-digest
    - r-stringi
    - r-stringr >=0.5
    - r-xml2

  run:
    - {{native}}gcc-libs         # [win]
    - r-base
    - r-r6
    - r-rcpp
    - r-brew
    - r-commonmark
    - r-desc
    - r-digest
    - r-stringi
    - r-stringr >=0.5
    - r-xml2

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

about:
  home: https://github.com/klutometis/roxygen
  license: GPL (>= 2)
  summary: Generate your Rd documentation, 'NAMESPACE' file, and collation  field using specially
    formatted comments. Writing documentation in-line with code makes it easier to keep
    your documentation up-to-date as your requirements change. 'Roxygen2' is inspired
    by the 'Doxygen' system for C++.
  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:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
