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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/latentnet_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/latentnet/latentnet_{{ version }}.tar.gz
  sha256: bb20afa74d631146feaae04d9b592294f681c274b59547c50dbb4613d471d217

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - libblas
    - libcblas
    - liblapack
    - r-base
    - r-mass
    - r-abind
    - r-coda >=0.17.1
    - r-ergm >=3.9.0
    - r-mvtnorm
    - r-network
    - r-sna
    - r-statnet.common >=4.1.0
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-mass
    - r-abind
    - r-coda >=0.17.1
    - r-ergm >=3.9.0
    - r-mvtnorm
    - r-network
    - r-sna
    - r-statnet.common >=4.1.0

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

about:
  home: http://www.statnet.org
  license: GPL-3.0-only
  summary: Fit and simulate latent position and cluster models for statistical networks. See
    Krivitsky and Handcock (2008) <10.18637/jss.v024.i05> and Krivitsky, Handcock, Raftery,
    and Hoff (2009) <10.1016/j.socnet.2009.04.001>.
  license_family: GPL3
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'
    - LICENSE

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