{% set version = "2.6.5" %}

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

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

source:
  fn: RNiftyReg_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RNiftyReg_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RNiftyReg/RNiftyReg_{{ version }}.tar.gz
  sha256: 937fa65456bb53873a53a6cfcbd8d1a8f80dffb007bfdfacec76ee4655444136

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-rnifti
    - r-rcpp >=0.11.0
    - r-rcppeigen
    - r-ore

  run:
    - r-base
    - r-rnifti
    - r-rcpp >=0.11.0
    - r-rcppeigen
    - r-ore

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

about:
  home: https://github.com/jonclayden/RNiftyReg
  license: GPL-2
  summary: Provides an 'R' interface to the 'NiftyReg' image registration tools <http://sourceforge.net/projects/niftyreg/>.
    Linear and nonlinear registration are supported, in two and three dimensions.
  license_family: GPL2

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