{% set version = "1.5" %}

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

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

source:
  fn: formatR_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/formatR_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/formatR/formatR_{{ version }}.tar.gz
  sha256: 874c197ae3720ec11b44984a055655b99a698e1912104eb9034c11fdf6104da7

build:
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - r-base

  run:
    - r-base

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

about:
  home: http://yihui.name/formatR
  license: GPL
  summary: Provides a function tidy_source() to format R source code. Spaces and indent will
    be added to the code automatically, and comments will be preserved under certain
    conditions, so that R code will be more human-readable and tidy. There is also a
    Shiny app as a user interface in this package (see tidy_app()).
  license_family: GPL

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
