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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/RcppCNPy_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/RcppCNPy/RcppCNPy_{{ version }}.tar.gz
  sha256: 77d6fbc86520a08da40d44c0b82767099f8f719ca95870d91efff1a9cab1ab9c

build:
  number: 2
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_cxx') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed
    - posix  # [win]
  host:
    - r-base
    - r-rcpp
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp

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

about:
  home: http://dirk.eddelbuettel.com/code/rcpp.cnpy.html
  license: GPL-2.0-or-later
  summary: The 'cnpy' library written by Carl Rogers provides read and write facilities for files
    created with (or for) the 'NumPy' extension for 'Python'. Vectors and matrices of
    numeric types can be read or written to and from files as well as compressed files.
    Support for integer files is available if the package has been built with -std=c++11
    which should be the default on all platforms since the release of R 3.3.0.
  license_family: GPL
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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