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

package:
  name: r-quanteda.textmodels
  version: {{ version|replace("-", "_") }}

source:
  url:
    - {{ cran_mirror }}/src/contrib/quanteda.textmodels_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/quanteda.textmodels/quanteda.textmodels_{{ version }}.tar.gz
  sha256: 30c06c405ef15c6424a6ba6c184ec97230b496b0b7d60cfe493c663b92a65664

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - libblas
    - libcblas
    - liblapack
    - liblapacke    
    - r-base
    - r-liblinear
    - r-matrix >=1.2
    - r-rspectra
    - r-rcpp >=0.12.12
    - r-rcpparmadillo >=0.7.600.1.0
    - r-rcppparallel
    - r-sparsem
    - r-glmnet
    - r-quanteda >=2.0
    - r-stringi
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-liblinear
    - r-matrix >=1.2
    - r-rspectra
    - r-rcpp >=0.12.12
    - r-rcpparmadillo >=0.7.600.1.0
    - r-rcppparallel
    - r-sparsem
    - r-glmnet
    - r-quanteda >=2.0
    - r-stringi

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

about:
  home: https://github.com/quanteda/quanteda.textmodels

  license: GPL-3.0-only
  summary: Scaling models and classifiers for sparse matrix objects representing textual data
    in the form of a document-feature matrix.  Includes original implementations of
    'Laver', 'Benoit', and Garry's (2003) <doi:10.1017/S0003055403000698>, 'Wordscores'
    model, Perry and 'Benoit's' (2017) <arXiv:1710.08963> class affinity scaling model,
    and 'Slapin' and 'Proksch's' (2008) <doi:10.1111/j.1540-5907.2008.00338.x> 'wordfish'
    model, as well as methods for correspondence analysis, latent semantic analysis,
    and fast Naive Bayes and linear 'SVMs' specially designed for sparse textual data.
  license_family: GPL3
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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