{% set version = '1.2-1' %}

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

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

source:
  fn: rknn_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rknn_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rknn/rknn_{{ version }}.tar.gz
  sha256: 2545b594ad3a8bbae5837cb40fdf97647dc9fc08edb48f397e1c6012460039f5

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-gmp >=0.5_5
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-gmp >=0.5_5
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=rknn
  license: GPL (>= 2)
  summary: Random knn classification and regression are implemented. Random knn based feature
    selection methods are also included. The approaches are mainly developed for high-dimensional
    data with small sample size.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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