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

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

source:
  fn: limSolve_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/limSolve_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/limSolve/limSolve_{{ version }}.tar.gz
  sha256: 2f27c03411e0d771ad50d5412125bf4fa0ba461051610edc77e20d28488e86d2

build:
  merge_build_host: True  # [win]
  number: 1002
  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
    - r-mass
    - r-lpsolve
    - r-quadprog
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-mass
    - r-lpsolve
    - r-quadprog

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

about:
  home: https://CRAN.R-project.org/package=limSolve
  license: GPL
  summary: 'Functions that (1) find the minimum/maximum of a linear or quadratic function: min
    or max (f(x)), where f(x) = ||Ax-b||^2 or f(x) = sum(a_i*x_i) subject to equality
    constraints Ex=f and/or inequality constraints Gx>=h, (2) sample an underdetermined-
    or overdetermined system Ex=f subject to Gx>=h, and if applicable Ax~=b,       (3)
    solve a linear system Ax=B for the unknown x. It includes banded and tridiagonal
    linear systems.  The package calls Fortran functions from ''LINPACK''.'
  license_family: GPL

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