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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/diptest_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/diptest/diptest_{{ version }}.tar.gz
  sha256: 508a5ebb161519cd0fcd156dc047b51becb216d545d62c6522496463f94ec280

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

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

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

about:
  home: https://CRAN.R-project.org/package=diptest
  license: GPL-2.0-or-later
  summary: Compute Hartigan's dip test statistic for unimodality / multimodality and provide a test with simulation based p-values,  where the original public code has been corrected.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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