{% set version = '0.3.2.9.1' %}

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

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

source:
  fn: RcppEigen_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RcppEigen_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RcppEigen/RcppEigen_{{ version }}.tar.gz
  sha256: fd4c3a74a906fe88c5f03befc283bee2dfc3a20c7d1a7a2b03a3b0253d2009c6

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

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

requirements:
  build:
    - r-base
    - r-matrix >=1.1_0
    - r-rcpp >=0.11.0
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-matrix >=1.1_0
    - r-rcpp >=0.11.0
    - libgcc  # [not win]

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

about:
  home: http://dirk.eddelbuettel.com/code/rcpp.eigen.html
  license: GPL (>= 2)
  summary: |
    R and ''Eigen'' integration using ''Rcpp''. ''Eigen'' is a C++ template library for
    linear algebra: matrices, vectors, numerical solvers and related algorithms.  It
    supports dense and sparse matrices on integer, floating point and complex numbers,
    decompositions of such matrices, and solutions of linear systems. Its performance
    on many algorithms is comparable with some of the best implementations based on
    ''Lapack'' and level-3 ''BLAS''. . The ''RcppEigen'' package includes the header
    files from the ''Eigen'' C++ template library (currently version 3.2.9). Thus users
    do not need to install ''Eigen'' itself in order to use ''RcppEigen''. . Since version
    3.1.1, ''Eigen'' is licensed under the Mozilla Public License (version 2); earlier
    version were licensed under the GNU LGPL version 3 or later. ''RcppEigen'' (the
    ''Rcpp'' bindings/bridge to ''Eigen'') is licensed under the GNU GPL version 2 or
    later, as is the rest of ''Rcpp''
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
