{% set version = '2.3.1' %}

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

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

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

  sha256: 518c31f5b2c5f0a655d02a3c71b00c30caea2794dfc31f9d63f3d505bd7863eb

build:
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - r-base
    - r-matrix
    - r-rcpp
    - r-ape >=5.0
    - r-fastmatch
    - r-igraph >=1.0
    - r-magrittr
    - r-quadprog
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-matrix
    - r-rcpp
    - r-ape >=5.0
    - r-fastmatch
    - r-igraph >=1.0
    - r-magrittr
    - r-quadprog
    - libgcc  # [not win]

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

about:
  home: https://cran.r-project.org/web/packages/phangorn/index.html
  license: GPL (>= 2)
  summary: Package contains methods for estimation of phylogenetic trees and networks using Maximum
    Likelihood, Maximum Parsimony, distance methods and Hadamard conjugation. Allows
    to compare trees, models selection and offers visualizations for trees and split
    networks.
  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:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
