{% set version = '1.2-60' %}

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

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

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

  sha256: cc74225fe6a092b4b98bebcc42b5ce5632dd492cc2368b4e8087fed87c6a158b

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

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

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

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

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

about:
  home: https://CRAN.R-project.org/package=GenKern
  license: GPL-2
  summary: Computes generalised KDEs
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}\/lib\/R\/share\/licenses\/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]
extra:
   recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - Johanneskoester
    - Bgruening
    - Daler
    - Jdblischak
