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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/Dire_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/Dire/Dire_{{ version }}.tar.gz
  sha256: 65fbb531c47c2721644330d0c682acf9448ffa925a2a02d49c2138521380a6b0

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-mass
    - r-matrix
    - r-rcpp
    - r-foreach
    - r-haven
    - r-iterators
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-mass
    - r-matrix
    - r-rcpp
    - r-foreach
    - r-haven
    - r-iterators

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

about:
  home: https://american-institutes-for-research.github.io/Dire/
  license: GPL-2.0-only
  summary: Fit linear models, estimating score distributions for groups of people, following Cohen and Jiang (1999) <doi:10.2307/2669917>. In this model, the response is a latent trait (such as student ability) and raw item responses are combined with item difficulties in an item response theory (IRT) framework to form a
    density for each unit (student). This latent trait is then integrated out. This software is intended to fit the same models as the existing software 'AM' <http://am.air.org/>.
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r
