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

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

source:
  fn: sentimentr_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/sentimentr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/sentimentr/sentimentr_{{ version }}.tar.gz
  sha256: 86ae545b563d89bdf058d6fb351cea4f4f0244dba2bb157c5ff90ec1802e945a

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-data.table
    - r-ggplot2
    - r-lexicon >=1.0.0
    - r-stringi
    - r-syuzhet
    - r-textclean >=0.6.1
    - r-textshape >=1.3.0
  run:
    - r-base
    - r-data.table
    - r-ggplot2
    - r-lexicon >=1.0.0
    - r-stringi
    - r-syuzhet
    - r-textclean >=0.6.1
    - r-textshape >=1.3.0

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

about:
  home: http://github.com/trinker/sentimentr
  license: MIT
  summary: Calculate text polarity sentiment at the sentence level and optionally aggregate by
    rows or grouping variable(s).
  license_family: MIT

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