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

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

source:
  fn: support_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/support_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/support/support_{{ version }}.tar.gz
  sha256: aa74024d03162d579d44f10cf8b3fe2b3e1929d6c1619cafac2daff9201403c6

build:
  merge_build_host: True  # [win]
  number: 1000
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-bh
    - r-mhadaptive
    - r-rcpp >=0.12.4
    - r-rcpparmadillo
    - r-doparallel
    - r-matrixstats
    - r-nloptr
    - r-randtoolbox
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-bh
    - r-mhadaptive
    - r-rcpp >=0.12.4
    - r-rcpparmadillo
    - r-doparallel
    - r-matrixstats
    - r-nloptr
    - r-randtoolbox

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

about:
  home: https://CRAN.R-project.org/package=support
  license: GPL (>= 2)
  summary: Provides the function sp() for generating the support points proposed in Mak and Joseph
    (2017) <arXiv:1609.01811>. Support points are representative points of a possibly
    non-uniform  distribution, and can be used as optimal sampling or integration points
    for a distribution of choice. The provided function sp() can be used to generate
    support points for standard distributions or for reducing big data (e.g., from Markov-chain
    Monte Carlo methods). This work was supported by USARO grant W911NF-14-1-0024 and
    NSF DMS grant 1712642.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
