{% set version = "3.0.7" %}

{% 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: 995e686d75dfa35371a1fc29efc90878ae77d29df1145554f05bd6ebb42ebde7

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-mass
    - r-rcpp >=0.12.7

  run:
    - r-base
    - r-mass
    - r-rcpp >=0.12.7

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:
    - dpryan79
    - johanneskoester
    - bgruening
    - jenzopr
