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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/qgraph_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/qgraph/qgraph_{{ version }}.tar.gz
  sha256: e1d7489c4db47878dccd34ded7e8173d58a190ad453d2e6e89f33549ccfd10aa

build:
  merge_build_host: true  # [win]
  number: 0

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [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:
    - r-base
    - r-hmisc
    - r-matrix
    - r-rcpp >=1.0.0
    - r-abind
    - r-colorspace
    - r-corpcor
    - r-dplyr
    - r-fdrtool
    - r-ggplot2
    - r-glasso
    - r-gtools
    - r-igraph
    - r-jpeg
    - r-lavaan
    - r-pbapply
    - r-plyr
    - r-png
    - r-psych
    - r-reshape2

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-hmisc
    - r-matrix
    - r-rcpp >=1.0.0
    - r-abind
    - r-colorspace
    - r-corpcor
    - r-dplyr
    - r-fdrtool
    - r-ggplot2
    - r-glasso
    - r-gtools
    - r-igraph
    - r-jpeg
    - r-lavaan
    - r-pbapply
    - r-plyr
    - r-png
    - r-psych
    - r-reshape2

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

about:
  home: https://CRAN.R-project.org/package=qgraph
  license: GPL-2.0-only
  summary: Weighted network visualization and analysis, as well as Gaussian graphical model computation. See Epskamp et al. (2012) <doi:10.18637/jss.v048.i04>.

  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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