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

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

source:
  fn: cubature_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/cubature_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/cubature/cubature_{{ version }}.tar.gz
  sha256: 605bdd9d90fb6645359cccd1b289c5afae235b46360ef5bdd2001aa307a7694e

build:
  merge_build_host: true  # [win]
  number: 0
  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('cubature')"           # [not win]
    - "\"%R%\" -e \"library('cubature')\""  # [win]

about:
  home: https://github.com/bnaras/cubature
  license: GPL-3
  summary: R wrapper around the cubature C library of Steven G. Johnson for adaptive multivariate integration over hypercubes. This version provides both hcubature and pcubature routines in addition to a vector interface that results in substantial speed gains.
  license_family: GPL3
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

extra:
  recipe-maintainers:
    - conda-forge/r
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
