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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/GUILDS_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/GUILDS/GUILDS_{{ version }}.tar.gz
  sha256: 33be14a374ff190dfaa011dc85119f137e778b9e4327916341a8b1a0bb1b333b

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 }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-rcpp >=0.11.0
    - r-nloptr
    - r-pracma
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.11.0
    - r-nloptr
    - r-pracma

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

about:
  home: https://github.com/thijsjanzen/GUILDS
  license: GPL-2.0-only
  summary: A collection of sampling formulas for the unified neutral model of biogeography and biodiversity. Alongside the sampling formulas, it includes methods to perform maximum likelihood optimization of the sampling formulas, methods to generate data given the neutral model, and methods to estimate the expected species
    abundance distribution. Sampling formulas included in the GUILDS package are the Etienne Sampling Formula (Etienne 2005), the guild sampling formula, where guilds are assumed to differ in dispersal ability (Janzen et al. 2015), and  the guilds sampling formula conditioned on guild size (Janzen et al. 2015).
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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

# Package: GUILDS
# Type: Package
# Title: Implementation of Sampling Formulas for the Unified Neutral Model of Biodiversity and Biogeography, with or without Guild Structure
# Version: 1.3
# Authors@R: c( person("Thijs","Janzen", email = "thijsjanzen@gmail.com",role=c("aut","cre")), person("Bart","Haegeman",email="",role = c("ctb")), person("Franck","Jabot",role = c("ctb")), person("Jerome","Chave",role = c("ctb")))
# Description: A collection of sampling formulas for the unified neutral model of biogeography and biodiversity. Alongside the sampling formulas, it includes methods to perform maximum likelihood optimization of the sampling formulas, methods to generate data given the neutral model, and methods to estimate the expected species abundance distribution. Sampling formulas included in the GUILDS package are the Etienne Sampling Formula (Etienne 2005), the guild sampling formula, where guilds are assumed to differ in dispersal ability (Janzen et al. 2015), and  the guilds sampling formula conditioned on guild size (Janzen et al. 2015).
# License: GPL-2
# Imports: Rcpp (>= 0.11.0), pracma
# Suggests: testthat, knitr, rmarkdown
# LinkingTo: Rcpp
# NeedsCompilation: yes
# Repository: CRAN
# URL: https://github.com/thijsjanzen/GUILDS
# BugReports: https://github.com/thijsjanzen/GUILDS/issues
# VignetteBuilder: knitr
# Packaged: 2016-09-24 14:24:01 UTC; janzen
# Author: Thijs Janzen [aut, cre], Bart Haegeman [ctb], Franck Jabot [ctb], Jerome Chave [ctb]
# Maintainer: Thijs Janzen <thijsjanzen@gmail.com>
# Date/Publication: 2016-09-26 21:21:03
