{% set version = '0.2.4' %}

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

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

source:
  fn: settings_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/settings_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/settings/settings_{{ version }}.tar.gz
  sha256: 3edbb172af062d9b28a4e82226c2acfe7511dd073cd1924c13d754c6acd95a24

build:
  merge_build_host: True  # [win]
  script: R CMD INSTALL --build .
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: testthat, knitr
requirements:
  build:
    - {{posix}}zip               # [win]

  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/settings
  license: GPL-3
  summary: Provides option settings management that goes beyond R's default 'options' function.
    With this package, users can define their own option settings manager holding option
    names, default values and  (if so desired) ranges or sets of allowed option values
    that will be  automatically checked. Settings can then be retrieved, altered and
    reset  to defaults with ease. For R programmers and package developers it offers  cloning
    and merging functionality which allows for conveniently defining  global and local
    options, possibly in a multilevel options hierarchy. See  the package vignette for
    some examples concerning functions, S4 classes,  and reference classes. There are
    convenience functions to reset par()  and options() to their 'factory defaults'.

extra:
  recipe-maintainers:
    - dpryan79
    - ocefpaf
