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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/changepoint_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/changepoint/changepoint_{{ version }}.tar.gz
  sha256: 727edd88f1e39885654d319688bf088942984e240b28db2fbc204c764b8a73c9

build:
  merge_build_host: True  # [win]
  number: 1004
  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]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-zoo >=0.9_1
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-zoo >=0.9_1

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

about:
  home: https://github.com/rkillick/changepoint/
  license: GPL-2.0-or-later
  summary: Implements various mainstream and specialised changepoint methods for finding single
    and multiple changepoints within data.  Many popular non-parametric and frequentist
    methods are included.  The cpt.mean(), cpt.var(), cpt.meanvar() functions should
    be your first point of call.
  license_family: GPL
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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