{% set version = '0.1.0' %}

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

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

source:
  fn: tidypredict_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/tidypredict_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/tidypredict/tidypredict_{{ version }}.tar.gz
  sha256: df47179747d1e273422e3d17950fe2c9114c8f88158d4bbd9370d86627fb7eb7

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

requirements:
  build:
    - r-base
    - r-dplyr >=0.7
    - r-purrr
    - r-rlang
    - r-tibble
    - r-tidyr

  run:
    - r-base
    - r-dplyr >=0.7
    - r-purrr
    - r-rlang
    - r-tibble
    - r-tidyr

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

about:
  home: http://tidypredict.netlify.com
  license: GPL-3
  summary: It parses a fitted 'R' model object, and returns a formula in 'Tidy Eval' code that
    calculates the predictions. It works with several databases back-ends because it
    leverages 'dplyr' and 'dbplyr' for the final 'SQL' translation of the algorithm.
    It currently supports lm(), glm() and randomForest() models.
  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
