{% set version = '1.2.2' %}

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

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

source:
  fn: igraph_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/igraph_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/igraph/igraph_{{ version }}.tar.gz
  sha256: 9da2dadf9c1ed495413b32464c6a32fae9d33636822754043e708d8dd6a9efad

build:
  merge_build_host: True  # [win]
  number: 1001

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}sed               # [win]
    - {{posix}}grep              # [win]
    - {{posix}}autoconf
    - {{posix}}automake          # [not win]
    - {{posix}}automake-wrapper  # [win]
    - {{posix}}pkg-config
    - {{posix}}make
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-matrix
    - r-magrittr
    - r-pkgconfig >=2.0.0
    - {{native}}gmp >=5.0.1,<7

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-matrix
    - r-magrittr
    - r-pkgconfig >=2.0.0
    - {{native}}gmp >=5.0.1,<7

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

about:
  home: http://igraph.org
  license: GPL (>= 2)
  summary: Routines for simple graphs and network analysis. It can handle large graphs very well
    and provides functions for generating random and regular graphs, graph visualization,
    centrality methods and much more.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
