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

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

source:
  fn: stapler_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/stapler_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/stapler/stapler_{{ version }}.tar.gz
  sha256: ab397e5e28e595b9d7676618d64e0b6571d57e7948560d9c52b5771f47a51c76

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-rnifti
    - r-matrixstats
  run:
    - r-base
    - r-rnifti
    - r-matrixstats

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

about:
  home: https://github.com/muschellij2/stapler
  license: GPL-3
  summary: An implementation of Simultaneous Truth and  Performance Level Estimation (STAPLE)
    <doi:10.1109/TMI.2004.828354>.  This method is used when there are multiple raters
    for an object, typically an image, and this method fuses these ratings into one
    rating.  It uses an expectation-maximization method to estimate this rating and
    the individual specificity/sensitivity for each rater.
  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
