{% set version = '1.1-0' %}

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

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

source:
  fn: fastmatch_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/fastmatch_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/fastmatch/fastmatch_{{ version }}.tar.gz
  sha256: 20b51aa4838dbe829e11e951444a9c77257dcaf85130807508f6d7e76797007d

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: http://www.rforge.net/fastmatch
  license: GPL-2
  summary: Package providing a fast match() replacement for cases that require repeated look-ups.
    It is slightly faster that R's built-in match() function on first match against
    a table, but extremely fast on any subsequent lookup as it keeps the hash table
    in memory.
  license_family: GPL2

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