{% set version = '1.18-1' %}
{% set native = 'm2w64-' if win else '' %}

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

source:
  fn: dtw_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/dtw_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/dtw/dtw_{{ version }}.tar.gz
  sha256: d9dab25bdf61705f9f28dc5ca1c96a7465b269233e878516c52c01b5a0da21ad

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-proxy
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-proxy
    - libgcc  # [not win]

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

about:
  home: http://dtw.r-forge.r-project.org/
  license: GPL-2
  summary: A comprehensive implementation of dynamic time warping (DTW) algorithms in R.  DTW
    computes the optimal (least cumulative distance) alignment between points of two
    time series.  Common DTW variants covered include local (slope) and global (window)
    constraints, subsequence matches, arbitrary distance definitions, normalizations,
    minimum variance matching, and so on.  Provides cumulative distances, alignments,
    specialized plot styles, etc.
  license_family: GPL

extra:
  recipe-maintainers:
    - bgruening
    - daler
    - johanneskoester
    - rvalieris
