{% set name = "r-xtensor" %}
{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' %}
{% set version = "0.11.1" %}
{% set sha256 = "0a69e0c36e10d878c280b78c7fccdf2987704b927c1898d979c7bb98064de5db" %}

package:
  name: {{ name|lower }}
  version: {{ version }}

source:
  fn: {{ name }}-{{ version }}.tar.gz
  url: https://github.com/QuantStack/Xtensor.R/archive/{{ version }}.tar.gz
  sha256: {{ sha256 }}

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

requirements:
  build:
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_cxx') }}        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - xtensor-r >=0.11.1,<0.12.0
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - {{ pin_compatible('xtensor-r', max_pin='x.x') }}

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

about:
  home: http://github.com/QuantStack/Xtensor.R
  license: BSD-3-Clause
  license_family: BSD
  license_file: LICENSE
  summary: 'R bindings for xtensor, the C++ tensor algebra library'
  description: 'Multi dimensional arrays with broadcasting and lazy computing'
  doc_url: http://xtensor-r.readthedocs.io/
  dev_url: https://github.com/QuantStack/xtensor-r

extra:
  recipe-maintainers:
    - SylvainCorlay
    - JohanMabille
    - wolfv
