{% set version = '1.5.5' %}

{% 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: 55fe161f867a0c3772023c3047041b877aa54d29cb474ec87293ec31cc5cb30c

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

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

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

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

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'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]
  summary: Estimation, validation and prediction of kriging models.

extra:
  recipe-maintainers:
    - jschueller
