{% set version = "1.3.4" %}

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

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

source:
  fn: castor_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/castor_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/castor/castor_{{ version }}.tar.gz
  sha256: 64cb588ee574f2d1394a1cce7c2cc0be9cd3550c24ede2e2e709056413ec0b3e

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('cxx') }}        # [unix]
    - {{ compiler('m2w64_cxx') }}  # [win]
  host:
    - r-base
    - r-rcpp >=0.12.10
    - r-naturalsort

  run:
    - r-base
    - r-rcpp >=0.12.10
    - r-naturalsort

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

about:
  home: https://CRAN.R-project.org/package=castor
  license: GPL (>= 2)
  summary: Efficient tree manipulations for large phylogenies, including pruning, rerooting,
    calculation of most-recent common ancestors, calculating distances from the tree
    root and calculating pairwise distances. Calculation of phylogenetic signal and
    mean trait depth (trait conservatism), ancestral state reconstruction and hidden
    character prediction of discrete characters. Simulating and fitting models of trait
    evolution, and generating random trees using birth-death models. Dating trees, comparing
    two trees, and reading/writing trees to a file. Citation - Louca, Stilianos and Doebeli,
    Michael (2017) <doi:10.1093/bioinformatics/btx701>.
  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:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - gavinmdouglas
