{% set version = '1.4.30' %}

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

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

source:
  fn: statmod_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/statmod_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/statmod/statmod_{{ version }}.tar.gz
  sha256: 9d2c1722a85f53623a9ee9f73d835119ae22ae2b8ec7b50d675401e314ea641f

build:
  merge_build_host: True  # [win]
  number: 2
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=statmod
  license: GPL-2 | GPL-3
  summary: A collection of algorithms and functions to aid statistical modeling. Includes growth
    curve comparisons, limiting dilution analysis (aka ELDA), mixed linear models, heteroscedastic
    regression, inverse-Gaussian probability calculations, Gauss quadrature and a secure
    convergence algorithm for nonlinear models.  Includes advanced generalized linear
    model functions that implement secure convergence, dispersion modeling and Tweedie
    power-law families.
  license_family: GPL3

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