{% set version = "1.5.0" %}

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

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

source:
  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: d61c3ef9b09d55b42e038f8d767fa483ebbdec2a9c7172b1b0ccda0ae0016ec9

build:
  merge_build_host: true  # [win]
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - 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.0-or-later
  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
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
