{% set version = '0.2.0' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/spacefillr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/spacefillr/spacefillr_{{ version }}.tar.gz
  sha256: 490c1f514d4753969f183266096435f59cd82b1947beeff5c8ea7c2364f91cbf

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]

  host:
    - r-base
    - r-rcpp >=1.0.0

  run:
    - r-base
    - {{ native }}gcc-libs  # [win]
    - r-rcpp >=1.0.0

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

about:
  home: https://github.com/tylermorganwall/spacefillr

  license: MIT
  summary: 'Generates random and quasi-random space-filling sequences. Supports the following
    sequences: ''Halton'', ''Sobol'', ''Owen''-scrambled ''Sobol'',  ''Owen''-scrambled
    ''Sobol'' with errors distributed as blue noise, progressive jittered, progressive
    multi-jittered (''PMJ''), ''PMJ'' with blue noise, ''PMJ02'', and ''PMJ02'' with
    blue noise. Includes a ''C++'' ''API''. Methods derived from "Constructing Sobol
    sequences with better two-dimensional projections" (2012) <doi:10.1137/070709359>
    S. Joe and F. Y. Kuo, "Progressive Multi-Jittered Sample Sequences" (2018) <https://graphics.pixar.com/library/ProgressiveMultiJitteredSampling/paper.pdf>
    Christensen, P., Kensler, A. and Kilpatrick, C., and "A Low-Discrepancy Sampler
    that Distributes Monte Carlo Errors as a Blue Noise in Screen Space" (2019) E. Heitz,
    B. Laurent, O. Victor, C. David and I. Jean-Claude, <doi:10.1145/3306307.3328191>.'

  license_family: MIT
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/MIT'
    - LICENSE

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