{% set version = '1.0.2' %}

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

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

source:
  fn: styler_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/styler_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/styler/styler_{{ version }}.tar.gz
  sha256: a455e9417b98a87f37d64026b518fd724751b4964c65ce6a4c0880ccbf564b67

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:

  host:
    - r-base
    - r-backports
    - r-cli
    - r-enc >=0.2
    - r-magrittr
    - r-purrr >=0.2.3
    - r-rematch2
    - r-rlang
    - r-rprojroot
    - r-tibble >=1.4.2
    - r-withr

  run:
    - r-base
    - r-backports
    - r-cli
    - r-enc >=0.2
    - r-magrittr
    - r-purrr >=0.2.3
    - r-rematch2
    - r-rlang
    - r-rprojroot
    - r-tibble >=1.4.2
    - r-withr

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

about:
  home: https://github.com/r-lib/styler, https://r-lib.github.io/styler/
  license: GPL-3
  summary: Pretty-prints R code without changing the user's formatting intent.
  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
