{% set version = "0.8.3" %}

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

package:
  name: r-rncl
  version: {{ version }}

source:
  fn: rncl_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rncl_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rncl/rncl_{{ version }}.tar.gz
  sha256: daaef6874438233c73a62b59a9ee10261e1e10d7ef18b7178d2d8b517fd4880d

build:
  merge_build_host: True  # [win]
  number: 2
  script: R CMD INSTALL --build .
  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.11.0
    - r-progress
  run:
    - r-base
    - r-rcpp >=0.11.0
    - r-progress

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

about:
  home: https://cran.r-project.org/web/packages/rncl
  license: BSD 2 Clause
  license_file: LICENSE
  summary: An interface to the Nexus Class Library which allows parsing of NEXUS, Newick and
    other phylogenetic tree file formats. It provides elements of the file that can
    be used to build phylogenetic objects such as ape's 'phylo' or phylobase's 'phylo4(d)'.
    This functionality is demonstrated with 'read_newick_phylo()' and 'read_nexus_phylo()'.

extra:
  recipe-maintainers:
    - dpryan79
    - ocefpaf
