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

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

source:
  fn: RcppRoll_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/RcppRoll_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/RcppRoll/RcppRoll_{{ version }}.tar.gz
  sha256: cbff2096443a8a38a6f1dabf8c90b9e14a43d2196b412b5bfe5390393f743f6b

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_cxx') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-rcpp
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp

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

about:
  home: https://CRAN.R-project.org/package=RcppRoll
  license: GPL (>= 2)
  summary: Provides fast and efficient routines for common rolling / windowed operations. Routines
    for the efficient computation of windowed mean, median, sum, product, minimum, maximum,
    standard deviation and variance are provided.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

extra:
  recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
