{% set version = '0.9-2' %}

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

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

source:
  fn: WRS2_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/WRS2_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/WRS2/WRS2_{{ version }}.tar.gz
  sha256: 04489b9f52a9e083d904c2c8df286c67f68dab67446f854450584ee65cc2f26b

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-mass
    - r-mc2d
    - r-plyr
    - r-reshape
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-mc2d
    - r-plyr
    - r-reshape
    - libgcc  # [not win]

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

about:
  home: https://r-forge.r-project.org/projects/psychor/
  license: GPL-3
  summary: A collection of robust statistical methods based on Wilcox' WRS functions. It implements
    robust t-tests (independent and dependent samples), robust ANOVA (including between-within
    subject designs), quantile ANOVA, robust correlation, robust mediation, and nonparametric
    ANCOVA models based on robust location measures.
  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
