{% set version = '2.0-0' %}

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

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

source:
  fn: JADE_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/JADE_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/JADE/JADE_{{ version }}.tar.gz

  sha256: b2fca64728e78c554b95dd153f183c3a0b9b339f78b50bd6ec2fab28b2c16c95

build:
  merge_build_host: True   # [win]
  number: 1001
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - {{ compiler('cxx') }}  # [not win]
    - {{ compiler('fortran') }}  # [not win]
  host:
    - r-base
    - r-clue
  run:
    - r-base
    - r-clue

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

about:
  home: https://CRAN.R-project.org/package=JADE
  license: GPL (>= 2)
  summary: Cardoso's JADE algorithm as well as his functions for joint diagonalization are ported
    to R. Also several other blind source separation (BSS) methods, like AMUSE and SOBI,
    and some criteria for performance evaluation of BSS algorithms, are given.
  license_family: GPL3
extra:
   recipe-maintainers:
    - dpryan79
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
