{% set version = "0.1-11" %}

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

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

source:
  fn: multicool_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/multicool_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/multicool/multicool_{{ version }}.tar.gz
  sha256: 1c907e64af2ac39facdf431a5691e69649f64af1f50e198ae39da5bf30026476

build:
  merge_build_host: True  # [win]
  number: 1
  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]
  host:
    - r-base
    - r-rcpp >=0.11.2
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=0.11.2

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

about:
  home: https://CRAN.R-project.org/package=multicool
  license: GPL-2
  summary: A set of tools to permute multisets without loops or hash tables and to generate integer
    partitions. The permutation functions are based on C code from Aaron Williams. Cool-lex
    order is similar to colexicographical order. The algorithm is described in Williams,
    A. (2009)  <DOI:10.1145/1496770.1496877> Loopless Generation of Multiset Permutations
    by Prefix Shifts. Symposium on Discrete Algorithms, New York, United States. The
    permutation code is distributed without restrictions. The code for stable and efficient
    computation of multinomial coefficients comes from Dave Barber. The code can be
    download from <http://tamivox.org/dave/multinomial/code.html> and is distributed
    without conditions. The package also generates the integer partitions of a positive,
    non-zero integer n. The C++ code for this is based on Python code from Jerome Kelleher
    which can be found here <http://jeromekelleher.net/tag/integer-partitions.html>.
    The C++ code and Python code are distributed without conditions.
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

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