{% set version = "1.1-221.2" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  fn: SDMTools_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/SDMTools_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/SDMTools/SDMTools_{{ version }}.tar.gz
  sha256: f0dd8c5f98d2f2c012536fa56d8f7a58aaf0c11cbe3527e66d4ee3194f6a6cf7
  patches:
    - b.patch

build:
  merge_build_host: True  # [win]
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-r.utils
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-r.utils

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

about:
  home: http://www.rforge.net/SDMTools/
  license: GPL-3
  summary: This packages provides a set of tools for post processing the outcomes of species
    distribution modeling exercises. It includes novel methods for comparing models
    and tracking changes in distributions through time. It further includes methods
    for visualizing outcomes, selecting thresholds, calculating measures of accuracy
    and landscape fragmentation statistics, etc.. This package was made possible in
    part by financial support from the Australian Research Council & ARC Research Network
    for Earth System Science.
  license_family: GPL
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - conda-forge/r
    - rvalieris
