{% set version = "0.59" %}

{% 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: e80c43421a2727758019c19da22ced8b5aa270f9cc9a68ebaef508faac5cf119

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-rcppeigen
    - r-mvtnorm

  run:
    - r-base
    - r-rcppeigen
    - r-mvtnorm

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
