{% set version = '0.20.6' %}

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

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

source:
  fn: NMF_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/NMF_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/NMF/NMF_{{ version }}.tar.gz
  sha256: dfccd4b4d6ec90cd7628fd128d2456d792f406cee4d32b13448dcb0ffe4ab056

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcolorbrewer
    - r-cluster
    - r-colorspace
    - r-digest
    - r-doparallel
    - r-foreach
    - r-ggplot2
    - r-gridbase
    - r-pkgmaker >=0.20
    - r-registry
    - r-reshape2
    - r-rngtools >=1.2.3
    - r-stringr >=1.0.0
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-rcolorbrewer
    - r-cluster
    - r-colorspace
    - r-digest
    - r-doparallel
    - r-foreach
    - r-ggplot2
    - r-gridbase
    - r-pkgmaker >=0.20
    - r-registry
    - r-reshape2
    - r-rngtools >=1.2.3
    - r-stringr >=1.0.0
    - libgcc  # [not win]

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

about:
  home: http://renozao.github.io/NMF
  license: GPL (>= 2)
  summary: Provides a framework to perform Non-negative Matrix Factorization (NMF). The package
    implements a set of already published algorithms and seeding methods, and provides
    a framework to test, develop and plug new/custom algorithms. Most of the built-in
    algorithms have been optimized in C++, and the main interface function provides
    an easy way of performing parallel computations on multicore machines.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
