{% set version = "0.9.0" %}

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

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

source:
  fn: RNifti_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RNifti_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RNifti/RNifti_{{ version }}.tar.gz
  sha256: 48f6e23baf1f869f02ffec82207262f477b3f4222badf2efc693f3aafc817ecd

build:
  merge_build_host: True  # [win]
  number: 0
  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-rcpp

  run:
    - r-base
    - r-rcpp

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

about:
  home: https://github.com/jonclayden/RNifti
  license: GPL-2
  summary: Provides very fast access to images stored in the NIfTI-1 file format <http://www.nitrc.org/docman/view.php/26/64/nifti1.h>,
    with seamless synchronisation between compiled C and interpreted R code. Not to
    be confused with 'RNiftyReg', which provides tools for image registration.
  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
