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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/RcppHNSW_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/RcppHNSW/RcppHNSW_{{ version }}.tar.gz
  sha256: 4f0082154f77dcb7756d41cdbfe0f58316431b9027081321a27942f319097c74

build:
  merge_build_host: true  # [win]
  number: 2
  rpaths:
    - lib/R/lib/
    - lib/

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.3
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.11.3

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

about:
  home: https://github.com/jlmelville/rcpphnsw
  license: GPL-3.0-or-later
  summary: "'Hnswlib' is a C++ library for Approximate Nearest Neighbors. This package provides a minimal R interface by relying on the 'Rcpp' package. See <https://github.com/nmslib/hnswlib> for more on 'hnswlib'. 'hnswlib' is released under Version 2.0 of the Apache License."
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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

# Package: RcppHNSW
# Title: 'Rcpp' Bindings for 'hnswlib', a Library for Approximate Nearest Neighbors
# Version: 0.2.0
# Authors@R: c(person("James", "Melville", email = "jlmelville@gmail.com", role = c("aut", "cre")), person("Aaron", "Lun", role = "ctb"))
# Description: 'Hnswlib' is a C++ library for Approximate Nearest Neighbors. This package provides a minimal R interface by relying on the 'Rcpp' package. See <https://github.com/nmslib/hnswlib> for more on 'hnswlib'. 'hnswlib' is released under Version 2.0 of the Apache License.
# License: GPL-3
# URL: https://github.com/jlmelville/rcpphnsw
# BugReports: https://github.com/jlmelville/rcpphnsw/issues
# Encoding: UTF-8
# LazyData: true
# Imports: methods, Rcpp (>= 0.11.3)
# LinkingTo: Rcpp
# RoxygenNote: 6.1.1
# Suggests: testthat, covr
# NeedsCompilation: yes
# Packaged: 2019-09-20 16:22:09 UTC; jlmel
# Author: James Melville [aut, cre], Aaron Lun [ctb]
# Maintainer: James Melville <jlmelville@gmail.com>
# Repository: CRAN
# Date/Publication: 2019-09-20 16:40:12 UTC
