{% set version = '1.9-12' %}

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

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

source:
  fn: ptw_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/ptw_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/ptw/ptw_{{ version }}.tar.gz
  sha256: cdb1752e04e661e379f11867b0a17e2177e9ee647c54bbcc37d39d6b8c062b84

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - r-nloptr
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

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

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

about:
  home: https://CRAN.R-project.org/package=ptw
  license: GPL (>= 2)
  summary: 'Parametric Time Warping aligns patterns, i.e. it aims to put corresponding features
    at the same locations. The algorithm searches for an optimal polynomial describing
    the warping. It is possible to align one sample to a reference, several samples
    to the same reference, or several samples to several references. One can choose
    between calculating individual warpings, or one global warping for a set of samples
    and one reference. Two optimization criteria are implemented: RMS (Root Mean Square
    error) and WCC (Weighted Cross Correlation). Both warping of peak profiles and of
    peak lists are supported.'

  license_family: GPL3

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