{% set version = '1.0.0' %}

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

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

source:
  fn: ggraph_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ggraph_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ggraph/ggraph_{{ version }}.tar.gz
  sha256: 489291282f1895a7a8f2ed3a1b743cfae347edcbf663158009407c3cd9c47076

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

requirements:
  build:
    - r-base
    - r-mass
    - r-rcpp
    - r-digest
    - r-dplyr
    - r-ggforce
    - r-ggplot2 >=2.0.0
    - r-ggrepel
    - r-gtable
    - r-igraph >=1.0.0
    - r-plyr
    - r-scales
    - r-viridis
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-rcpp
    - r-digest
    - r-dplyr
    - r-ggforce
    - r-ggplot2 >=2.0.0
    - r-ggrepel
    - r-gtable
    - r-igraph >=1.0.0
    - r-plyr
    - r-scales
    - r-viridis
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=ggraph
  license: GPL-3
  summary: The grammar of graphics as implemented in ggplot2 is a poor fit for graph and network
    visualizations due to its reliance on tabular data input. ggraph is an extension
    of the ggplot2 API tailored to graph visualizations and provides the same flexible
    approach to building up plots layer by layer.
  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
