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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/SYNCSA_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/SYNCSA/SYNCSA_{{ version }}.tar.gz
  sha256: 7202fb1386b07a99baf11d599a81e509324c92ff06e96e8cd168982ec0503f59

build:
  merge_build_host: True  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-fd
    - r-rcpparmadillo
    - r-permute
    - r-vegan
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-fd
    - r-rcpparmadillo
    - r-permute
    - r-vegan

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

about:
  home: https://CRAN.R-project.org/package=SYNCSA
  license: GPL-2.0-only
  summary: Analysis of metacommunities based on functional traits and phylogeny of the community
    components. The functions that are offered here implement for the R environment
    methods that have been available in the SYNCSA application written in C++ (by Valerio
    Pillar, available at <http://ecoqua.ecologia.ufrgs.br/SYNCSA.html>).
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

extra:
  recipe-maintainers:
    - conda-forge/r
    - clami66
