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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/irlba_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/irlba/irlba_{{ version }}.tar.gz
  sha256: 2cfe6384fef91c223a9920895ce89496f990d1450d731e44309fdbec2bb5c5cf

build:
  merge_build_host: true  # [win]
  number: 2
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - r-matrix                   # [build_platform != target_platform]
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ posix }}filesystem      # [win]
    - {{ posix }}make
    - {{ posix }}sed             # [win]
    - {{ posix }}coreutils       # [win]
    - {{ posix }}zip             # [win]
  host:
    - r-base
    - r-matrix >=1.6_2
    - libblas
    - liblapack
  run:
    - r-base
    - {{ native }}gcc-libs       # [win]
    - r-matrix >=1.6_2

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

about:
  home: https://CRAN.R-project.org/package=irlba
  dev_url: https://github.com/bwlewis/irlba
  license: GPL-3.0-only
  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
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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