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

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

source:
  fn: geigen_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/geigen_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/geigen/geigen_{{ version }}.tar.gz
  sha256: d06a8898ab40ebaaaac29a4a4519cf0d3ca3a45aa06023d802c2d9ebb9d59aaa

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

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

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

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

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

about:
  home: https://CRAN.R-project.org/package=geigen
  license: GPL (>= 2)
  summary: Functions to compute generalized eigenvalues and eigenvectors, the generalized Schur
    decomposition and the generalized Singular Value Decomposition of a matrix pair,
    using Lapack routines.
  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:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
