{% set version = '2.11' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/bipartite_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/bipartite/bipartite_{{ version }}.tar.gz
  sha256: e2b8231055bc766ce3764ac889bf986eea091c7df718676b622d20f44c3216aa

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

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

  host:
    - r-base
    - r-mass
    - r-fields
    - r-igraph
    - r-permute
    - r-sna
    - r-vegan

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-mass
    - r-fields
    - r-igraph
    - r-permute
    - r-sna
    - r-vegan

test:
  commands:

    - $R -e "library('bipartite')"           # [not win]
    - "\"%R%\" -e \"library('bipartite')\""  # [win]

about:
  home: https://github.com/biometry/bipartite
  license: GPL
  summary: 'Functions to visualise webs and calculate a series of indices commonly used to describe
    pattern in (ecological) webs. It focuses on webs consisting of only two levels (bipartite),
    e.g. pollination webs or predator-prey-webs. Visualisation is important to get an
    idea of what we are actually looking at, while the indices summarise different aspects
    of the web''s topology. '

  license_family: GPL

extra:
  recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
