{% set version = '0.3.4' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/word2vec_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/word2vec/word2vec_{{ version }}.tar.gz
  sha256: 53db1d8c8d6af8ace8636adec1e254b0b61fbdba77ba7a295afc7da3eb4e4362

build:
  merge_build_host: True  # [win]
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: udpipe
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:
    - r-base
    - r-rcpp >=0.11.5
    - r-rcppprogress

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.11.5
    - r-rcppprogress

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

about:
  home: https://github.com/bnosac/word2vec

  license: Apache-2.0
  summary: Learn vector representations of words by continuous bag of words and skip-gram implementations
    of the 'word2vec' algorithm. The techniques are detailed in the paper "Distributed
    Representations of Words and Phrases and their Compositionality" by Mikolov et al.
    (2013), available at <arXiv:1310.4546>.

  license_family: APACHE
  license_file: LICENSE

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