{% set version = '2.1.2' %}

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

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

source:
  fn: irlba_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/irlba_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/irlba/irlba_{{ version }}.tar.gz
  sha256: 5183e8dd7943df11c0f44460566adf06c03d5320f142699298f516d423b06ce1

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

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

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

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

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

about:
  home: https://CRAN.R-project.org/package=irlba
  license: GPL-3
  summary: Fast and memory efficient methods for truncated singular and eigenvalue decompositions
    and principal component analysis of large sparse or dense matrices.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
