{% set version = '0.0.10' %}

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

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

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

  sha256: caca129aaed93670601a05152966386c2a1a2618d450e33357cb7f23a6324823

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

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

requirements:
  build:
    - r-base
    - r-rcpp
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-rcpp
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=RcppAnnoy
  license: GPL (>= 2)
  summary: '''Annoy'' is a small C++ library for Approximate Nearest Neighbors  written for efficient
    memory usage as well an ability to load from / save to disk. This package provides
    an R interface by relying on the ''Rcpp'' package, exposing the same interface as
    the original Python wrapper to ''Annoy''. See <https'

  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}\/lib\/R\/share\/licenses\/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]
extra:
   recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
