{% set version = '0.56.1' %}

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

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

source:
  fn: rpf_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rpf_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rpf/rpf_{{ version }}.tar.gz
  sha256: ad482b58f0a8656948720f1e3a727fa3672e9bf7f0941e264229eafb5d69628c

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

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

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

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

about:
  home: https://github.com/jpritikin/rpf
  license: GPL (>= 3)
  summary: The purpose of this package is to factor out logic and math common to Item Factor
    Analysis fitting, diagnostics, and analysis. It is envisioned as core support code
    suitable for more specialized IRT packages to build upon. Complete access to optimized
    C functions are made available with R_RegisterCCallable().
  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
