{% set version = '1.7-5.2' %}

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

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

source:
  fn: geoR_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/geoR_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/geoR/geoR_{{ version }}.tar.gz
  sha256: ebae352db07fa7b8e26b07b05596aa96f5e82d67bd1a35e2607a91123a32c9eb
  patches:
    # https://github.com/rocker-org/rocker/issues/213#issuecomment-278909502
    - no_tcltk.patch

build:
  number: 0
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-mass
    - r-randomfields
    - r-sp
    - r-splancs
    - posix  # [win]
    - {{native}}toolchain  # [win]
    - gcc  # [not win]
  run:
    - r-base
    - r-mass
    - r-randomfields
    - r-sp
    - r-splancs
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=geoR
  license: GPL (>= 2)
  summary: Geostatistical analysis including traditional, likelihood-based and Bayesian methods.

extra:
  recipe-maintainers:
    - ocefpaf
