{% set version = "1.4.7" %}

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

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

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

  sha256: 5ac068e40e6c90868da7ab44f8a24c32552cffacdca6545854a34bc9ab6b10a1

build:
  merge_build_host: True  # [win]
  number: 2
  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-matrix
    - r-rcpp >=0.11.1

  run:
    - r-base
    - r-matrix
    - r-rcpp >=0.11.1

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

about:
  home: https://cran.r-project.org/web/packages/apcluster/index.html
  license: GPL (>= 2)
  summary: Implements Affinity Propagation clustering introduced by Frey and Dueck (2007) <DOI
  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:
    - dpryan79
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
