{% set version = '0.3.3' %}

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

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

source:
  fn: dendsort_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/dendsort_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/dendsort/dendsort_{{ version }}.tar.gz
  sha256: d54713cb230a7523cb87f1c7f2d68d9c570c01e61b551457bd71bb7bd38198d4

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

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

requirements:
  build:
    - r-base

  run:
    - r-base

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

about:
  home: https://cran.r-project.org/web/packages/dendsort
  license: GPL-2 | GPL-3
  summary: An implementation of functions to optimize ordering of nodes in a dendrogram, without
    affecting the meaning of the dendrogram. A dendrogram can be sorted based on the
    average distance of subtrees, or based on the smallest distance value. These sorting
    methods improve readability and interpretability of tree structure, especially for
    tasks such as comparison of different distance measures or linkage types and identification
    of tight clusters and outliers. As a result, it also introduces more meaningful
    reordering for a coupled heatmap visualization.
  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
    - roryk
