{% set version = '3.3.1' %}

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

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

source:
  fn: nleqslv_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/nleqslv_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/nleqslv/nleqslv_{{ version }}.tar.gz
  sha256: 87eee7dad496539ede21bdb02bb0bc3793c9a390c000b0cd2bcd9b41ce5d3ad8

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

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=nleqslv
  license: GPL (>= 2)
  summary: Solve a system of nonlinear equations using a Broyden or a Newton method with a choice
    of global strategies such as line search and trust region. There are options for
    using a numerical or user supplied Jacobian, for specifying a banded numerical Jacobian
    and for allowing a singular or ill-conditioned Jacobian.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
