{% set version = "1.5.8" %}

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

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

source:
  fn: DiceKriging_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/DiceKriging_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/DiceKriging/DiceKriging_{{ version }}.tar.gz
  sha256: 11d02b894cb509dbb8887ae27b6d08ba25aa52ac3ece134c3759c2b3b1bf4d77

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]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=DiceKriging
  license: GPL-2 | GPL-3
  license_family: GPL
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2
  summary: Estimation, validation and prediction of kriging models.

extra:
  recipe-maintainers:
    - jschueller
