{% set version = "2.3.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: 3fdf2d8fefa6ab14cd0992740de7958f9f501c71aca93229f5eb03c54558fc38

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-matrix

  run:
    - r-base
    - r-matrix

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
