{% set version = '0.0-9' %}

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

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

source:
  fn: MBA_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/MBA_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/MBA/MBA_{{ version }}.tar.gz
  sha256: cf804e42a77c4e33364549fa1ee1da1742244a369a235eda1c79730e67cb751a

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-bh
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-bh
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=MBA
  license: GPL (>= 2)
  summary: "Functions to interpolate irregularly and regularly spaced data using Multilevel B-spline
    Approximation (MBA). Functions call portions of the SINTEF Multilevel B-spline Library
    written by \xD8yvind Hjelle which implements methods developed by Lee, Wolberg and
    Shin (1997; <doi:10.1109/2945.620490>)."

  license_family: GPL3

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