{% set version = '1.0.0' %}

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

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

source:
  fn: tidygraph_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/tidygraph_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/tidygraph/tidygraph_{{ version }}.tar.gz
  sha256: a00256841dd1f6e19e8c26e2224d3809055cb18f59e8567f9a3dd42139ac12fc

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-r6
    - r-rcpp
    - r-dplyr >=0.7
    - r-igraph
    - r-magrittr
    - r-rlang
    - r-tibble
    - r-tidyr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-r6
    - r-rcpp
    - r-dplyr >=0.7
    - r-igraph
    - r-magrittr
    - r-rlang
    - r-tibble
    - r-tidyr
    - libgcc  # [not win]

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

about:
  home: https://cran.r-project.org/package=tidygraph
  license: GPL (>= 2)
  summary: A graph, while not "tidy" in itself, can be thought of as two tidy data frames describing
    node and edge data respectively. 'tidygraph' provides an approach to manipulate
    these two virtual data frames using the API defined in the 'dplyr' package, as well
    as provides tidy interfaces to  a lot of common graph algorithms.
  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:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
