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

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

source:
  fn: rootSolve_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/rootSolve_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/rootSolve/rootSolve_{{ version }}.tar.gz
  sha256: 08b3bb63f04fc0b065cb615b6ca1ef95eb6df7a813eb9eb625bc15c6de332c22

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{native}}toolchain        # [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('rootSolve')"           # [not win]
    - "\"%R%\" -e \"library('rootSolve')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=rootSolve
  license: GPL (>= 2)
  summary: 'Routines to find the root of nonlinear functions, and to perform steady-state and
    equilibrium analysis of ordinary differential equations (ODE).  Includes routines
    that: (1) generate gradient and jacobian matrices (full and banded), (2) find roots
    of non-linear equations by the ''Newton-Raphson'' method,  (3) estimate steady-state
    conditions of a system of (differential) equations in full, banded or sparse form,
    using the ''Newton-Raphson'' method, or by dynamically running, (4) solve the steady-state
    conditions for uni-and multicomponent 1-D, 2-D, and 3-D partial differential equations,
    that have been converted to ordinary differential equations by numerical differencing
    (using the method-of-lines approach). Includes fortran code.'
  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:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
