{% set version = '3.0.4' %}

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

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

source:
  fn: kohonen_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/kohonen_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/kohonen/kohonen_{{ version }}.tar.gz
  sha256: 429864d72858c29d4187bed48ac1c17cf2ecb08f18090b6bf44dff55174609ab

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

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

requirements:
  build:
    - r-base
    - r-mass
    - r-rcpp >=0.12.7
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-rcpp >=0.12.7
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=kohonen
  license: GPL (>= 2)
  summary: Functions to train self-organising maps (SOMs). Also interrogation of the maps and
    prediction using trained maps are supported. The name of the package refers to Teuvo
    Kohonen, the inventor of the SOM.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - jenzopr
