{% set version = "0.9.4.6" %}

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

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

source:
  fn: stringdist_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/stringdist_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/stringdist/stringdist_{{ version }}.tar.gz


  sha256: 91c1ddee426ee246f92dd12ae746ea114e123fbfb32a4708ee29db51323cab48

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

  rpaths:
    - lib/R/lib/
    - lib/
  skip: True  # [win32]

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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



about:
  home: https://github.com/markvanderloo/stringdist
  license: GPL-3
  summary: Implements an approximate string matching version of R's native 'match' function.
    Can calculate various string distances based on edits (Damerau-Levenshtein, Hamming,
    Levenshtein, optimal sting alignment), qgrams (q- gram, cosine, jaccard distance)
    or heuristic metrics (Jaro, Jaro-Winkler). An implementation of soundex is provided
    as well. Distances can be computed between character vectors while taking proper
    care of encoding or between integer vectors representing generic sequences.
  license_family: GPL3



extra:
  recipe-maintainers:
    - croth1
