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

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

source:
  fn: KernelKnn_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/KernelKnn_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/KernelKnn/KernelKnn_{{ version }}.tar.gz
  sha256: eb6de30e9fe5e75f2de76390803d9f751b39da330c4141b62bf63d9e2c483ff6

build:
  merge_build_host: True  # [win]
  number: 1001
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
    - llvm-openmp                # [osx]
  host:
    - r-base
    - r-rcpp >=0.12.5
    - r-rcpparmadillo
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp >=0.12.5
    - r-rcpparmadillo
    - llvm-openmp                # [osx]

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

about:
  home: https://github.com/mlampros/KernelKnn
  license: MIT
  summary: Extends the simple k-nearest neighbors algorithm by incorporating numerous kernel
    functions and a variety of distance metrics. The package takes advantage of 'RcppArmadillo'
    to speed up the calculation of distances between observations.
  license_family: MIT

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
