{% set version = '1.0-13' %}

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

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

source:
  fn: multitaper_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/multitaper_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/multitaper/multitaper_{{ version }}.tar.gz
  sha256: 458dee8d46a068ccfb4d985cf63c905126e9d980386ec1d5f56796b6e14a6eb2

build:
  merge_build_host: True  # [win]
  number: 1
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://github.com/krahim/multitaper/
  license: GPL (>= 2)
  summary: 'Implements multitaper spectral analysis using discrete prolate spheroidal sequences
    (Slepians) and sine tapers. It includes an adaptive weighted multitaper spectral
    estimate, a coherence estimate, Thomson''s Harmonic F-test, and complex demodulation.
    The Slepians sequences are generated efficiently using a tridiagonal matrix solution,
    and jackknifed confidence intervals are available for most estimates.   '

  license_family: GPL3

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