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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/tensor_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/tensor/tensor_{{ version }}.tar.gz
  sha256: e1dec23e3913a82e2c79e76313911db9050fb82711a0da227f94fc6df2d3aea6

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base

test:
  commands:
    - $R -e "library('tensor')"           # [not win]
    - "\"%R%\" -e \"library('tensor')\""  # [win]
    - conda inspect linkages -p $PREFIX r-tensor  # [not win]
    - conda inspect objects -p $PREFIX r-tensor  # [osx]

about:
  home: https://CRAN.R-project.org/package=tensor
  license: GPL (>= 2)
  summary: The tensor product of two arrays is notionally an outer product of the arrays collapsed
    in specific extents by summing along the appropriate diagonals.
  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:
    - jsignell
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
