{% set version = '0.8' %}

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

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

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

  sha256: e643eda1c47dd7fae2ec7454c7c2658961cd8e80dc3b18bcc0e6a664fed059b6

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

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

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

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

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

about:
  home: https://cran.r-project.org/web/packages/sme/index.html
  license: GPL (>= 3)
  summary: A package for fitting smoothing-splines mixed-effects models to replicated functional
    data sets.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}\/lib\/R\/share\/licenses\/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]
extra:
   recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
