{% set version = '0.3.0' %}

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

package:
  name: r-triebeard
  version: {{ version }}

source:
  fn: triebeard_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/triebeard_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/triebeard/triebeard_{{ version }}.tar.gz
  sha256: bf1dd6209cea1aab24e21a85375ca473ad11c2eff400d65c6202c0fb4ef91ec3

build:
  merge_build_host: True  # [win]
  number: 1003
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

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

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

about:
  home: https://cran.r-project.org/web/packages/triebeard
  license: MIT
  license_file: LICENSE
  summary: Radix trees, or tries, are key-value data structures optimised for efficient
    lookups, similar in purpose to hash tables. triebeard provides an implementation
    of radix trees for use in R programming and in developing packages with Rcpp.

extra:
  recipe-maintainers:
    - ocefpaf
