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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/graphicalVAR_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/graphicalVAR/graphicalVAR_{{ version }}.tar.gz
  sha256: 0502dcf513773b068402959d8c05b9fb981df013f26e6b053eae5c3cff007bd7

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:
    - libblas
    - libcblas
    - liblapack
    - liblapacke
    - r-base
    - r-matrix
    - r-rcpp >=0.11.3
    - r-rcpparmadillo
    - r-dplyr
    - r-glasso
    - r-glmnet
    - r-igraph
    - r-mvtnorm
    - r-qgraph >=1.3.1

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-matrix
    - r-rcpp >=0.11.3
    - r-rcpparmadillo
    - r-dplyr
    - r-glasso
    - r-glmnet
    - r-igraph
    - r-mvtnorm
    - r-qgraph >=1.3.1

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

about:
  home: https://CRAN.R-project.org/package=graphicalVAR
  license: GPL-2.0-only
  summary: Estimates within and between time point interactions in experience sampling data, using the Graphical vector autoregression model in combination with regularization. See also Epskamp, Waldorp, Mottus & Borsboom (2018) <doi:10.1080/00273171.2018.1454823>.

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

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