{% set version = '1.54-0' %}

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

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

source:
  fn: spatstat_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/spatstat_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/spatstat/spatstat_{{ version }}.tar.gz
  sha256: 54608457d14d7d39e8e2a379e94c03f7d7ee7a5f16d86b6bff9e74f14dac3fed

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

requirements:
  build:
    - r-base
    - r-matrix
    - r-abind
    - r-deldir >=0.0_21
    - r-goftest
    - r-mgcv
    - r-nlme
    - r-polyclip >=1.5_0
    - r-rpart
    - r-spatstat.data >=1.2_0
    - r-spatstat.utils >=1.8_0
    - r-tensor
    - posix  # [win]
    - {{native}}toolchain  # [win]
    - gcc  # [not win]
  run:
    - r-base
    - r-matrix
    - r-abind
    - r-deldir >=0.0_21
    - r-goftest
    - r-mgcv
    - r-nlme
    - r-polyclip >=1.5_0
    - r-rpart
    - r-spatstat.data >=1.2_0
    - r-spatstat.utils >=1.8_0
    - r-tensor
    - libgcc  # [not win]

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

about:
  home: http
  license: GPL (>= 2)
  summary: Comprehensive open-source toolbox for analysing Spatial Point Patterns.

extra:
  recipe-maintainers:
    - ocefpaf
