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

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

source:
  url: https://github.com/Microsoft/LightGBM/archive/v{{ version }}.tar.gz
  sha256: b2b8ed5e06be21444c4e9defd66877510d1800a650543f75bfc1b28f77745b84
  patches:
    - 8944b5e6b9a4e47b02bbd6c5237061e408eb6b34.patch

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cmake >=3.8
  host:
    - r-base
    - r-data.table >=1.9.6
    - r-jsonlite >=1.0
    - r-magrittr >=1.5
    - r-matrix >=1.1_0
    - r-r6 >=2.0
    - llvm-openmp  # [osx]
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-data.table >=1.9.6
    - r-jsonlite >=1.0
    - r-magrittr >=1.5
    - r-matrix >=1.1_0
    - r-r6 >=2.0

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

about:
  home: https://github.com/Microsoft/LightGBM
  license: MIT
  summary: |
    A fast, distributed, high performance gradient boosting (GBDT, GBRT, GBM or MART)
    framework based on decision tree algorithms, used for ranking, classification and
    many other machine learning tasks.
  license_family: MIT
  license_file: LICENSE

extra:
  recipe-maintainers:
    - conda-forge/r
    - xhochy

# Package: lightgbm
# Type: Package
# Title: Light Gradient Boosting Machine
# Version: 2.2.3
# Date: 2019-02-05
# Authors@R: c( person("Guolin", "Ke", email = "guolin.ke@microsoft.com", role = c("aut", "cre")), person("Damien", "Soukhavong", email = "damien.soukhavong@skema.edu", role = c("ctb")), person("Yachen", "Yan", role = c("ctb")), person("James", "Lamb", email="james.lamb@uptake.com", role = c("ctb")) )
# Description: Tree based algorithms can be improved by introducing boosting frameworks. LightGBM is one such framework, and this package offers an R interface to work with it. It is designed to be distributed and efficient with the following advantages: 1. Faster training speed and higher efficiency. 2. Lower memory usage. 3. Better accuracy. 4. Parallel learning supported. 5. Capable of handling large-scale data. In recognition of these advantages, LightGBM has being widely-used in many winning solutions of machine learning competitions. Comparison experiments on public datasets suggest that LightGBM can outperform existing boosting frameworks on both efficiency and accuracy, with significantly lower memory consumption. In addition, parallel experiments suggest that in certain circumstances, LightGBM can achieve a linear speed-up in training time by using multiple machines.
# License: MIT + file LICENSE
# URL: https://github.com/Microsoft/LightGBM
# BugReports: https://github.com/Microsoft/LightGBM/issues
# Suggests: Ckmeans.1d.dp (>= 3.3.1), DiagrammeR (>= 0.8.1), ggplot2 (>= 1.0.1), igraph (>= 1.0.1), knitr, rmarkdown, stringi (>= 0.5.2), testthat, vcd (>= 1.3)
# Depends: R (>= 3.4), R6 (>= 2.0)
# Imports: data.table (>= 1.9.6), graphics, jsonlite (>= 1.0), magrittr (>= 1.5), Matrix (>= 1.1-0), methods
# RoxygenNote: 6.0.1
