{% set version = '0.6-2' %}

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

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

source:
  fn: akima_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/akima_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/akima/akima_{{ version }}.tar.gz
  sha256: 61da3e556553eea6d1f8db7c92218254441da31e365bdef82dfe5da188cc97ce

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

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - r-sp
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

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

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

about:
  home: https://CRAN.R-project.org/package=akima
  license: ACM (Restricts use)
  summary: 'Several cubic spline interpolation methods of H. Akima for irregular and regular
    gridded data are available through this package, both for the bivariate case (irregular
    data: ACM 761, regular data: ACM 760) and univariate case (ACM 433 and ACM 697).
    Linear interpolation of irregular gridded data is also covered by reusing D. J.
    Renkas triangulation code which is part of Akimas Fortran code. A bilinear interpolator
    for regular grids was also added for comparison with the bicubic interpolator on
    regular grids.'
  license_family: OTHER
  license_file: '{{ environ["RECIPE_DIR"] }}/LICENSE'

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