{% set name = "r-catboost" %}
{% set version = "0.20.1" %}
{% set posix = 'm2-' if win else '' %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  url: https://github.com/catboost/catboost/releases/download/v{{ version }}/catboost-R-Linux-{{ version }}.tgz  # [linux]
  sha256: 2c4de3bd41a3fcdd31e9b43118e298982f1ef0a70f7ee20bcea6ec798bb62354  # [linux]

  url: https://github.com/catboost/catboost/releases/download/v{{ version }}/catboost-R-Windows-{{ version }}.tgz  # [win]
  sha256: 2d9f88811f2f975d6d1df38afc95813b54500bfdcf462fbc82355cb16653405a  # [win]

  url: https://github.com/catboost/catboost/releases/download/v{{ version }}/catboost-R-Darwin-{{ version }}.tgz  # [osx]
  sha256: eba81d1c5e5924dc06cb5a6833d469a35e59b8f24f09eee5abda9dbace0ccc80  # [osx]

build:
  number: 0

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-jsonlite
  run:
    - r-base
    - r-jsonlite

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

about:
  home: https://github.com/catboost/catboost
  license: Apache 2.0
  license_family: Apache
  license_file: LICENSE.txt
  summary: 'CatBoost is a machine learning algorithm that uses gradient boosting on decision trees. It is available as an open source library.'
  doc_url: https://tech.yandex.com/catboost/doc/dg/concepts/about-docpage/

extra:
  recipe-maintainers:
    - conda-forge/r
    - curious-odd-man
