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

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

source:
  fn: rmarkdown_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/rmarkdown_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rmarkdown/rmarkdown_{{ version }}.tar.gz
  sha256: 39350e4d689d633089c1dc1e51dd04bef4497422818c98c17ff77094e6700256

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-base64enc
    - r-evaluate >=0.8
    - r-htmltools >=0.3.5
    - r-jsonlite
    - r-knitr >=1.18
    - r-mime
    - r-rprojroot
    - r-stringr >=1.2.0
    - r-tinytex >=0.3
    - r-yaml >=2.1.5
    - xorg-libxrender 0.9.*
    - xorg-libsm 1.2.* 
    - xorg-libxext 1.3.*
  run:
    - r-base
    - r-base64enc
    - r-evaluate >=0.8
    - r-htmltools >=0.3.5
    - r-jsonlite
    - r-knitr >=1.18
    - r-mime
    - r-rprojroot
    - r-stringr >=1.2.0
    - r-tinytex >=0.3
    - r-yaml >=2.1.5
    - xorg-libxrender 0.9.*
    - xorg-libsm 1.2.* 
    - xorg-libxext 1.3.*    
    - pandoc >=1.12.3,<3.0

test:
  commands:
    - $R -e "library('rmarkdown')"           # [not win]
    - "\"%R%\" -e \"library('rmarkdown')\""  # [win]
    - $R -e "x <- tempfile(fileext = '.Rmd'); file.create(x); rmarkdown::render(x)"  # [not win]
    - "\"%R%\" -e \"x <- tempfile(fileext = '.Rmd'); file.create(x); rmarkdown::render(x)\""  # [win]

about:
  home: https://rmarkdown.rstudio.com, https://github.com/rstudio/rmarkdown
  license: GPL-3
  summary: Convert R Markdown documents into a variety of formats.
  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:
    - mdehollander
    - bsennblad
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
