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

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

source:
  fn: nnls_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/nnls_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/nnls/nnls_{{ version }}.tar.gz
  sha256: 0e5d77abae12bc50639d34354f96a8e079408c9d7138a360743b73bd7bce6c1f

build:
  merge_build_host: True  # [win]
  number: 1003
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_fortran') }}        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=nnls
  license: GPL (>= 2)
  summary: An R interface to the Lawson-Hanson implementation of an algorithm for non-negative
    least squares (NNLS).  Also allows the combination of non-negative and non-positive
    constraints.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
