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

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

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

source:
  fn: psychotools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/psychotools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/psychotools/psychotools_{{ version }}.tar.gz
  sha256: a035421fb3bab431a7d80880b3bebf6fff901be059e3bc0c46422296c6f2e512

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

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

  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=psychotools
  license: GPL-2 | GPL-3
  summary: Infrastructure for psychometric modeling such as data classes (for item response data
    and paired comparisons), basic model fitting functions (for Bradley-Terry, Rasch,
    partial credit, rating scale, multinomial processing tree models), extractor functions
    for different types of parameters (item, person, threshold, discrimination), unified
    inference and visualizations, and various datasets for illustration. Intended as
    a common lightweight and efficient toolbox for psychometric modeling and a common
    building block for fitting psychometric mixture models in package "psychomix" and
    trees based on psychometric models in package "psychotree".
  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
