{% set version = "1.1.25" %}

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

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

source:
  fn: fastcluster_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/fastcluster_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/fastcluster/fastcluster_{{ version }}.tar.gz
  sha256: f3661def975802f3dd3cec5b2a1379f3707eacff945cf448e33aec0da1ed4205

build:
  merge_build_host: True  # [win]
  number: 1002
  script: R CMD INSTALL --build .
  skip: True  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

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

  run:
    - r-base

test:
  commands:
    - $R -e "library('fastcluster')"  # [not win]
    - "\"%R%\" -e \"library('fastcluster')\""  # [win]
    - conda inspect linkages -p $PREFIX r-fastcluster  # [not win]
    - conda inspect objects -p $PREFIX r-fastcluster  # [osx]

about:
  home: http://danifold.net/fastcluster.html
  license: FreeBSD | GPL-2 | file
  summary: 'This is a two-in-one package which provides interfaces to both R and Python. It implements
    fast hierarchical, agglomerative clustering routines. Part of the functionality
    is designed as drop-in replacement for existing routines: linkage() in the SciPy
    package ''scipy.cluster.hierarchy'', hclust() in R''s ''stats'' package, and the
    ''flashClust'' package. It provides the same functionality with the benefit of a
    much faster implementation. Moreover, there are memory-saving routines for clustering
    of vector data, which go beyond what the existing packages provide. For information
    on how to install the Python files, see the file INSTALL in the source distribution.'
  license_family: GPL2

extra:
  recipe-maintainers:
    - conda-forge/r
    - dpryan79
    - jsignell
