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

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

source:
  fn: tokenizers_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/tokenizers_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/tokenizers/tokenizers_{{ version }}.tar.gz
  sha256: 28617cdc5ddef5276abfe14a2642999833322b6c34697de1d4e9d6dc7670dd00

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-rcpp >=0.12.3
    - r-snowballc >=0.5.1
    - r-stringi >=1.0.1
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp >=0.12.3
    - r-snowballc >=0.5.1
    - r-stringi >=1.0.1

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

about:
  home: https://lincolnmullen.com/software/tokenizers/
  license: MIT
  summary: 'Convert natural language text into tokens. Includes tokenizers for shingled n-grams,
    skip n-grams, words, word stems, sentences, paragraphs, characters, shingled characters,
    lines, tweets, Penn Treebank, regular expressions, as well as functions for counting
    characters, words, and sentences, and a function for splitting longer texts into
    separate documents, each with the same number of words.  The tokenizers have a consistent
    interface, and the package is built on the ''stringi'' and ''Rcpp'' packages for  fast
    yet correct tokenization in ''UTF-8''. '
  license_family: MIT

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