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

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

source:
  fn: ergm_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/ergm_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/ergm/ergm_{{ version }}.tar.gz
  sha256: 5a8a15599dd49a7f49efb8a5db5d19e0a4a6f89e83db299e64903c6efbc399c8

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

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed  # [win]
    - {{posix}}coreutils  # [win]

  host:
    - r-base
    - r-mass
    - r-matrix
    - r-coda >=0.18_1
    - r-lpsolve
    - r-network >=1.13
    - r-robustbase >=0.9_10
    - r-statnet.common >=4.0.0
    - r-trust

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-mass
    - r-matrix
    - r-coda >=0.18_1
    - r-lpsolve
    - r-network >=1.13
    - r-robustbase >=0.9_10
    - r-statnet.common >=4.0.0
    - r-trust

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

about:
  home: http://statnet.org
  license: GPL-3
  summary: An integrated set of tools to analyze and simulate networks based on exponential-family
    random graph models (ERGMs). 'ergm' is a part of the Statnet suite of packages for
    network analysis.
  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:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - stevierene82
