{% set version = '4.3' %}

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

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

source:
  fn: bnlearn_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/bnlearn_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/bnlearn/bnlearn_{{ version }}.tar.gz

  sha256: 78bb1d45977801ffa64f04f4319fa6e1fe9b5268f42b197d33aac074dc46f787

build:
  merge_build_host: True  # [win]
  number: 1000
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/bnlearn/index.html
  license: GPL (>= 2)
  summary: Bayesian network structure learning, parameter learning and inference. This package
    implements constraint-based (PC, GS, IAMB, Inter-IAMB, Fast-IAMB, MMPC, Hiton-PC),
    pairwise (ARACNE and Chow-Liu), score-based (Hill-Climbing and Tabu Search) and
    hybrid (MMHC and RSMAX2) structure learning algorithms for discrete, Gaussian and
    conditional Gaussian networks, along with many score functions and conditional independence
    tests. The Naive Bayes and the Tree-Augmented Naive Bayes (TAN) classifiers are
    also implemented. Some utility functions (model comparison and manipulation, random
    data generation, arc orientation testing, simple and advanced plots) are included,
    as well as support for parameter estimation (maximum likelihood and Bayesian) and
    inference, conditional probability queries and cross-validation. Development snapshots
    with the latest bugfixes are available from <http
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
   recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - Johanneskoester
    - Bgruening
    - Daler
    - Jdblischak
